cryptsetup: source device not found during boot

Bug #213279 reported by cprise
8
Affects Status Importance Assigned to Milestone
cryptsetup
Invalid
Undecided
Unassigned
initramfs-tools
Invalid
Undecided
Unassigned
linux (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: linux-image-2.6.24-15-generic

After dist-upgrading from Gutsy i386 to Hardy beta, my encrypted-root system no longer boots. Instead it displays an error "cryptsetup: source device /dev/hda2 not found"

I guessed (correctly) that the device paths for IDE were changed to /dev/sd?? and so re-worked my initramfs to point to /dev/sda2 instead. But now cryptsetup says source /dev/sda2 not found.

Four or five minutes later I'll get a busybox shell and can see that /dev/sda is there, but apparently the HD device nodes are being created too late.

This is not a LUKS setup, using plain dmcrypt instead. This arrangement worked fine under Gutsy.

If I manually execute a 'cryptsetup create cr-root /dev/sda2 -v -c aes-cbc-essiv:sha256 -h sha1 -s 128' command in the busybox, then 'exit', the system will boot.

Changing /etc/crypttab to use sda2 then re-building with 'update-initramfs -c -k $(uname -r)' has not helped.

Another user is getting this error. See this thread for discussion: http://ubuntuforums.org/showthread.php?p=4624349

Here is my crypttab:
# <target name> <source device> <key file> <options>
cr-root /dev/sda2 none cipher=aes-cbc-essiv:sha256,hash=sha1,size=128
swap /dev/sda1 /dev/random swap,cipher=aes-cbc-essiv:sha256

Tags: cft-2.6.27
Revision history for this message
cprise (cprise-yahoo) wrote :

This problem has been resolved for me using the latest system update (having the -16 kernel revision).

Revision history for this message
Ferrix Hovi (ferrix) wrote :

This still happens.

Here's a snippet from my crypttab.

------- 8< -------
sdd2_crypt /dev/disk/by-uuid/bd3d4b37-5b8d-4ad6-a21c-c52115c77f88 none luks
------- 8< -------

With kernel revision 8, I don't get an error but with revision 16 the initramfs reports that the specified file is not found. This is a major regression because this concerns encrypted partitions automagically generated with Gutsy installer.

Revision history for this message
Netzize (netzize) wrote :

I have the same problem.

Error on boot:
cryptsetup: Source device /dev/sdd3 not found.
Distribution: Ubuntu Hardy (8.04) final
Kernel: Linux 2.6.24-16-generic, 32 bit

Crypttab:
# <target name> <source device> <key file> <options>
root /dev/sdd3 none luks,retry=1,cipher=aes-lrw-bendi
home /dev/sdd4 none luks,retry=1,cipher=aes-lrw-bendi
swap /dev/sdd2 /dev/urandom swap

Revision history for this message
DavidPk (dave-s-p) wrote :

I can verify that this continues to be a bug. I had cryptsetup working with the kernel installed before upgrading to 8.04 Hardy (2.6.22-14-generic), but the kernel installed by Hardy (2.6.24-16-generic) reports 'source device /dev/sda2 not found.'

If I wait for busybox, and run 'cryptsetup luksOpen /dev/sda2 cryptroot' and 'exit' I can boot with the new kernel.

I have tried dpkg-reconfigure cryptsetup, updating initrd, etc..

DavidPk (dave-s-p)
Changed in linux:
status: New → Confirmed
Revision history for this message
DavidPk (dave-s-p) wrote :

OK, I was hoping this was a problem in the /etc/initramfs-tools/scripts/local-top/cryptsetup script, and that it simply wasn't properly parsing the root source correctly, or that the check wasn't executed correctly.

I've been editing the script and running update-initramfs -k (my version) -u and rebooting (and rebooting).

the following revision:

        if [ ! -e $cryptsource ]; then
                echo "cryptsetup: Source device $cryptsource not found"
#is my device really there?
                echo `ls /dev/sd*`
                return 1
        fi

shows:
ls: ls /dev/sd*: no such file or directory

So, at the moment the cryptsetup script is checking for the device it really isn't there, yet by the time busybox is triggered, it (/dev/sda2 in my case) is.

Hoping it was as easy as waiting, I replace the check with a short sleep command, and it didn't fix the problem.

Can we get the cryptsetup to run later in the whole order of things for this kernel?

I will keep investigating, although this isn't my area of expertise.

Revision history for this message
cprise (cprise-yahoo) wrote :

I want to report that less than a week ago, this issue re-appeared for me as an _intermittant_ problem. After failing to find the drive, it seems to be able to boot normally if I warm-reboot with Ctrl-Alt-Del. The rest of you should try that, or using your system reset switch if available.

Revision history for this message
lotus49 (lotus-49) wrote :

I too have had this problem with a clean install from the 8.04 alternate install CD.

My systems boots fine but eventually I am dumped into busybox. If I boot into recovery mode I see:

cryptsetup: Source disk /dev/disk/by-uuid/<UUID> not found

Rebooting with c-a-d does not help. I have also tried running cryptsetup at the busybox prompt but I am new to this (not Ubuntu but to encrypted root partitions) so I don't know what the correct command should look like. cryptsetup doesn't seem to give any error messages even if the parameters are wrong and when I 'exit' I just get another busybox prompt.

This is not a critical issue to me at the moment as I am just experimenting, but something is clearly broken as I just did a vanilla install of this and it didn't work. I am not trying anything unusual - well I am installing this on a USB stick but I have done that about a hundred times before without any major problems.

Revision history for this message
jjwin2k (jjwin2k) wrote :

cp /usr/share/initramfs-tools/hooks/cryptroot /etc/initramfs-tools/hooks/cryptroot
cp /usr/share/initramfs-tools/scripts/local-top/cryptroot /etc/initramfs-tools/scripts/local-top/cryptroot
update-initramfs -u

Solved the problem on my machine.

Revision history for this message
DavidPk (dave-s-p) wrote :

JJWin2k,

Your solution worked for me too, so it seems someone just needs to script this to happen during the upgrade. Thank you for saving me a lot of time during bootup!

Revision history for this message
Netzize (netzize) wrote :

I could solve the problem, too. I found out, that the new kernel has renamed my devices and so cryptsetup could not find the device because it was not there. That`s especially strange 'couse occasionally i could normally boot with that old configuration. jjwin2k fix and renaming the devices in crypttab solved the problem.

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

The Ubuntu Kernel Team is planning to move to the 2.6.27 kernel for the upcoming Intrepid Ibex 8.10 release. As a result, the kernel team would appreciate it if you could please test this newer 2.6.27 Ubuntu kernel. There are one of two ways you should be able to test:

1) If you are comfortable installing packages on your own, the linux-image-2.6.27-* package is currently available for you to install and test.

--or--

2) The upcoming Alpha5 for Intrepid Ibex 8.10 will contain this newer 2.6.27 Ubuntu kernel. Alpha5 is set to be released Thursday Sept 4. Please watch http://www.ubuntu.com/testing for Alpha5 to be announced. You should then be able to test via a LiveCD.

Please let us know immediately if this newer 2.6.27 kernel resolves the bug reported here or if the issue remains. More importantly, please open a new bug report for each new bug/regression introduced by the 2.6.27 kernel and tag the bug report with 'linux-2.6.27'. Also, please specifically note if the issue does or does not appear in the 2.6.26 kernel. Thanks again, we really appreicate your help and feedback.

Revision history for this message
MillenniumBug (millenniumbug) wrote :

This bug report concerns obsolete versions of Ubuntu and has been closed.

If a similar problem exists in Ubuntu 11.04, feel free to open a new one.

Changed in cryptsetup:
status: New → Invalid
Changed in initramfs-tools:
status: New → Invalid
Changed in linux (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.