ext3的硬盘分区 重置大小

重启前
fdisk -ls

Disk /dev/sda: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 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: 0x000c64d7

Device Boot Start End Blocks Id System
/dev/sda1 1 12 96358+ 83 Linux
/dev/sda2 13 498 3903795 82 Linux swap / Solaris
/dev/sda3 499 10443 79883212+ 83 Linux

重启动后

fdisk -ls

Disk /dev/sda: 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: 0x000c64d7

Device Boot Start End Blocks Id System
/dev/sda1 1 12 96358+ 83 Linux
/dev/sda2 13 498 3903795 82 Linux swap / Solaris
/dev/sda3 499 10443 79883212+ 83 Linux

fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 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: 0x000c64d7

Device Boot Start End Blocks Id System
/dev/sda1 1 12 96358+ 83 Linux
/dev/sda2 13 498 3903795 82 Linux swap / Solaris
/dev/sda3 499 10443 79883212+ 83 Linux

Command (m for help): d
Partition number (1-4): 3

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (499-19581, default 499):
Using default value 499
Last cylinder, +cylinders or +size{K,M,G} (499-19581, default 19581):
Using default value 19581

reboot

# resize2fs /dev/sda3
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/sda3 is mounted on /; on-line resizing required
old desc_blocks = 5, new_desc_blocks = 10
Performing an on-line resize of /dev/sda3 to 38321049 (4k) blocks.
The filesystem on /dev/sda3 is now 38321049 blocks long.

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 144G 65G 73G 48% /
tmpfs 1.5G 0 1.5G 0% /lib/init/rw
udev 1.5G 104K 1.5G 1% /dev
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sda1 92M 38M 49M 44% /boot

Fix
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
Reboot

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注