Tuesday, July 7, 2009

Old LVM drive

What to do if you have an old LVM with the same VolGroup?

Using a liveCD. I am using Ubuntu. Must have internet access.
unplug the new drive(s) and leave the old drive that you want to recover files from.
Boot it up with the liveCD.
If you're like me who does not like sudo, do this:
# sudo passwd (to change to whatever password you want for root).
# su - (to get in as root).
# apt-get install lvm2
# vgscan
------------------
Found volume group "VolGroup00" using metadata type lvm2
------------------
# vgrename VolGroup00 VolGroupRecover

Shutdown your machine. Plug everything back. When you're back as root:
# vgscan
------------------
Found volume group "VolGroupRecover" using metadata type lvm2
Found volume group "VolGroup00" using metadata type lvm2
------------------
That's what you want to see. Now reactivate them.
# vgchange -a y
# lvscan
You should see the ACTIVE /dev/VolGroupRecover/LogVol--
Well, mount that one!

No comments: