amazon ec2 - unable to resize root partition on EC2 centos -
i created ec2 machine using community image of centos 6.3 x64. have added 35 gb disk. when #df -h
filesystem size used avail use% mounted on /dev/xvda1 7.9g 1.2g 6.4g 16% / tmpfs 7.3g 0 7.3g 0% /dev/shm
my disk 35gb showing 8 gb in root , 7 tmpfs.
i tried use resize2fs didnt work on centos. disk has ext4 partation..
# resize2fs /dev/xvda resize2fs 1.41.12 (17-may-2010) resize2fs: device or resource busy while trying open /dev/xvda couldn't find valid filesystem superblock.
or if tried resize2fs /dev/xvda1 says device has nothing do.
any idea or other way, root disk(/). cant unmount it.
i found way that, resize2fs not working in case not sure why says device or resource busy. found article on resizedisk using fdisk can increase block size deleting , creating , make partition bootable. requires reboot. wont effect data if use same start cylinder.
# df -h <<1>> filesystem size used avail use% mounted on /dev/xvda1 6.0g 2.0g 3.7g 35% / tmpfs 15g 0 15g 0% /dev/shm # fdisk -l <<2>> disk /dev/xvda: 21.5 gb, 21474836480 bytes 97 heads, 17 sectors/track, 25435 cylinders units = cylinders of 1649 * 512 = 844288 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk identifier: 0x0003b587 device boot start end blocks id system /dev/xvda1 * 2 7632 6291456 83 linux # fdisk /dev/xvda <<3>> warning: dos-compatible mode deprecated. it's recommended switch off mode (command 'c') , change display units sectors (command 'u'). command (m help): u <<4>> changing display/entry units sectors command (m help): p <<5>> disk /dev/xvda: 21.5 gb, 21474836480 bytes 97 heads, 17 sectors/track, 25435 cylinders, total 41943040 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk identifier: 0x0003b587 device boot start end blocks id system /dev/xvda1 * 2048 12584959 6291456 83 linux command (m help): d <<6>> selected partition 1 command (m help): n <<7>> command action e extended p primary partition (1-4) p <<8>> partition number (1-4): 1 <<9>> first sector (17-41943039, default 17): 2048 <<10>> last sector, +sectors or +size{k,m,g} (2048-41943039, default 41943039): <<11>> using default value 41943039 command (m help): p <<12>> disk /dev/xvda: 21.5 gb, 21474836480 bytes 97 heads, 17 sectors/track, 25435 cylinders, total 41943040 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk identifier: 0x0003b587 device boot start end blocks id system /dev/xvda1 2048 41943039 20970496 83 linux command (m help): <<13>> partition number (1-4): 1 <<14>> command (m help): w <<15>> partition table has been altered! calling ioctl() re-read partition table. warning: re-reading partition table failed error 16: device or resource busy. kernel still uses old table. new table used @ next reboot or after run partprobe(8) or kpartx(8) syncing disks. # reboot <<16>> <wait> # df -h <<17>> filesystem size used avail use% mounted on /dev/xvda1 20g 2.0g 17g 11% / tmpfs 15g 0 15g 0% /dev/shm # resize2fs /dev/xvda1 <<18>> resize2fs 1.41.12 (17-may-2010) filesystem 5242624 blocks long. nothing do!
Comments
Post a Comment