There are plenty of documentations/questions about enlarging partitions but I had a problem before reaching that stage as the kernel does not seem to notice that the size of the disk changes (and I did not want to reboot).
AWS documentation says it should work Linux kernel 4.2 or later but this does not work for me with 5.7.19. It also suggests hdparm -z but that fails as the disk is busy.
After a bit of digging I found the right sysfs entry:
# echo 1 > /sys/block/nvme0n1/device/rescan_controller
Now the kernel notices:
[472580.761678] nvme0n1: detected capacity change from 107374182400 to 214748364800
And everything else works as expected:
# growpart /dev/nvme0n1 1
CHANGED: partition=1 start=206848 old: size=209508319 end=209715167 new: size=419223519 end=419430367
# resize2fs /dev/nvme0n1p1
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/nvme0n1p1 is mounted on /; on-line resizing required
old_desc_blocks = 13, new_desc_blocks = 25
The filesystem on /dev/nvme0n1p1 is now 52402939 (4k) blocks long.
No comments:
Post a Comment