vmware虚拟磁盘扩容 - zbunix/building GitHub Wiki
80GB--200GB无损磁盘空间调整
root@ubuntu:/# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p
Disk /dev/sdb: 161.1 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xce198f7c
Device Boot Start End Blocks Id System
/dev/sdb1 1 13054 104856223+ 83 Linux
Command (m for help): d
Selected partition 1
Command (m for help): p
Disk /dev/sdb: 161.1 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xce198f7c
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19581, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-19581, default 19581):
Using default value 19581
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
root@ubuntu:/# resize2fs /dev/sdb1
resize2fs 1.41.11 (14-Mar-2010)
Please run 'e2fsck -f /dev/sdb1' first.
root@ubuntu:/# e2fsck -f /dev/sdb1
e2fsck 1.41.11 (14-Mar-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 644411/6553600 files (0.1% non-contiguous), 9603414/26214055 blocks
root@ubuntu:/# resize2fs /dev/sdb1
resize2fs 1.41.11 (14-Mar-2010)
Resizing the filesystem on /dev/sdb1 to 39321087 (4k) blocks.
The filesystem on /dev/sdb1 is now 39321087 blocks long.