# umount /dev/sda3 umount: /: target is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) # 根分区卸载不掉那就不卸载了
# fdisk /dev/sda Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Command (m for help): p
Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 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 label type: dos Disk identifier: 0x000b70b3
Device Boot Start End Blocks Id System /dev/sda1 * 2048 616447 307200 8e Linux LVM /dev/sda2 616448 4810751 2097152 82 Linux swap / Solaris /dev/sda3 4810752 61433855 28311552 83 Linux
Command (m for help): d Partition number (1-3, default 3): 3 Partition 3 is deleted
Command (m for help): n Partition type: p primary (2 primary, 0 extended, 2 free) e extended Select (default p): p Partition number (3,4, default 3): 3 First sector (4810752-62914559, default 4810752): Using default value 4810752 Last sector, +sectors or +size{K,M,G} (4810752-62914559, default 62914559): Using default value 62914559 Partition 3 of type Linux and of size 27.7 GiB is set
Command (m for help): p
Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 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 label type: dos Disk identifier: 0x000b70b3
Device Boot Start End Blocks Id System /dev/sda1 * 2048 616447 307200 8e Linux LVM /dev/sda2 616448 4810751 2097152 82 Linux swap / Solaris /dev/sda3 4810752 62914559 29051904 83 Linux
Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks.
# partprobe #不管用,必须reboot重启 Error: Partition(s) 3 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only. # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 30G 0 disk ├─sda1 8:1 0 300M 0 part /boot ├─sda2 8:2 0 2G 0 part [SWAP] └─sda3 8:3 0 17.7G 0 part / sr0 11:0 1 4.5G 0 rom
重启之后
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 30G 0 disk ├─sda1 8:1 0 300M 0 part /boot ├─sda2 8:2 0 2G 0 part [SWAP] └─sda3 8:3 0 27.7G 0 part / #磁盘分区空间变为了27.7,增加了10G sr0 11:0 1 4.5G 0 rom