Discussion:
Mounting a LVM partition from a linux live cd
Matt Shields
2008-09-17 15:50:58 UTC
Permalink
I'm running CentOS 5.2, it uses LVM to manage the disks and we had a
programmer do something (not sure what) then reboot the system. When it
came up it kernel panicked. Luckily it's not production, it was their
sandbox. But they didn't backup any of their files. I know the disks are
fine because I was able to boot from a linux live cd and mount the /boot
partition from the sda drive, and the sdb drive that has the mysql database
mounted at /var/lib/mysql and not using LVM. What I don't know how to do
is mount /dev/sda2 (root / partition) which is an LVM/ext3 partition. Does
anyone have the steps to mount this drive while booted into a linux live cd?
--
-matt
John Abreau
2008-09-17 15:58:28 UTC
Permalink
Try running vgscan to create the VG files under /dev:

$ sudo vgscan
Reading all physical volumes. This may take a while...
Found volume group "RosettaVG" using metadata type lvm2
$ sudo ls /dev/RosettaVG
home root usr var
$ sudo mkdir /mnt/temp ; sudo mount /dev/RosettaVG/root /mnt/temp

This assumes the livecd has LVM compiled into its kernel.
Post by Matt Shields
I'm running CentOS 5.2, it uses LVM to manage the disks and we had a
programmer do something (not sure what) then reboot the system. When it
came up it kernel panicked. Luckily it's not production, it was their
sandbox. But they didn't backup any of their files. I know the disks are
fine because I was able to boot from a linux live cd and mount the /boot
partition from the sda drive, and the sdb drive that has the mysql database
mounted at /var/lib/mysql and not using LVM. What I don't know how to do
is mount /dev/sda2 (root / partition) which is an LVM/ext3 partition. Does
anyone have the steps to mount this drive while booted into a linux live cd?
--
-matt
_______________________________________________
Discuss mailing list
http://lists.blu.org/mailman/listinfo/discuss
--
John Abreau / Executive Director, Boston Linux & Unix
AIM abreauj / JABBER jabr-iMZfmuK6BGBxLiRVyXs8+***@public.gmane.org / YAHOO abreauj / SKYPE zusa_it_mgr
Email jabr-***@public.gmane.org / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99
Jerry Feldman
2008-09-17 19:21:40 UTC
Permalink
Try booting the Centos 5.2 installation DVD in rescue mode. It should=20
mount the root and boot partitions automatically. Or, have you tried=20
bringing up the kernel in run level 1, 2 or 3?. You can edit the kernel=20
settings and try putting in some settings. It is possible that the=20
kernel panic could have been caused by a graphics driver. The bottom=20
line is that you should be able to get the system back into at least a=20
limited operation using the rescue mode. At that point, you could=20
proceed by one o a number of different methods. Note that before I=20
installed Fedora on my CentOS system I made sure that the rescue system=20
would mount the LVM volumes.



Also note that not all Linux Live CDs have LVM built into the kernel.
Post by John Abreau
$ sudo vgscan
Reading all physical volumes. This may take a while...
Found volume group "RosettaVG" using metadata type lvm2
$ sudo ls /dev/RosettaVG
home root usr var
$ sudo mkdir /mnt/temp ; sudo mount /dev/RosettaVG/root /mnt/temp
This assumes the livecd has LVM compiled into its kernel.
=20
Post by Matt Shields
I'm running CentOS 5.2, it uses LVM to manage the disks and we had a
programmer do something (not sure what) then reboot the system. When =
it
Post by John Abreau
Post by Matt Shields
came up it kernel panicked. Luckily it's not production, it was their=
sandbox. But they didn't backup any of their files. I know the disks=
are
Post by John Abreau
Post by Matt Shields
fine because I was able to boot from a linux live cd and mount the /bo=
ot
Post by John Abreau
Post by Matt Shields
partition from the sda drive, and the sdb drive that has the mysql dat=
abase
Post by John Abreau
Post by Matt Shields
mounted at /var/lib/mysql and not using LVM. What I don't know how t=
o do
Post by John Abreau
Post by Matt Shields
is mount /dev/sda2 (root / partition) which is an LVM/ext3 partition. =
Does
Post by John Abreau
Post by Matt Shields
anyone have the steps to mount this drive while booted into a linux li=
ve cd?
Post by John Abreau
Post by Matt Shields
=20
=20
--=20
--
Jerry Feldman <gaf-***@public.gmane.org>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB CA3B 4607 4319 537C 5846
Matt Shields
2008-09-17 23:03:23 UTC
Permalink
Try booting the Centos 5.2 installation DVD in rescue mode. It should mount
the root and boot partitions automatically. Or, have you tried bringing up
the kernel in run level 1, 2 or 3?. You can edit the kernel settings and try
putting in some settings. It is possible that the kernel panic could have
been caused by a graphics driver. The bottom line is that you should be able
to get the system back into at least a limited operation using the rescue
mode. At that point, you could proceed by one o a number of different
methods. Note that before I installed Fedora on my CentOS system I made
sure that the rescue system would mount the LVM volumes.
Also note that not all Linux Live CDs have LVM built into the kernel.
I tried getting into run level 1 and it did the same thing. Not sure what
this guy did.
--
-matt
John Abreau
2008-09-18 04:57:48 UTC
Permalink
So vgscan didn't work?
Post by Matt Shields
Try booting the Centos 5.2 installation DVD in rescue mode. It should mount
the root and boot partitions automatically. Or, have you tried bringing up
the kernel in run level 1, 2 or 3?. You can edit the kernel settings and try
putting in some settings. It is possible that the kernel panic could have
been caused by a graphics driver. The bottom line is that you should be able
to get the system back into at least a limited operation using the rescue
mode. At that point, you could proceed by one o a number of different
methods. Note that before I installed Fedora on my CentOS system I made
sure that the rescue system would mount the LVM volumes.
Also note that not all Linux Live CDs have LVM built into the kernel.
I tried getting into run level 1 and it did the same thing. Not sure what
this guy did.
--
-matt
_______________________________________________
Discuss mailing list
http://lists.blu.org/mailman/listinfo/discuss
--
John Abreau / Executive Director, Boston Linux & Unix
GnuPG KeyID: 0xD5C7B5D9 / Email: abreauj-***@public.gmane.org
GnuPG FP: 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99
Samuel Baldwin
2008-09-18 11:48:04 UTC
Permalink
Are you sure the module is loaded? Run 'lsmod dm-mod' and if you don't
see anything, run:

modprobe dm-mod
Loading...