https://evilshit.wordpress.com/2012/10/29/how-to-mount-luks-encrypted-partitions-manually/
blkid | grep crypto
cryptsetup luksOpen /dev/sda2/ crypthomemkdir /mnt/crypthome && mount /dev/mapper/crypthome /mnt/crypthomeunknown lvm2_memberhttps://www.svennd.be/mount-unknown-filesystem-type-lvm2_member/lvmdiskscanlvscanYou used the exact same name (ubuntu-vg) for your new volume group as the old volume group. You must give them unique names. You can rename one of the groups usingvgrename
and its UUID. Find the UUID withvgdisplay
and then rename the volume group:vgrename <VG UUID> new_name
(/dev/sdi1 is /boot partition, /dev/sdi2 is where the /home data resides) Seems lvm2 tools also provide a way to check if it is lvm or not, using lvmdiskscan (/dev/sdd2 here)
- root@svennd:~# fdisk -l /dev/sdd
- Disk /dev/sdd: 233.8 GiB, 251000193024 bytes, 490234752 sectors
- Units: sectors of 1 * 512 = 512 bytes
- Sector size (logical/physical): 512 bytes / 512 bytes
- I/O size (minimum/optimal): 512 bytes / 512 bytes
- Disklabel type: dos
- Disk identifier: 0x0009345d
- Device Boot Start End Sectors Size Id Type
- /dev/sdd1 * 63 208844 208782 102M 83 Linux
- /dev/sdd2 208845 488247479 488038635 232.7G 8e Linux LVM
Fine, now let’s scan what lv’s are to be found using lvscan
- root@svennd:~# lvmdiskscan
- /dev/sdb1 [ 1.82 TiB]
- /dev/sdc2 [ 149.04 GiB]
- /dev/sdd1 [ 101.94 MiB]
- /dev/sdd2 [ 232.71 GiB] LVM physical volume
- 0 disks
- 4 partitions
- 0 LVM physical volume whole disks
- 1 LVM physical volume
Since this is an old disk in an enclosure, it is not activated on system boot. So we need to “activate” this lvm volume.
- root@svennd:~# lvscan
- inactive '/dev/VolGroup00/LogVol00' [230.75 GiB] inherit
- inactive '/dev/VolGroup00/LogVol01' [1.94 GiB] inherit
and bam, ready to mount :
- root@svennd:~# vgchange -ay
- 2 logical volume(s) in volume group "VolGroup00" now active
now to mount :
- root@svennd:~# lvscan
- ACTIVE '/dev/VolGroup00/LogVol00' [230.75 GiB] inherit
- ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GiB] inherit
success !
- mount /dev/VolGroup00/LogVol00 /mnt/disk