Question re: Mounting Encrypted LVM Partition

Forum rules
Before you post please read this
mikemoceri
Level 1
Level 1
Posts: 5
Joined: Wed Jun 24, 2015 7:33 pm

Question re: Mounting Encrypted LVM Partition

Postby mikemoceri » Wed Jun 24, 2015 7:41 pm

Hello,

So, my motherboard went kaput last week, and I have vital legal documents on an encrypted drive. After attaching said drive to an external bay, I appear to be able to decrypt it fine with sudo cryptsetup -v luksOpen /dev/sdc3 external, leading to the following output:

Code: Select all

Enter passphrase for /dev/sdc3:
Key slot 0 unlocked.
Command successful.


The output for ls /dev/mapper/ is as follows:

Code: Select all

control  external  mint--vg-root  mint--vg-swap_1


However, when I run sudo mount /dev/mapper/external /media/external/, I get the following error:

Code: Select all

mount: unknown filesystem type 'LVM2_member'


I'm pretty sure I have LVM installed, since my root drive uses LVM. Why am I getting this error?

-Mike

User avatar
Laurent85
Level 12
Level 12
Posts: 4155
Joined: Tue May 26, 2015 10:11 am
Location: Vendée, France

Re: Question re: Mounting Encrypted LVM Partition

Postby Laurent85 » Thu Jun 25, 2015 7:11 am

mikemoceri wrote:However, when I run sudo mount /dev/mapper/external /media/external/, I get the following error:

Code: Select all

mount: unknown filesystem type 'LVM2_member'

Root filesystem is mint--vg-root, copy/paste command :

Code: Select all

sudo mount /dev/mapper/mint--vg-root /mnt
Image
Au printemps tu verras je serai de retour,
Le printemps c'est joli pour se parler d'amour,
Nous irons voir ensemble les jardins refleuris,
Et déambulerons dans les rues de Paris.

mikemoceri
Level 1
Level 1
Posts: 5
Joined: Wed Jun 24, 2015 7:33 pm

Re: Question re: Mounting Encrypted LVM Partition

Postby mikemoceri » Mon Jun 29, 2015 1:14 pm

I'm pretty sure that the mint--vg-root in the output of "ls /dev/mapper/" is referring to my root partition, since I'm running all of this on mint. Note that I ran "sudo cryptsetup -v luksOpen /dev/sdc3 external" previously, so I think that the one I should be mounting is "external."

User avatar
Laurent85
Level 12
Level 12
Posts: 4155
Joined: Tue May 26, 2015 10:11 am
Location: Vendée, France

Re: Question re: Mounting Encrypted LVM Partition

Postby Laurent85 » Mon Jun 29, 2015 3:44 pm

So why trying to mount /dev/mapper/external ? You wrote
mikemoceri wrote:However, when I run sudo mount /dev/mapper/external /media/external/ , I get the following error:

Code: Select all

mount: unknown filesystem type 'LVM2_member'

I'm pretty sure I have LVM installed, since my root drive uses LVM. Why am I getting this error?
Image
Au printemps tu verras je serai de retour,
Le printemps c'est joli pour se parler d'amour,
Nous irons voir ensemble les jardins refleuris,
Et déambulerons dans les rues de Paris.

mikemoceri
Level 1
Level 1
Posts: 5
Joined: Wed Jun 24, 2015 7:33 pm

Re: Question re: Mounting Encrypted LVM Partition

Postby mikemoceri » Tue Jun 30, 2015 3:00 pm

I thought that's how you're supposed to mount LVM volumes. Is there something I'm missing here?

mikemoceri
Level 1
Level 1
Posts: 5
Joined: Wed Jun 24, 2015 7:33 pm

Re: Question re: Mounting Encrypted LVM Partition

Postby mikemoceri » Tue Jun 30, 2015 7:36 pm

To clarify: I'm trying to recover my encrypted home partition from ANOTHER mint system which went kaput. My current PC (the one that works) is ALSO running Linux Mint 17.1 Rebecca. The hard drive I'm trying to recover from is labeled sdc, and I believe the correct partition is sdc3 (Luks can decrypt it just fine with my password).

User avatar
Laurent85
Level 12
Level 12
Posts: 4155
Joined: Tue May 26, 2015 10:11 am
Location: Vendée, France

Re: Question re: Mounting Encrypted LVM Partition

Postby Laurent85 » Wed Jul 01, 2015 3:50 am

Ok perhaps you missed my previous post with correct mount command. Unlock drive as you have already done then copy/paste command :

Code: Select all

sudo mount /dev/mapper/mint--vg-root /mnt
Image
Au printemps tu verras je serai de retour,
Le printemps c'est joli pour se parler d'amour,
Nous irons voir ensemble les jardins refleuris,
Et déambulerons dans les rues de Paris.

User avatar
Derek_S
Level 6
Level 6
Posts: 1227
Joined: Sat Dec 28, 2013 5:36 pm
Location: Long Island, N.Y.

Re: Question re: Mounting Encrypted LVM Partition

Postby Derek_S » Tue Jul 21, 2015 11:40 pm

mikemoceri wrote:I thought that's how you're supposed to mount LVM volumes. Is there something I'm missing here?


Hello mikemoceri - I know this thread is a bit long in the tooth and I'm sorry for not coming across it sooner.

Here's the procedure I used on my own system, so I can vouch for the fact that it does work. Terminal commands as follows:

1.) sudo apt-get install cryptsetup lvm2 ### These two packages should already be installed, do this just to make sure

2.) sudo modprobe dm-crypt ### Verify the kernel module dm-crypt is active

3.) sudo modprobe dm-mod ### Verify the kernel module dm-mod is active

4.) sudo cryptsetup luksOpen /dev/sdc3 MYDATA ### Unlock the LUKS partition and label it MYDATA; this assumes sdc3 is the encrypted partition

5.) sudo vgscan ### Scan for volume groups; you should find volume group "mint-vg" in the output

6.) sudo vgchange -ay mint-vg ### Make the volume group mint-vg active as well as all of the logical volumes it contains

7.) sudo lvscan ### Scan for logical volumes in the volume group; you should find the logical volume "/dev/mint-vg/root" in the output

8.) sudo mkdir /media/root ### Create a new directory /media/root in order to mount the logical volume /dev/mint-vg/root

9.) sudo mount /dev/mint-vg/root /media/root ### Mount the logical volume /dev/mint-vg/root as /media/root

At this point you should see an icon for /media/root appear on the Desktop. You will be able to copy all of your data files from /media/root over to your new system or to a pre-formatted USB flash drive if you're running from a live CD session. When you're done, unmount as follows:

10.) sudo umount /media/root ### Unmount /media/root

11.) sudo cryptsetup luksClose MYDATA ### Lock the encrypted partition; I got an error message here, but it really doesn't matter since you've already saved your data and will be shutting down
If Bill Gates had a nickel for every time Windows crashed . . . . . oh wait, he does.


Return to “Mounting Partitions”

Who is online

Users browsing this forum: No registered users and 1 guest