Jim Cornette wrote / ha scritto on /il 10/04/2005 14:46:
From an earlier posting someone suggested to run the following commands to activate and later deactivate LVM volumes in rescue mode. I used these commands on an external USB drive to get at data from a previous installation and it worked. You might be able to get at your data in this way.
Jim
Excerpt from earlier help. Once booted into text-mode rescue, invoke the following commands:
lvm lvscan lvm vgchange -ay
This will scan for all LVM volumes and then will make them active and accessible.
lvm vgchange -an
will deactivate them all.
Tnx Jim
But if I am a standard user with my machine running (with LVM on it), and I connect an external LVM hard disk,how do I activate that volumes??? not in rescue mode I mean.
I suppose that if I play with lvm vgchange -an I will break everything also on the running system. Is it true??
It didn't break my running system when I tried this. What I did was mount the drive as root and pull all of my regular user stuff off of the /home/user directory as a user with the same name. I was interested in the items from my user primarily, but I did also pull in some stuff from /etc as root.
What you do is to create a new directory under mnt for the / partition of the old drive, say /mnt/oldroot and if you have a seperate home lvm, which I did not, I had only one big / partiton.
After you get the volume activated, you will notice some additional mounting device called something like /dev/vol00/grp00 or some cryptic line that lvm uses. I am running reular partitions and do not have the lvm volume at hand, so I don't recall the exact device name for a lvm.
Then you mount the volume with the below command and you should see the directories in /mnt/oldroot and can get at the information.
mount /dev/cryptic-line /mnt/oldroot and you should be set.
Doing this as a regular user might not work. Booting from rescue mode, activating the volumegroup, making a mount point and then chroot to the mounted lvm should give you somewhat of whatever the USB drive had for an OS.
Jim
-- Johnson's law: Systems resemble the organizations that create them.