The other day I had this Ubuntu Linux VM that I hadn't logged onto in a really long time, and for the life of me I couldn't remember the password I set for root. Yeah, I know, I'm not supposed to use root and I'm only supposed to use sudo. Well I don't. I always activate root!
What can I say? I like to live dangerously...
- Boot using the live DVD. Install lvm2 by running:
# apt-get install lvm2
- To make sure the hard disk is recognized, you can use fdisk.
# fdisk -lu
- Run pvscan to scan all disks for an lvm2 volume. This is to make sure your LVM hard disk is detected by Ubuntu.
- After that run vgscan to scan disks for volume groups.
- Activate all volume groups available.
# vgchange -a y
- Run lvscan to scan all disks for logical volumes. You can see partitions inside the hard disk are now active.
- Your actual partitions contained in the lvm2 volume will now be listed. Mine were:
ACTIVE '/dev/ubuntu/root' [50 GB] inherit
ACTIVE '/dev/ubuntu/swap' [4 GB] inherit
- Mount the root partition to any directory you want, usually to /mnt
# mount /dev/ubuntu/root /mnt
- You can access the partition in the /mnt directory now
Please... Don't judge me!
One thing you might want to do is make sure that the live DVD you are using has the same architecture as the system you want to mount. For instance, if your system is running 32 bit Ubuntu, make sure you use a 32 bit Ubuntu desktop live DVD. If your system is running 64 bit Ubuntu, use the 64 bit Ubuntu desktop live DVD. You savvy?
If you have any questions, hit me up in the comments.