Gentoo Archives: gentoo-amd64

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] Read/write Access on ext4 disk
Date: Tue, 28 Apr 2009 22:30:46
Message-Id: 58965d8a0904281530u7b4d1f9eu879e225dfa73ad3f@mail.gmail.com
In Reply to: Re: [gentoo-amd64] Read/write Access on ext4 disk by Tom
1 On Tue, Apr 28, 2009 at 4:54 PM, Tom <uebershark@××××××××××.com> wrote:
2 > Anyway, if my entry 'should' work, do I maybe just need to chmod the
3 > /mnt/hate dir?? I seem to recall needing todo something like this in
4 > the past...
5
6 Yeah, check the permissions of the /mnt/hate after it is mounted, it
7 may change from what it was before mount (it takes on the
8 characteristics of the mounted partition). If it won't mount then
9 maybe the encrypted volume is not set up right.
10
11 > Seeing that you are also dealing with an encrypted volume, it the drive
12 > a fixed or portable one?
13
14 That particular one is a RAID5 of fixed discs but I have used the same
15 technique for external drives as well as burning encrypted DVDs for
16 backups. I run cryptsetup to define the "cryptoraid" device and then i
17 just use a normal "mount /mnt/raid" command to mount it.
18
19 > Here I have an usb-drive, with one partition encrypted. After posting, I
20 > plugged it in, only to be greeted by a 'encrypted volume detected'
21 > message, with a password promt. I don't use gnome or kde,so I was quite
22 > surprised. (I use thunar).
23
24 I don't know about that... I just manage mine from commandline :) I
25 would try ignoring the automatic-helpful-gui stuff until you ensure it
26 is working manually. Its idea of "encrypted" and yours (and reality)
27 may be totally different.
28
29 > Anyway, I figured that it would take care of
30 > mounting the thing (it being hal) making my fstab entry irrelevant.
31 >
32 > However, I wasn't able to test, cause for what ever reason, my password
33 > does not get accepted, neither at this promt, nor when doing this
34 > manually. Has this ever happened to you?? I'm 100% certain that I'm not
35 > misstyping, and I 100% wrote the password down correctly... :(
36 > No data lost, as I was still setting things up, but this is quite
37 > shocking...
38
39 Here is the command I use for creating/opening an encrypted volume:
40
41 sudo cryptsetup -c aes -s 256 -h sha256 -y create [mycrypt]
42 /dev/[your-encrypted-device]
43
44 where [mycrypt] is the desired name of your encrypted device ("hate"
45 in your case) and [your-encrypted-device] is /dev/sdg1 or whatever
46 your USB device/partition is. And of course the cipher and hash
47 settings are whatever you used. After that you can simply mount it
48 like normal.
49
50 When I'm done, I unmount like normal, then:
51
52 sudo cryptsetup remove mycrypt
53
54 and then eject the device or whatever.
55
56 For creating encrypted DVDs, I first use dd to make an empty .iso file
57 roughly the size of a DVD (either 4700000 1k blocks for single-layer
58 or 8500000 1k for dual-layer) and then use losetup to create a
59 loopback device out of it. After that the cryptsetup to make an
60 encrypted device, and then mkisofs to create the image directly to the
61 encrypted device. Then I unmount it all and burn the .iso image to a
62 blank disc just like normal (burning software may complain that it's
63 an invalid image -- ignore that). Then to read the disc, just use the
64 dvd-rom drive as your device in cryptsetup, etc.
65
66 HTH :)
67
68 Paul