System Management
A cloud VM has a virtual disk, /dev/vdb, that was just enlarged from 20 GB to 50 GB. It holds one partition, /dev/vdb1, formatted as ext4 and mounted at /data. The partition is the last one on the disk, and the administrator must use the new space without unmounting the filesystem or rebooting. Which sequence of commands BEST accomplishes this?
Show the answer
Correct answerA. growpart /dev/vdb 1, then resize2fs /dev/vdb1
growpart takes the disk and the partition number as separate arguments and extends the partition online. resize2fs then grows the ext4 filesystem to fill it. Running partprobe alone is tempting, but it only rereads the partition table and does not enlarge the partition, so resize2fs would have nothing new to use.