Обычно я использую growpart, чтобы увеличить размер моего раздела root на aws, так что мне не нужно перезагружаться, и это делается с помощью одной простой команды (не такой как fdisk)
По какой-то причине на моем сервере ubuntu он больше не работает:
# df -h
Filesystem Size Used Avail Use% Mounted on
udev 993M 4.0K 993M 1% /dev
tmpfs 201M 668K 200M 1% /run
/dev/xvda1 129G 55G 67G 46% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 1002M 0 1002M 0% /run/shm
none 100M 0 100M 0% /run/user
# fdisk -l
Disk /dev/xvda: 161.1 GB, 161061273600 bytes
63 heads, 31 sectors/track, 161071 cylinders, total 314572800 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: 0x8d503283
Device Boot Start End Blocks Id System
/dev/xvda1 * 2048 272629034 136313493+ 83 Linux
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 150G 0 disk
└─xvda1 202:1 0 130G 0 part /
# growpart /dev/xvda 1
attempt to resize /dev/xvda failed. sfdisk output below:
|
| Disk /dev/xvda: 161071 cylinders, 63 heads, 31 sectors/track
| Old situation:
| Units = cylinders of 999936 bytes, blocks of 1024 bytes, counting from 0
|
| Device Boot Start End #cyls #blocks Id System
| /dev/xvda1 * 1+ 139594 139594- 136313493+ 83 Linux
| /dev/xvda2 0 - 0 0 0 Empty
| /dev/xvda3 0 - 0 0 0 Empty
| /dev/xvda4 0 - 0 0 0 Empty
| New situation:
| Units = sectors of 512 bytes, counting from 0
|
| Device Boot Start End #sectors Id System
| /dev/xvda1 * 2048 314571662 314569615 83 Linux
| /dev/xvda2 0 - 0 0 Empty
| /dev/xvda3 0 - 0 0 Empty
| /dev/xvda4 0 - 0 0 Empty
| Warning: partition 1 does not start at a cylinder boundary
| Successfully wrote the new partition table
|
| Re-reading the partition table ...
| BLKRRPART: Device or resource busy
| The command to re-read the partition table failed.
| Run partprobe(8), kpartx(8) or reboot your system now,
| before using mkfs
| If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
| to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
| (See fdisk(8).)
FAILED: failed to resize
***** WARNING: Resize failed, attempting to revert ******
Re-reading the partition table ...
BLKRRPART: Device or resource busy
The command to re-read the partition table failed.
Run partprobe(8), kpartx(8) or reboot your system now,
before using mkfs
***** Appears to have gone OK ****
Версия CLoud-Utils 0.27-0ubuntu9.2
, та же версия и более новые работают на других серверах нормально!
Пробовал partx:
# partx --update 1 /dev/xvda
partx: /dev/xvda: error updating partition 1