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. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20110108/b3c4386f/attachment-0002.html>
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.
At Sat, 8 Jan 2011 15:27:39 -0600 CentOS mailing list <centos at 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 at centos.org > http://lists.centos.org/mailman/listinfo/centos > >-- Robert Heller -- 978-544-6933 / heller at deepsoft.com Deepwoods Software -- http://www.deepsoft.com/ () ascii ribbon campaign -- against html e-mail /\ www.asciiribbon.org -- against proprietary attachments
On Sat, Jan 8, 2011 at 4:27 PM, Johan Martinez <jmartiee at 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 VolGroup00To 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.