LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-28-2013, 10:30 AM   #1
makupl
LQ Newbie
 
Registered: Sep 2013
Posts: 23

Rep: Reputation: Disabled
LUKS- /dev/mapper/"device" disappears after reboot


Hello.
I successfully created LUKS on one disk partition of /dev/sdb,
added entry to /etc/fstab and mounted. It was fine.
I edited /etc/crypttab and added

mountpt /dev/sdb none

When booting it asks for passphrase and then is mounted.
Thats fine.
Now.
According to all sources /etc/crypttab can seem like:

mountpt /dev/mapper/device

But when I put it like that it doesnt mount and send error that /dev/mapper/device doesn't exists
It works only when put phisical entry /dev/sdb.
I'm confused

Last edited by makupl; 11-05-2013 at 02:28 AM. Reason: more tests done
 
Old 10-25-2017, 07:36 AM   #2
talora
LQ Newbie
 
Registered: Oct 2017
Posts: 1

Rep: Reputation: Disabled
Unhappy LUKS /dev/mapper/<device name> disappears after reboot (Linux Deepin)

Hi!

I'm facing the same issue here, under Linux Deepin. It started after a apt-get dis-upgrade. Tried to reinstall the OS and reconfigure the encrypted device as /home. It works OK until next reboot, when OS enters in recovery mode. A "ls /dev/mapper" confirms the device no longer exists and I have to run a "cryptsetup luksOpen /dev/sda3 <UUID>" all over again to make it work. It's annoying!

Any ideas on how to solve that?

Thanks a lot!

Best regards,

Luis Talora
 
Old 10-25-2017, 08:03 AM   #3
Aeterna
Member
 
Registered: Aug 2017
Location: Terra Mater
Distribution: VM Host: Slackware-current, VM Guests: Artix, Venom, antiX, Gentoo, FreeBSD, OpenBSD, OpenIndiana
Posts: 482

Rep: Reputation: Disabled
I do not mount luks encrypted partition at boot time. I mount it when I need it but you can add this:

/etc/fstab
/dev/mapper/crypt /mnt/encrypted ext4 discard,noatime,errors=remount-ro 0 1

it means that you have to create manually /mnt/encrypted mount point
it assumes that your luks encrypted device is formatted with ext4 and that it is on ssd (discard option if you don't care so much about possible trimming leakage)

this is my /etc/crypttab
encrypted UUID=xxxxxxxxxxxxxxxxxxx none luks,discard

UUID info from blkid
I think that you don't need to edit /etc/crypttab anymore (maybe distro specific though)

manually mount luks device
sudo cryptsetup --type luks --allow-discards open /dev/sdbX encrypted

where /dev/sdbX
corresponds to the partition number that is encrypted and command above assumes ssd ready for fstrim

next mount ext4 partition:
#sudo mount -t ext4 /dev/mapper/encrypted /mnt/encrypted/


after you mount luks device/ext4 partition you should see:

sudo cryptsetup status /dev/mapper/encrypted
/dev/mapper/encrypted is active and is in use.
type: LUKS1
cipher: aes-xts-plain64
keysize: 512 bits
device: /dev/sdb1
offset: 4096 sectors
size: 184315904 sectors
mode: read/write
flags: discards

hope this will help a bit
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BackTrack 5 R3 boot issue: "/dev/mapper/vg-root does not exist! Dropping to shell!" EStyles Linux - Laptop and Netbook 2 12-07-2012 08:24 PM
/dev/mapper/device_name missing for Luks dman777 Red Hat 3 03-31-2011 08:03 PM
13 2.6.29.6 cryptsetup luks wrong device name in /dev/mapper/* TheSoftRock Slackware 1 03-04-2010 05:51 PM
Using "device-mapper" with kernel version 2.4 jdaniels73 Linux - Enterprise 0 09-15-2006 03:46 AM
"unable to find device node for /dev/x in /dev!" during install zombiedeth *BSD 0 02-02-2004 02:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration