View previous topic :: View next topic |
Author |
Message |
Ramrod n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 30 Apr 2005 Posts: 2
|
Posted: Sat Apr 30, 2005 10:24 pm Post subject: mount dm-crypt encrypted partition |
|
|
Hi,
maybe someone is able to clarify the following for me:
If I encrypt a partition like
./cryptsetup -c aes -y create my-data /dev/sda1
mke2fs -j /dev/mapper/my-data
mount /dev/mapper/my-data /data
is there a way to mount it after reboot, which asks me for the password?
If know that cryptsetup only creates a mapping and you call cryptsetup again after a reboot and supply the same passphrase you will be able to mount your filesystem you created before. The problem here is that if you specify a different password than when you first created it, cryptsetup doesn't complain, but creates a new mapping. So I can't use this method in an init script after boot, because a typo in the password would mean it wouldn't be mounted.
Someone have a solution? I want to encrypt /home and would like to be asked for the password when booting. If I misstype it I should be asked for it again. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
fangorn Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Final Fantasy/Final_Fantasy_7_-_Barret.gif)
Joined: 31 Jul 2004 Posts: 1886
|
Posted: Sun May 01, 2005 1:12 pm Post subject: |
|
|
I'm using a file instead of a partition, but the cryprsetup command should be the same
Code: |
cryptsetup create my-data /dev/sda1
mount -t ext2 /dev/mapper/my-data /data
|
However, this works for mounting by hand only and fails if you misstype!!
But here https://forums.gentoo.org/viewtopic-t-274651.html is a howto for this |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Ramrod n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 30 Apr 2005 Posts: 2
|
Posted: Sun May 01, 2005 4:46 pm Post subject: |
|
|
I saw that if you use a wrong password, mount fails. So for now I just wrote a little script which asks for the password and then checks if the mappd device was mounted ok and if not than I just repeat it until it works. Not nice but works. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|