1833784 Members
2274 Online
110063 Solutions
New Discussion

Re: swap lvm

 
emily_3
Frequent Advisor

swap lvm

Hello,
I have created vg01, and created some LVMs in vg01. And I have put some data in the following two LVMS and used for some months.

/dev/vg01/lvol4 31457280 /aaa
/dev/vg01/lvol3 819200 /sw

However, I found that the size of /data is too big, while the size of /sw is too small. I want to swap them like the following:

/dev/vg01/lvol4 31457280 /sw
/dev/vg01/lvol3 819200 /aaa

Is it ok if I just swap the mounting point? I am not sure, since there are some data in both LVMS and I don't want to erase them. Can someone advice how to do it? Thanks.
4 REPLIES 4
freddy_21
Respected Contributor

Re: swap lvm

Hello emily,

I think th best way is backup and restore. or copy your data.

you can change your mount point but the disk still same.

thanks
freddy
Senthil Kumar .A_1
Honored Contributor

Re: swap lvm

Hi,

You wouldn't loose any data, by just swapping the mount points... This would be the sequence of commands for your situation...

umount /aaa
umount /sw
mount /dev/vg01/lvol4 /sw
mount /dev/vg01/lvol3 /aaa

Note: need to update the file /etc/fstab if you want this change permanent across reboots.

But again, swapping the mountpoint will not have any system impact, but be aware that if there were any apps that were referring the data in these FS previously, you need to make those application intelligent of current change.

SK
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
emily_3
Frequent Advisor

Re: swap lvm

Hello,

Thanks for your quick replay. I have swap the two lvm. Your are right, after swap the mounting point, the content need to manually copy and swap again, which is a little troublesome.
Arun Jain
Frequent Advisor

Re: swap lvm

hi emily

as far as i think this is not possible in a live environment..... and also swapping the mounting point is not a solution.....one thing you can do that you take the backup of the data and then rename the LVM.... renaming LVM you can do with mv command. only you have to do is rename both the device files (block & character) then you can erase the existing data and copy the backup data....

all the best....
speak less say more