Logical Volume do over

Latest response

I have two logical volumes:

LV1 -> /
LV2 -> /var

The LV on LV2 consumes 100% of the space and it is the XFS file system. I wanted to shrink it but I don't think that's possible with XFS. So I cooked up a plan and it didn't seem to work, and I am wondering why and what I should do differently. Here is what I did.

I attached a USB3 SSD to PC.
I added the XFS file system with label LV3 to it and mounted it as /mnt/var
As root I did rsync -av --delete --progress /var/ /mnt/var/
Once this was done, I altered /etc/fstab:
- I duplicated the mount with the LV2 and then remarked out the original
- I then modified the duplicate with LABEL="LV3" to replace the original source

My thought was I would reboot with a copy of the original /var coming from the USB3 SSD.
I would then change remove the LV in LV2 and create a new one smaller.
I would mount it as /mnt/var
Then I would rsync -av --delete --progress /var/ /mnt/var/ which would then place the USB3 SSD back onto the smaller LV2 LV.

The thing is that upon reboot with the modified LABEL="LV3" the system never booted up. It gets all kinds of errors. The system finds my alternate /var just fine, but I guess it doesn't like my copy of it for some reason and it doesn't actually boot like I thought it would. I end up booting to single user and changing the /etc/fstab back and then I get my normal okay bootup.

So I am guessing the problem is my rsync of the original /var. What should I be doing differently?

Responses

Yeah, once I had the same situation, so, what I did was I moved /var/log to another block device and edit fstab add that new device and reboot. Later, I could see the file system usage consumption of /var reduced and /var/log as a separate mount point.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.