LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How to configure /etc/fstab to auto mount encrypted partition? (https://www.linuxquestions.org/questions/debian-26/how-to-configure-etc-fstab-to-auto-mount-encrypted-partition-915714/)

michalng 11-26-2011 09:05 PM

How to configure /etc/fstab to auto mount encrypted partition?
 
Recently installed openSUSE 12.1 dual booting with Debian.


Layout listed below:
Code:

Debian    ext3    /root  sda1   
Debian    ext3    /home  sda2  (encrypted with luks)
          swap    swap    sda3
openSUSE  ext4    /      sda5   
openSUSE  ext4    /home  sda6  (encrypted with luks)


When in Debian, I am able to manually mount openSUSE /home (sda6) and get the files that I needed from there.

Wanted to know how to configure Debian's /etc/fstab so that I can automatically mount sda6 (after entering password) during boot.

Thanks

Amdx2_x64 11-27-2011 09:45 PM

I had asked a similar question. I didn't get a response either. So I am guessing the answer is no.

michalng 11-28-2011 04:49 AM

Quote:

Originally Posted by Amdx2_x64 (Post 4535822)
I had asked a similar question. I didn't get a response either. So I am guessing the answer is no.

LOL,
this is a good reply,
thanks for the heads up.

62chevy 11-28-2011 10:53 AM

How do you mount Debian in openSUSE? Maybe you can wright a script for your autostart when logging in or maybe rclocal. Documentation seams to be skimpy on the and the only thing I could find was an FAQ that said to mount with a loop0 when doing a backup.


Try this site. http://code.google.com/p/cryptsetup/

Code:

Package: cryptsetup                     
State: not installed
Version: 2:1.1.3-4squeeze2
Priority: optional
Section: admin
Maintainer: Debian Cryptsetup Team <pkg-cryptsetup-devel@lists.alioth.debian.org>
Uncompressed Size: 1,204 k
Depends: libc6 (>= 2.3), libdevmapper1.02.1 (>= 2:1.02.36), libpopt0 (>= 1.16), libuuid1 (>= 2.16), dmsetup
Suggests: udev, initramfs-tools (>= 0.91) | linux-initramfs-tool, busybox, dosfstools
Conflicts: cryptsetup-luks
Breaks: hashalot (< 0.3-2)
Replaces: cryptsetup-luks, hashalot (< 0.3-2)
Provides: cryptsetup-luks
Description: configures encrypted block devices
 Cryptsetup provides a command-line interface for configuring encrypted devices. This is done using the Linux kernel device mapper target dm-crypt. This
 version of cryptsetup has integrated support for LUKS.
 
 cryptsetup is backwards compatible with the on-disk format of cryptoloop, but also supports more secure formats. This package includes support for
 automatically configuring encrypted devices at boot time via the config file /etc/crypttab. Additional features are cryptoroot support through
 initramfs-tools and several supported ways to read a passphrase or key.
Homepage: http://code.google.com/p/cryptsetup/

That's all I could find and you may have all ready seen this stuff.

62chevy 11-28-2011 11:07 AM

Try this Howto from Arch Linux. https://wiki.archlinux.org/index.php...tion_with_LUKS Looks like they go into it in depth.

michalng 12-25-2011 05:04 AM

Found the answer, logged here for future users who's looking for the same answer:


1. Add this line to /etc/crypttab:

my_encrypted_partition /dev/sda6 none luks,timeout=30



2. Set the home partition to this in /etc/fstab:

/dev/mapper/my_encrypted_partition /home ext4 nodev,nosuid,relatime 0 2



You'll be asked the passphrase for my_encrypted_partition during boot up. That's it.


Merry Christmas.

Ziferius 07-30-2015 05:05 PM

I saw this...... and set this up in CENTOS 7...

It does not prompt you for a password, it just drop you to emergency maintenance mode upon boot up.


But this worked for me:
udisksctl unlock -b /dev/sda2
udisksctl mount -b /dev/mapper/vg_tesla-lv_home

Obtained from the 3rd answer to this ask Ubuntu post..
(1st post so can't post a web link..... but its:
askubuntu.com/questions/63594/mount-encrypted-volumes-from-command-line)

Automatic mounting on bootup didn't work for me...


All times are GMT -5. The time now is 12:55 AM.