LVM Verschlüsselte Partition kopieren


title: “LVM Verschlüsselte Partition kopieren”
date: 2018-10-15T09:07:14
slug: lvm-verschlusselte-partition-kopieren


Verschlüsselte Partition öffnen und neue Partition anlegen

sudo cryptsetup luksOpen /dev/sdc5 crypt
sudo vgcreate crypt-lvm /dev/mapper/crypt
sudo lvcreate -l100%FREE -nroot crypt-lvm

mount: unknown filesystem type LVM2_member

9 December, 2016

So I’m planning on making a series, “mount: unknown file-system type $TYPE”. I already have how to mount a ntfs partition, also how to mount a nfs on proxmox, now to be continued by another fun file-system. I was going through old disks, so I came across one that had LVM2_member.

  • root@svennd:~# mount /dev/sdd2 /mnt/disk

  • mount: unknown filesystem type ‘LVM2_member’

The fdisk -l already told me its a LVM :

  • 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

*(/dev/sdi1 is /boot partition, /dev/sdi2 is where the /home data resides)
*

Seems lvm2 tools also provide a way to check if its lvm or not, using lvmdiskscan(/dev/sdd2 here)

  • 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

Fine, now lets scan what lv’s are to be found using lvscan

  • root@svennd:~# lvscan

  • inactive ‘/dev/VolGroup00/LogVol00’ [230.75 GiB] inherit

  • inactive ‘/dev/VolGroup00/LogVol01’ [1.94 GiB] inherit

Since this is a old disk in an enclosure, its not activated on system boot. So we need to “activate” this lvm volume.

  • root@svennd:~# vgchange -ay

  • 2 logical volume(s) in volume group “VolGroup00” now active

and bam, ready to mount :

  • root@svennd:~# lvscan

  • ACTIVE ‘/dev/VolGroup00/LogVol00’ [230.75 GiB] inherit

  • ACTIVE ‘/dev/VolGroup00/LogVol01’ [1.94 GiB] inherit

now to mount :

  • mount /dev/VolGroup00/LogVol00 /mnt/disk

succes !

Print Friendly, PDF & Email