Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mount dm-crypt encrypted partition
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Ramrod
n00b
n00b


Joined: 30 Apr 2005
Posts: 2

PostPosted: Sat Apr 30, 2005 10:24 pm    Post subject: mount dm-crypt encrypted partition Reply with quote

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
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Sun May 01, 2005 1:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ramrod
n00b
n00b


Joined: 30 Apr 2005
Posts: 2

PostPosted: Sun May 01, 2005 4:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum