How to mount LVM partition on Ubuntu

Creating the main partition for ubuntu

Image via Wikipedia

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

Note

This post is a copy of http://linuxwave.blogspot.com/2007/11/mounting-lvm-disk-using-ubuntu-livecd.html. This is a valuable info, so to avoid to not be able to reach the site in the future I have copied it instead to just link it. If the author feels that its copyright are beeing violated can ask me to remove the post.

About these ads

15 Responses

  1. [...] que o programa monte em modo read only (se for LVM, como no meu caso, vai ser necessário seguir mais alguns passos). # extundelete /dev/nome_da_particao [...]

  2. Thank you! Have been looking everywhere for this information!!!

  3. you saved the day.Bless you

  4. saved my life thank you very much

  5. Hi,

    i get an error at the last step #8

    “mount /dev/VolGroup00/LogVol00 /mnt”
    “mount: you must specify the file system type”

    I get no error from step 1 to 7, but the last step don’t working.

    Can you help me please?

    thanks in advance.

  6. perfect information! thankyou

  7. saved the day, thanks :)

  8. Thanks for the article mate! You allowed me to retrieve some data from a harddisk that i really needed. Cheers!

  9. […] had RHEL 6 installed on my hard disk. boot partition was sda5 while / was sda6 (lvm2 type). I read http://quonn.wordpress.com/2010/12/0…ion-on-ubuntu/ I did follwing […]

  10. Excellent stuff. Thank you.

  11. This was very helpful. Thanks a lot :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: