I am used to being able to use the system-config-lvm
utility in RedHat Linux (I was using RHEL 5) to resize the LVM while the system was running. To be clear, I did this while running on the disk I was using for the system I was using and there were no errors or issues. When doing this, I was told that the volumes would have to be unmounted then mounted back when done. This worked when I did it.
I tried doing this in CentOS 6.5 with system-config-lvm
. I first tried to resize the /home
partition to be smaller so I could grow the /root
partition. I sized it down, clicked apply, I was informed that it would have to be unmounted first, I clicked OK, and I was told it couldn't be unmounted because the device was busy. This is already different behavior than RHEL, and I understand that LV's are intended to have the ability to be resized while in use. Well some degree of searching online said that this was not actually the case, and it is not possible (to unmount the volume while in use) and recommended to use a live CD and perform the operation with the file system not yet mounted. This is what I did. I took a CentOS 6.5 Live CD, ran system-config-lvm
to resize the LVs (basically swap the size of the /
(root) and /home
volumes), it was successful, then I rebooted.
When I rebooted, the boot was interrupted by file system errors that were detected. I decided to undo my logical volume resize back to their original sizes (which required booting back into the Live CD and repeating the LVM process), rebooted and still errors. The errors resided only with the /home
volume, because the /
(root) volume was totally intact. To try and rescue, I tried doing fsck -y
and that didn't quite work, and it's okay because this whole file system was a clone of a VM to begin with. I don't mind losing the data.
But what I'm after is, why did this happen? Or better yet, what is the correct way to do this? Ideally of course without creating file system errors. Could this ever be the result of sizing a volume to be too small than contents of the volume (I believe I checked and this was not the case, but I cannot be totally sure)? I see this server fault post that recommends using resize2fs
. Is that the correct way to do it, and not system-config-lvm
?