Usually i use growpart to rise up size of my root partition on aws, so that i don't have to reboot
For some reason in one of my instances, it doesn't work anymore:
# 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 ****
Version of CLoud-Utils 0.27-0ubuntu9.2
, same version and newer ones work on another servers normally!
I tried partx:
# partx --update 1 /dev/xvda
partx: /dev/xvda: error updating partition 1
I just had the same issue.
As there was a newer release of growpart available, i just upgraded that package (On Debian 8 upgraded version from "0.26-2" up to "0.29-1" from backports repositories) and was able to resize my partition right after it.