How to mount LVM partitions from rescue mode (Fedora/CentOS/RedHat)
- October 25th, 2011
- Posted in Documentation
- Write comment
Boot your rescue media.
Scan for volume groups:
# lvm vgscan -v
Activate all volume groups:
# lvm vgchange -a y
List logical volumes:
# lvm lvs –all
With this information, and the volumes activated, you should be able to mount the volumes:
# mount /dev/volumegroup/logicalvolume /mountpoint
Good stuff!
Been working on this issue for several days. Thank you so much for the info.
thx
Thnk you SOO MUCH for this short and PERFECT topic – You just save my freaking LIFE – 49 hours awake to solve a damm problem in corrupted oracle’s DB file for it was stucked into “do not know where” and fsck wasn’t running – boot up the linux CD LIVE IMAGE … and how to check LVM with fsck? THAT WAY! – just do not mount it, of course.
Again man.. thnk you SOOOO MUUUUCH!
Worked like a charm using the System Rescue CD. Keep up the great work!
Thanks! Top site on Google for this search and get me going very quickly.
Didn’t help… all is good until the last step, where I get:
“mount: special device /dev/volumegroup/logicalvolume does not exist” =(
Any suggestions?
@ka9q
That means you haven’t identified the special device correctly. The lvdisplay command should help you identify what you need, if available. If you have a copy of your fstab, you can get it from there too.
Here is an example of what I have for my /home partition:
/dev/mapper/vg_vmlinux01-lv_home /home
@Jgz
I did identify them right, that’s the problem. =(
@ka9q
So, looking at one of my machines, when I do a lvm lvs –all, I get the following for home:
lv_home vg_vmlinux01 -wi-ao— 65.50g
Now, when I look at my fstab for home, I have.
/dev/mapper/vg_vmlinux01-lv_home /home ext4 defaults 1 2
So, in order for me to mount this volume:
mount /dev/mapper/vg_vmlinux01-lv_home /home
I believe that you have this portion ( /dev/mapper/vg_vmlinux01-lv_home ) wrong, or perhaps a hardware issue.
Does the volume show up when you do a lvm lvs –all?
@Jgz
Yes, that’s exactly how I do it. ‘lvm lvs –all’ works as expected,
both ‘lvscan’ and ‘lvdisplay’ show the LVs as “ACTIVE”,
I check the fstab and for the /home it looks like:
/dev/mapper/-lv_home /home ext4 defaults 1 2
and it does give that error: “mount: special device /dev/mapper/-lv_home does not exist”.
I am not sure if it can be the hardware: the reason why I am in the rescue mode now is because yum update made a perfectly working system unbootable…
@ka9q
ERRATUM:
I check the fstab and for the /home it looks like:
/dev/mapper/MYVG-lv_home /home ext4 defaults 1 2
and it does give that error: “mount: special device /dev/mapper/MYVG-lv_home does not existâ€.
So,
mount -t ext4 /dev/mapper/MYVG-lv_home /home
is what is giving you that error? Do you have the partition where /dev is located mounted?
Thanks. Very useful
Thanks so much! Really helped while studying for RHSCA on Virtualbox trying to restore /etc/inittab
@Jgz
so, finally the problem solved with :
lvm vgscan -v –mknodes
in my case the corresponding files were missing in /dev
That makes sense given the error you were getting. Good to know. Thanks for passing it along.
Very helpful !!!!!
Many Thanks !!!
Thanks its soloved my problem …
Great work…
thank you – lvm vgscan -v –mknodes also saved my multi parition OS recovery
You’re a hero!
you rock! Thanks 🙂
The best!
Hero!
Thanks. This saved my bacon today on a RHEL5.11 system.
Thank you. I’m new with LVM and had a server that wouldn’t boot and I needed to try to fix it by booting from a rescue media, and lo and behold I had no idea how to mount the logical volume that I needed to change a configuration on. Then I found your site. Thanks again.
Works like a charm! Thanks
This helped me rescue a corrupted VM today. THANK YOU.