LinHES Forums
http://forum.linhes.org/

Convert from lvm to Storage Groups
http://forum.linhes.org/viewtopic.php?f=11&t=20024
Page 1 of 1

Author:  mkaz [ Wed Jun 24, 2009 4:46 am ]
Post subject:  Convert from lvm to Storage Groups

Using r5.5, I'd like to convert my file system from lvm to storage groups.

I have a 80G (primary) and 250G (2ndary) HD in a single LVM group.
There is about 200G of content with 100G free on the LVM group.

If I cannot backup the 200G to another drive, how can I convert to Storage groups? Can I use lvm to copy all the data to the big drive, break up the lvm and then convert it?

If I can backup the 200G, how would I do the conversion?

I did read in the wiki how to add a new disk if storage groups are already on.

Thanks!

Author:  larrybpsu [ Wed Jun 24, 2009 7:42 pm ]
Post subject: 

I had a LVM of two 320G drives and I found that moving it to a 1TB drive to be a royal PITA.

You NEED a single drive LARGER than your LVM to move all that data. Preferally TWICE as big or bigger!

What I did:

Stop mythfrontend and mythbackend. They should not be running while this is going on.

Add the 1TB drive to system
cfdisk
mkfs (whatever FS you choose)
manually mount the drive somewhere, like /mnt/hd

tar the contents of the LVM to the mounted drive

(the files can be "cp'ed" to the new drive, but I'm no linux wizard, and I know that tar is easy and works.) The script wizards can enlighten the masses about this. ;)

After that's done:

untar the tar file to the root directory of the new drive and verify that all is intact.
delete the tar file
edit /etc/fstab to mount the new drive into the original place, and NOT mount the LVM
restart to check the mount

If all is ok:

Remove the lvm and enjoy.

Is it easy? NO. Can it be done? YES.

LVM's were nice back when the TB drives were about $400, but these days, storage groups are the way to go.

Author:  cliffsjunk [ Thu Jul 23, 2009 10:20 am ]
Post subject: 

Yea, tar will work, but you wind up at one time with the data stored twice on your new hd and that means that your new hd needs to be twice as big as really required.

cp is really easy

something like:
Code:
cp -av /myth/* /mnt/hd

(assumes new hd is mounted to /mnt/hd) instead of the tar should work to get everything off the old hd and onto the new one. Then just update your /etc/fstab (remove the old lvm and put in where where you new hd will be) and power off. Remove old lvm. Install new hd. Power up.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/