Hi,
I am trying to recover data from my old system which had LVM. The disk had two partitions - /dev/sda1 (boot, Linux) and /dev/sda2 (Linux LVM). I had taken a backup of both partitions using dd.
Now I am booting of CentOS live cd for system restore. I recreated partitions like previous system using fdisk and then used dd to dump all the data onto it. I would like to mount sda2 as LVM, but I don't know how to do that. Any steps or howto mount LVM manually would be really helpful. I think I can recover the system once I am able to access sda1 and sda2. Any help?
jM.
On Saturday, January 08, 2011 04:27:39 pm Johan Martinez wrote:
Now I am booting of CentOS live cd for system restore. I recreated partitions like previous system using fdisk and then used dd to dump all the data onto it. I would like to mount sda2 as LVM, but I don't know how to do that. Any steps or howto mount LVM manually would be really helpful. I think I can recover the system once I am able to access sda1 and sda2. Any help?
pvscan vgscan vgchange -ay lvscan
(It has been awhile since I have done this; I know the vgchange -ay is required, but I don't recall if pvscan and lvscan were required or if I just used them for information....but I do think the vgscan was required.)
In the lvscan output you should see the logical volumes; mount to the desired mountpoint with mount /dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT
Or you can reboot the CentOS disk in rescue mode and have it find your system as part of its bootup. In that case your system will be mounted under /mnt/sysimage and you can do a 'chroot /mnt/sysimage' and essentially get a command line inside that system.
Hope that helps.
On Sat, Jan 8, 2011 at 3:50 PM, Lamar Owen lowen@pari.edu wrote:
On Saturday, January 08, 2011 04:27:39 pm Johan Martinez wrote:
Now I am booting of CentOS live cd for system restore. I recreated partitions like previous system using fdisk and then used dd to dump all
the
data onto it. I would like to mount sda2 as LVM, but I don't know how to
do
that. Any steps or howto mount LVM manually would be really helpful. I
think
I can recover the system once I am able to access sda1 and sda2. Any
help?
pvscan vgscan vgchange -ay lvscan
(It has been awhile since I have done this; I know the vgchange -ay is required, but I don't recall if pvscan and lvscan were required or if I just used them for information....but I do think the vgscan was required.)
In the lvscan output you should see the logical volumes; mount to the desired mountpoint with mount /dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT
Or you can reboot the CentOS disk in rescue mode and have it find your system as part of its bootup. In that case your system will be mounted under /mnt/sysimage and you can do a 'chroot /mnt/sysimage' and essentially get a command line inside that system.
Hope that helps. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Thanks for the reply Lamar and Robert.
I had tried pvscan and vgscan before sending out my first mail, but it didn't show up any physical volumes and vol grpups.
I didn't do lvscan though.
I will try again and see how it goes.
jM.
On Sat, Jan 8, 2011 at 7:17 PM, Johan Martinez jmartiee@gmail.com wrote:
On Sat, Jan 8, 2011 at 3:50 PM, Lamar Owen lowen@pari.edu wrote:
On Saturday, January 08, 2011 04:27:39 pm Johan Martinez wrote:
Now I am booting of CentOS live cd for system restore. I recreated partitions like previous system using fdisk and then used dd to dump all
the
data onto it. I would like to mount sda2 as LVM, but I don't know how to
do
that. Any steps or howto mount LVM manually would be really helpful. I
think
I can recover the system once I am able to access sda1 and sda2. Any
help?
pvscan vgscan vgchange -ay lvscan
(It has been awhile since I have done this; I know the vgchange -ay is required, but I don't recall if pvscan and lvscan were required or if I just used them for information....but I do think the vgscan was required.)
In the lvscan output you should see the logical volumes; mount to the desired mountpoint with mount /dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT
Or you can reboot the CentOS disk in rescue mode and have it find your system as part of its bootup. In that case your system will be mounted under /mnt/sysimage and you can do a 'chroot /mnt/sysimage' and essentially get a command line inside that system.
Hope that helps. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Thanks for the reply Lamar and Robert.
I had tried pvscan and vgscan before sending out my first mail, but it didn't show up any physical volumes and vol grpups.
I didn't do lvscan though.
I will try again and see how it goes.
jM.
I can see PVs sda1 and sda2 with pvscan, but they are not getting mounted as lvm. Also, I see sda2 listed as LVM although I didn't partition it that way. e.g. fdisk shows it as Linux type and pvscan is showing it as lvm2. That's somewhat confusing me.
Also, the real problem for me is recovery. I don't see LVM mounted after doing vgscan and lvscan. Am I missing something here? Any help?
Thanks you.. jM
On Sat, Jan 8, 2011 at 7:17 PM, Johan Martinez jmartiee@gmail.com
wrote:
On Sat, Jan 8, 2011 at 3:50 PM, Lamar Owen lowen@pari.edu wrote: On Saturday, January 08, 2011 04:27:39 pm Johan Martinez wrote:
> Now I am booting of CentOS live cd for system restore. I recreated > partitions like previous system using fdisk and then used dd to dump all the > data onto it. I would like to mount sda2 as LVM, but I don't know how to do > that. Any steps or howto mount LVM manually would be really helpful. I think > I can recover the system once I am able to access sda1 and sda2. Any help?
pvscan vgscan vgchange -ay lvscan
(It has been awhile since I have done this; I know the vgchange -ay is required, but I don't recall if pvscan and lvscan were required or if I just used them for information....but I do think the vgscan was required.)
In the lvscan output you should see the logical volumes; mount to the desired mountpoint with mount /dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT
Or you can reboot the CentOS disk in rescue mode and have it find your system as part of its bootup. In that case your system will be mounted under /mnt/sysimage and you can do a 'chroot /mnt/sysimage' and essentially get a command line inside that system.
Hope that helps. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Thanks for the reply Lamar and Robert.
I had tried pvscan and vgscan before sending out my first mail, but it didn't show up any physical volumes and vol grpups.
I didn't do lvscan though.
I will try again and see how it goes.
jM.
I can see PVs sda1 and sda2 with pvscan, but they are not getting mounted as lvm. Also, I see sda2 listed as LVM although I didn't partition it that way. e.g. fdisk shows it as Linux type and pvscan is showing it as lvm2. That's somewhat confusing me.
Also, the real problem for me is recovery. I don't see LVM mounted after doing vgscan and lvscan. Am I missing something here? Any help?
Thanks you.. jM
------------------------------------------------------------------------
Johan,
I have the same circumstance, and have not been able to mount an lvm volume to a new machine. I have your posts, but have not been able to mount the lvm either. Did you ever get this resolved? Sure would appreciate your thoughts, or any one else that has been able to do this.
Greg
On Sat, Jan 8, 2011 at 7:17 PM, Johan Martinez jmartiee@gmail.com
wrote:
On Sat, Jan 8, 2011 at 3:50 PM, Lamar Owen lowen@pari.edu wrote: On Saturday, January 08, 2011 04:27:39 pm Johan Martinez wrote:
> Now I am booting of CentOS live cd for system restore. I recreated > partitions like previous system using fdisk and then used dd to dump all the > data onto it. I would like to mount sda2 as LVM, but I don't know how to do > that. Any steps or howto mount LVM manually would be really helpful. I think > I can recover the system once I am able to access sda1 and sda2. Any help?
pvscan vgscan vgchange -ay lvscan
(It has been awhile since I have done this; I know the vgchange -ay is required, but I don't recall if pvscan and lvscan were required or if I just used them for information....but I do think the vgscan was required.)
In the lvscan output you should see the logical volumes; mount to the desired mountpoint with mount /dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT
Or you can reboot the CentOS disk in rescue mode and have it find your system as part of its bootup. In that case your system will be mounted under /mnt/sysimage and you can do a 'chroot /mnt/sysimage' and essentially get a command line inside that system.
Hope that helps. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Thanks for the reply Lamar and Robert.
I had tried pvscan and vgscan before sending out my first mail, but it didn't show up any physical volumes and vol grpups.
I didn't do lvscan though.
I will try again and see how it goes.
jM.
I can see PVs sda1 and sda2 with pvscan, but they are not getting mounted as lvm. Also, I see sda2 listed as LVM although I didn't partition it that way. e.g. fdisk shows it as Linux type and pvscan is showing it as lvm2. That's somewhat confusing me.
Also, the real problem for me is recovery. I don't see LVM mounted after doing vgscan and lvscan. Am I missing something here? Any help?
Thanks you.. jM
------------------------------------------------------------------------
Johan,
I have the same circumstance, and have not been able to mount an lvm volume to a new machine. I have your posts, but have not been able to mount the lvm either. Did you ever get this resolved? Sure would appreciate your thoughts, or any one else that has been able to do this.
Greg ------------------------------------------- Johan,
I am not sure if this is your problem but what I can determine is that there may be a conflict with the same names of the lvm volumes; ie the old volume that I am trying to mount has the same name as the volume on the machine that is active.
[root@SeVi mnt]# pvscan PV /dev/hdc2 VG VolGroup00 lvm2 [37.16 GB / 0 free] PV /dev/hdd1 VG VolGroup00 lvm2 [186.28 GB / 0 free] PV /dev/sda2 VG VolGroup00 lvm2 [931.41 GB / 0 free] Total: 3 [1.13 TB] / in use: 3 [1.13 TB] / in no VG: 0 [0 ] [root@SeVi mnt]# lvchange --available y /dev/VolGroup00/LogVol00 [root@SeVi mnt]# mount /dev/VolGroup00/LogVol00 /mnt/hdc2
This results in mounting the current machine's lvm which is on sda1, but I am wanting to mount /dev/hdc2.
Any one have any ideas ?
Greg
I am not sure if this is your problem but what I can determine is that
there may be a conflict with the same names of the lvm volumes; ie the old volume that I am trying to mount has the same name as the volume on the machine that is active.
I was wondering if you were running into that problem. I've run into it in the past. Centos always uses the same logical group and logical volume names as default for a new install, and you can't mount a foreign LVM if the names conflict.
I once set up a test system to try to recover some files from an LVM, and installed centos with no LVM to avoid the conflict, but centos didn't install the lvm tools automatically . (I like using system-config-lvm) However, the tools are easy enough to install with yum. Some live CDs let you install system-config-lvm too.
You can also use unique LVM group and vol names when installing centos to avoid this...
On Thu, Feb 3, 2011 at 9:27 PM, compdoc compdoc@hotrodpc.com wrote:
I am not sure if this is your problem but what I can determine is that
there may be a conflict with the same names of the lvm volumes; ie the old volume that I am trying to mount has the same name as the volume on the machine that is active.
Note that CentOS 6 will not. RedHat rewrote anaconda to use the hostname in the volume groups, which is very helpful to avoid just this situation.
I was wondering if you were running into that problem. I've run into it in the past. Centos always uses the same logical group and logical volume names as default for a new install, and you can't mount a foreign LVM if the names conflict.
I once set up a test system to try to recover some files from an LVM, and installed centos with no LVM to avoid the conflict, but centos didn't install the lvm tools automatically . (I like using system-config-lvm) However, the tools are easy enough to install with yum. Some live CDs let you install system-config-lvm too.
You can also use unique LVM group and vol names when installing centos to avoid this...
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Thu, Feb 3, 2011 at 9:27 PM, compdoc compdoc@hotrodpc.com wrote:
I am not sure if this is your problem but what I can determine is that
there may be a conflict with the same names of the lvm volumes; ie the old volume that I am trying to mount has the same name as the volume on the machine that is active.
Note that CentOS 6 will not. RedHat rewrote anaconda to use the hostname in the volume groups, which is very helpful to avoid just this situation.
I was wondering if you were running into that problem. I've run into it in the past. Centos always uses the same logical group and logical volume names as default for a new install, and you can't mount a foreign LVM if the names conflict.
I once set up a test system to try to recover some files from an LVM, and installed centos with no LVM to avoid the conflict, but centos didn't install the lvm tools automatically . (I like using system-config-lvm) However, the tools are easy enough to install with yum. Some live CDs let you install system-config-lvm too.
You can also use unique LVM group and vol names when installing centos to avoid this...
-----------------------------------------------------------------------
Nico,
Thanks for the response. Does this mean there is nothing I can do to make this happen. Is there a way to change the name of "VolGroup00"? If so I have not found it yet. I see that I can change "LogVol00", but have not figured out how to chanage "VolGroup00".
Maybe, I am finally beginning to understand logical volumes. :)
Greg
On Thu, 2011-02-03 at 23:21 -0600, Gregory P.. Ennis wrote:
Thanks for the response. Does this mean there is nothing I can do to make this happen. Is there a way to change the name of "VolGroup00"? If so I have not found it yet. I see that I can change "LogVol00", but have not figured out how to chanage "VolGroup00".
It is "vgrename" and please use plain test for emails.
John
On Thu, 2011-02-03 at 23:21 -0600, Gregory P.. Ennis wrote:
Thanks for the response. Does this mean there is nothing I can do to make this happen. Is there a way to change the name of "VolGroup00"? If so I have not found it yet. I see that I can change "LogVol00", but have not figured out how to chanage "VolGroup00".
It is "vgrename" and please use plain test for emails.
John
-----------------------------------------------------------------
John,
Thanks for your note. I tried to change the name and this is what I get :
[root@SeVi ~]# vgrename /dev/VolGroup00 /dev/SeViGroup00 Volume group "VolGroup00" still has active LVs Internal error: Volume Group SeViGroup00 was not unlocked Device '/dev/sda2' has been left open. Device '/dev/sda2' has been left open. Device '/dev/sda2' has been left open.
Sorry, if my previous note was not plain text .... thought that it was.
I am about ready to regen a new os without the use of LVM, my thought is that I should be able use that to mount the lvm volumes I am trying to recover. If you or others have any other ideas I would appreciate your help.
Greg
On Fri, Feb 4, 2011 at 11:06 AM, Gregory P. Ennis PoMec@pomec.net wrote:
On Thu, 2011-02-03 at 23:21 -0600, Gregory P.. Ennis wrote:
Thanks for the response. Does this mean there is nothing I can do to make this happen. Is there a way to change the name of "VolGroup00"? If so I have not found it yet. I see that I can change "LogVol00", but have not figured out how to chanage "VolGroup00".
It is "vgrename" and please use plain test for emails.
John
John,
Thanks for your note. I tried to change the name and this is what I get :
[root@SeVi ~]# vgrename /dev/VolGroup00 /dev/SeViGroup00 Volume group "VolGroup00" still has active LVs Internal error: Volume Group SeViGroup00 was not unlocked Device '/dev/sda2' has been left open. Device '/dev/sda2' has been left open. Device '/dev/sda2' has been left open.
Sorry, if my previous note was not plain text .... thought that it was.
I keep a spare box around with non-default LVM names, actually using direct partitions, for precisely this reason. It's particularly important if for virtualization servers when you've got a stack of virtual images and their LVM names conflict with that of your host server.
It's also another reason it's handy to be able to boot with a live CD.
I am about ready to regen a new os without the use of LVM, my thought is that I should be able use that to mount the lvm volumes I am trying to recover. If you or others have any other ideas I would appreciate your help.
This is probably your fastest method.
On Fri, Feb 4, 2011 at 11:06 AM, Gregory P. Ennis PoMec@pomec.net wrote:
On Thu, 2011-02-03 at 23:21 -0600, Gregory P.. Ennis wrote:
Thanks for the response. Does this mean there is nothing I can do to make this happen. Is there a way to change the name of "VolGroup00"? If so I have not found it yet. I see that I can change "LogVol00", but have not figured out how to chanage "VolGroup00".
It is "vgrename" and please use plain test for emails.
John
John,
Thanks for your note. I tried to change the name and this is what I get :
[root@SeVi ~]# vgrename /dev/VolGroup00 /dev/SeViGroup00 Volume group "VolGroup00" still has active LVs Internal error: Volume Group SeViGroup00 was not unlocked Device '/dev/sda2' has been left open. Device '/dev/sda2' has been left open. Device '/dev/sda2' has been left open.
Sorry, if my previous note was not plain text .... thought that it was.
I keep a spare box around with non-default LVM names, actually using direct partitions, for precisely this reason. It's particularly important if for virtualization servers when you've got a stack of virtual images and their LVM names conflict with that of your host server.
It's also another reason it's handy to be able to boot with a live CD.
I am about ready to regen a new os without the use of LVM, my thought is that I should be able use that to mount the lvm volumes I am trying to recover. If you or others have any other ideas I would appreciate your help.
This is probably your fastest method.
--------------------------------------------------------------
Thanks Nico,
Great Advice, am a little surprised I had not had this problem before now.
Greg
On Fri, 2011-02-04 at 10:06 -0600, Gregory P. Ennis wrote:
[root@SeVi ~]# vgrename /dev/VolGroup00 /dev/SeViGroup00 Volume group "VolGroup00" still has active LVs Internal error: Volume Group SeViGroup00 was not unlocked Device '/dev/sda2' has been left open. Device '/dev/sda2' has been left open. Device '/dev/sda2' has been left open.
man vgrename....
All the Volume Groups visible to a system need to have different names. Otherwise many LVM2 commands will refuse to run or give warning mes-sages.
Try by using "vgdisplay" to get the UUID and use the "UUID" to "vgrename" otherwise start unpluging drive cables to get to the LVM you need to rename.
John
At Sat, 8 Jan 2011 15:27:39 -0600 CentOS mailing list centos@centos.org wrote:
Hi,
I am trying to recover data from my old system which had LVM. The disk had two partitions - /dev/sda1 (boot, Linux) and /dev/sda2 (Linux LVM). I had taken a backup of both partitions using dd.
Now I am booting of CentOS live cd for system restore. I recreated partitions like previous system using fdisk and then used dd to dump all the data onto it. I would like to mount sda2 as LVM, but I don't know how to do that. Any steps or howto mount LVM manually would be really helpful. I think I can recover the system once I am able to access sda1 and sda2. Any help?
You will need to do a vgscan to scan for the LVM volumn you created. Once scanned, you can then mount the file system(s) there, either using the mapper files (/dev/mapper/volumegroup-volumn) or the mount labels (LABEL=label). If this was a stock CentOS install, the root file system will be labeled '/' and the /boot file system will be labeled '/boot':
mkdir /mnt/sysimage mount -v LABEL=/ /mnt/sysimage mount -v LABEL=/boot /mnt/sysimage/boot
jM.
MIME-Version: 1.0
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Sat, Jan 8, 2011 at 4:27 PM, Johan Martinez jmartiee@gmail.com wrote:
Hi, I am trying to recover data from my old system which had LVM. The disk had two partitions - /dev/sda1 (boot, Linux) and /dev/sda2 (Linux LVM). I had taken a backup of both partitions using dd. Now I am booting of CentOS live cd for system restore. I recreated partitions like previous system using fdisk and then used dd to dump all the data onto it. I would like to mount sda2 as LVM, but I don't know how to do that. Any steps or howto mount LVM manually would be really helpful. I think I can recover the system once I am able to access sda1 and sda2. Any help? jM.
Once you do the pvscan and vgscan, then vgchange, you should have the LVs available in /dev/VGNAME/LVNAME. For example, if your volume group name is VolGroup00, the LVs will be /dev/VolGroup00/lv001, etc..
Keep in mind that you are not mounting sda2 in this case but rather the LVs associated with the VG associated with the PV on sda2.
For example: pvscan vgscan vgchange -ay VolGroup00 mkdir /mnt/tmp1 mount /dev/VolGroup00/lv01 /mnt/tmp1
Also note that in some cases the lvm tools must be called by specifying lvm before the command
lvm pvscan lvm vgchange -ay VolGroup00
etc..
On Tuesday, January 11, 2011 01:47:54 pm Kwan Lowe wrote:
Also note that in some cases the lvm tools must be called by specifying lvm before the command
lvm pvscan lvm vgchange -ay VolGroup00
To have in the archive, note that this is the case in the dracut shell (accessed at boot on error if the RDSHELL argument is passed) that should be in C6 (as it's in F12 and later). Having the RDSHELL boot argument is very nice, as if you get error during boot that won't even allow single user mode (things like can't find root device, or a module failed to load, etc) you can get a rudimentary shell in the initial ramdisk environment.
See http://fedoraproject.org/wiki/How_to_debug_Dracut_problems for a lot more info.
Having said that, I've not tried on a live EL6 system as yet, so YMMV, of course.