Mounting is an easy process to do, provided the filesystem type you are using is supported. What happen when you have an LVM formatted disk, and you need to mount it because the disk cannot be booted and a hell lot of valuable data kept inside?? Do not worry, because the solution is here.......
1. Get a live cd, for example, Ubuntu. For this article, I use Ubuntu 6.06 (I cannot find any latest version of ubuntu at my place)
2. Boot using the live cd. Search for these tools: lvm2. If the cd do not have it, install it.
# apt-get install lvm2
3. To make sure the harddisk is recognised, you can use fdisk
# fdisk -lu
4. Once installed, run pvscan to scan all disks for physical volume. this to make sure your LVM harddisk is detected by Ubuntu
# pvscan
PV /dev/sda2 VG VolGroup00 lvm2 [74.41 GB / 32.00 MB free]
Total: 1 [74.41 GB] / in use: 1 [74.41 GB] / in no VG: 0 [0 ]
5. After that run vgscan to scan disks for volume groups.
# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
6. Activate all volume groups available.
# vgchange -a y
2 logical volume(s) in volume group "VolGroup00" now active
7. Run lvscan to scan all disks for logical volume. You can see partitions inside the hard disk now active.
# lvscan
ACTIVE '/dev/VolGroup00/LogVol00' [72.44 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
8. Mount the partition to any directory you want, usually to /mnt
# mount /dev/VolGroup00/LogVol00 /mnt
9. You can access the partition in the /mnt directory and can backup your data
This is exactly the solution I was searching for, and it worked a treat. Thanks. Please leave this page up for others!
ReplyDeleteHi thanks for this post. For some reason I add to load a driver manually after having installed the lvm2 package:
ReplyDelete$ modprobe dm-mod
Otherwise you get the following:
$ lvscan
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Thanks a lot, for the post and anonymous for the comment about modprobe dm-mod!
ReplyDeleteAt first, I got a couple of lines like:
ubuntu@ubuntu:~$ sudo vgchange -a y
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
and lvscan gave problems as well:
Failure to communicate with kernel device-mapper driver.
Incompatible libdevmapper 1.02.20 (2007-06-15)(compat) and kernel driver
inactive '/dev/tmp/tmp' [2.00 GB] inherit
After sudo modprobe dm-mod, it worked like a charm.
Thanks a lot, for the post and anonymous for the comment about modprobe dm-mod!
ReplyDeleteAt first, I got a couple of lines like:
ubuntu@ubuntu:~$ sudo vgchange -a y
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
and lvscan gave problems as well:
Failure to communicate with kernel device-mapper driver.
Incompatible libdevmapper 1.02.20 (2007-06-15)(compat) and kernel driver
inactive '/dev/tmp/tmp' [2.00 GB] inherit
After sudo modprobe dm-mod, it worked like a charm.
Great post indeed, and thank you 100 times for the 2nd post! This helped med alot.
ReplyDeleteThanks a lot you guys for all the comments. Learned a lot from the comments
ReplyDeleteThis post has been immensely helpful. I can now see my LVM filesystem in Thunar File Manager and can access the files... with one small caveat. The one directory that I really need access to has an X on the folder and tells me permission denied. Anyone have any ideas?
ReplyDeleterfinn, if you log in as root or just use the "sudo" command, it ignores the permissions and lets you look at the file (and also to change its permissions, if you so desire).
ReplyDeleteWhat a lifesaver! Thanks for the information. Adding modprobe dm-mod (per one of the comments) between steps 1 and 2 did the trick for me. Thanks to your post, I retrieved all data I thought I was never going to be able to from an lvm disk.
ReplyDeleteMany thanks for the posting....
ReplyDeleteIt helps me a lot to restore and move my company's old files to new server...
really works...
thanks
thanks for modprobe dm-mod ....
ReplyDeleteThanks a lot! It was very useful for me
ReplyDeleteSweet!
ReplyDeleteThis worked like a charm and allowed me to access a ton of information I had stored on a LVM partition.
Thanks a million.
anon delived
ReplyDeletemodprobe dm-mod
is what i needed
nice post
ReplyDelete"After sudo modprobe dm-mod, it worked like a charm."
ReplyDeleteBacon SAVED!!!! thanks
Thank you for this, within 5min I got what I wanted.
ReplyDeleteLifesaver. Where do I donate!?
ReplyDeleteSo many thanks for this tip! It worked just fine. Please leave it for others too.
ReplyDeletethanks a lot , I was looking for this .
ReplyDeleteYou can do all things using GUI tool too. "logical volume manager" package from ubuntu.
Thank you, thank you.
ReplyDeleteExcellent! Exactly what I needed.
ReplyDeletevery helpful post, thank you.
ReplyDeletetwo thumbs up! thanks!
ReplyDeleteit's 8 hours i look for it !
ReplyDeletethank you verrrrrrrrrry much ;)
Hello, Thanks by your Post, I follow all successfully, but, in the las step say:
ReplyDelete# /bin/mount /dev/VolGroup00/LogVol00 /disco2/
mount: debe especificar el tipo de sistema de ficheros
can you helpme please? regards wualfred
Hello, Thanks by your Post, I follow all successfully, but, in the las step say:
ReplyDelete# /bin/mount /dev/VolGroup00/LogVol00 /disco2/
mount: debe especificar el tipo de sistema de ficheros
can you helpme please? regards wualfred
thx ! exactly what I need. Good job.
ReplyDeleteThanks very much for this great tutorial. I followed the instructions exactly as posted and it worked like a charm. Keep up the good work.
ReplyDeleteby Mike A.
Thank you so much for posting this, it was very helpful. I did have some issues with permissions when I was trying to get the data off the old LVM partitioned disks. I was able to fix it with chmod and chown commands run under sudo, and remember to use the -R switch so that the new permissions will be applied to all sub folders and files recursively.
ReplyDeleteTHANKS AGAIN!!!
Thank you very much !!!
ReplyDeleteBeautiful. Thank you very much. nothing like screwing up the boot sequence on an lvm locked drive.
ReplyDeleteThank you!!!!
ReplyDeleteThank you so much
ReplyDeleteMany thanks, please keep the post.
ReplyDeleteGreat concept chosen in this post, which seems to be really helpful to everyone to improve their knowledge.
ReplyDeleteThanks for sharing the nice thought with the readers..
ReplyDeleteThis was really usefull for me. Thanks very much!
ReplyDeleteJust wanted to convey my appreciation for what I learned from this article. I look forward to learning more on this website.
ReplyDeleteThanks man, this works fine!
ReplyDeleteThanks. I was pulling my hair out trying to figure this out. Surprised there's not more guides out there on this.
ReplyDeleteTKS, YOU SAVE MY LIFE!
ReplyDeleteHey guys, i want to ask for help in mounting logical volume. I followed the instructions above and from others sites. But my problem is on mussing volume groups. when I run pvscan,pvs, pvdisplay, the VG field is empty. When I run lvscan and vgscan, No volume groups found message would be return. Hope you will help me. I have been researching this for two days now. Thanks.
ReplyDeleteHi Jan Mark Salarda,
ReplyDeleteif your pv is not available, u need to create it first using pvcreate command, followed by vgcreate command and then lvcreate to create logical volume. You then need to format it out to whatever file system you desire, before you can mount it to any directory that you wish.
Hope that helps :)cf c
Thanks for reply.
ReplyDeleteMy physical volumes are available.
Pvs command will return two PV. But VG field is empty on the two PV result. I'm thinking of creating a new VG then adding the existing PV.
But my concern is if my deleted will be deleted if I'm going to do it. Will my data be deleted? Thanks
This saves a huge time of mine for reinstallation..thanks a lot!! simply superb!
ReplyDeleteThanks a lot!!!!
ReplyDeleteReally helped me!!!
The ubuntu 13.04 to 13.10 boned up my LVM array. This saved my stuffs!
ReplyDeleteHappy to see your blog as it is just what I’ve looking for and excited to read all the posts. I am looking forward to another great article from you.
ReplyDeleteYour guide is still useful in 2014! An update to grub 2.0 left my system unbootable. So I booted with a Live CD, but I couldn't mount my root partition, which is in LVM. Then I found your page, installed lvm2 as you described, and ran all the lvm commands pvscan, vgscan, etc, and it all worked perfectly - I can mount and browse the partition now. Next task: repair the GRUB damage.
ReplyDeleteThanks for this excellent solution.
ReplyDeleteThanks for all your efforts that you have put in this.Very interesting information.I would like to do all the information
ReplyDeleteComputer Repairing Services In Delhi