Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 213654 - sys-fs/cryptsetup - USB disk unrecognized
Summary: sys-fs/cryptsetup - USB disk unrecognized
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-17 05:19 UTC by Paulo da Silva
Modified: 2008-03-19 06:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (ei,4.04 KB, text/plain)
2008-03-17 05:20 UTC, Paulo da Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paulo da Silva 2008-03-17 05:19:21 UTC
My USB (/dev/sdc1) disk is not yet there when, earlier in the boot process, it is checked to be assigned by cryptsetup. So, the corresponding /dev/mapper/foo is not created. After booting I am able to use cryptsetup to create /dev/mapper/foo.

I also have another normal hd partition using cryptsetup and that one works perfectly as expected.
Comment 1 Paulo da Silva 2008-03-17 05:20:17 UTC
Created attachment 146373 [details]
emerge --info
Comment 2 SpanKY gentoo-dev 2008-03-17 05:35:09 UTC
that is why the script will keep checking over and over ... once the usb device settles, cryptsetup should find it just fine

just dont cancel the cryptsetup process until the usb disk is available
Comment 3 Paulo da Silva 2008-03-17 06:06:29 UTC
(In reply to comment #2)
> that is why the script will keep checking over and over ... once the usb device
> settles, cryptsetup should find it just fine
> 
> just dont cancel the cryptsetup process until the usb disk is available
> 

Sorry, but what do you mean by the "cryptsetup process"?
Earlier during the boot process, it is claimed that /dev/sdc1 does not exist (can't remember the exact message - I am on my laptop now). Later, by the end of the boot process, it says something like "some devices were not mapped". After the boot process ends, the mapping device is never created. I need to create it manually.
Comment 4 SpanKY gentoo-dev 2008-03-17 07:24:51 UTC
what does your /etc/conf.d/cryptfs look like ?  if you set "remdev" properly, the cryptfs hook will loop over and over trying to find the device until you tell it to stop
Comment 5 Paulo da Silva 2008-03-18 18:28:41 UTC
(In reply to comment #4)
> what does your /etc/conf.d/cryptfs look like ?  if you set "remdev" properly,
> the cryptfs hook will loop over and over trying to find the device until you
> tell it to stop
> 

target=C-usb
remdev='/dev/disk/by-id/usb-...-0:0-part1'
source='/dev/disk/by-id/usb-...-0:0-part1'
#remdev='/dev/sdc1'
#source='/dev/sdc1'
key='/dev/fd0/foo'

The device is connected an power on

Console boot:

loops forever {
 Please insert the removable device for C-usb
 removable device for C-usb not present
 Abort(yes/no) no
}

Answering yes completes the boot process but didn't create C-usb.

BTW, in general shouldn't the cryptsetup command be issued only when I power on the device? What if I used a pen drive for example? Shouldn't it be issued only at the time I insert the pen?

Thanks.
Comment 6 SpanKY gentoo-dev 2008-03-18 19:54:52 UTC
if cryptsetup says it isnt present, then that's because it isnt at the time cryptsetup is running.  edit the dm-crypt-start.sh file in /lib/rcscripts/addons/ and you can see dm_crypt_execute_volumes().

as for hotplugging, that is not what the cryptsetup scripts are designed for.  feel free to write something along those lines.
Comment 7 Paulo da Silva 2008-03-19 00:36:11 UTC
(In reply to comment #6)
> if cryptsetup says it isnt present, then that's because it isnt at the time
> cryptsetup is running.
If you mean the drive is not physically there or is disconnected, no. It is there, connected and powered. Besides, when the boot process ends I can immediately issue a cryptsetup command. So there must be a bug somewhere ...
May be the needed USB modules are still not loaded at that time ...
> ...
> as for hotplugging, that is not what the cryptsetup scripts are designed for. 
> ...

That's OK.
Since the drive I referred is used mainly for backups, the startup scripts are not very useful to me. So I wrote a little mount script to properly mount/unmount this drive.
Comment 8 SpanKY gentoo-dev 2008-03-19 02:44:35 UTC
it doesnt matter if it's plugged in, it matters if the kernel/udev detected and processed it properly

cryptsetup is not related in anyway to the device node creation ... if it doesnt exist, that isnt cryptsetup's problem

edit the function in question and try putting some `ls` statements in the for loop
Comment 9 Doug Goldstein (RETIRED) gentoo-dev 2008-03-19 03:07:25 UTC
I'll chime in late here Ben (strerror) the maintainer of cryptsetup and the person that wrote this support. It's a known issue that hotplugging does not work and won't work. I can't remember the bug # but it's mentioned there and I believe it was closed since that would require monitoring of plugging in of devices which was deemed outside the scope of this.

You might want to look at HAL + gnome-volume-manager + gnome-mount, I know for a fact that combo supports this and does the right thing. HAL + ivman is a possibility and I would also expect HAL + KDE 3.5.8 or 4.0.x to do the right thing.

This is just something that the boot scripts can not and will not support. Targeting the bug as such.
Comment 10 SpanKY gentoo-dev 2008-03-19 06:32:38 UTC
i dont think this is a hotplugging issue ... udev should create an appropriate symlink for the device when it's plugged in and assuming the symlink is the same as in the configuration file, things work