Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After some time on Ubuntu 12.04 (sure not since the first intallation) I noticed the following error on boot:

Begin: Running /scripts/local-top ... /scripts/local-top/cryptroot: line 24: dirname: not found

Edit: content of /usr/share/initramfs-tools/scripts/local-top/cryptroot is here:

I'm not using encryption, because

sudo dmsetup status


No devices found
share|improve this question
Have you tried reinstalling cryptsetup (assuming that you got it from the official repos)? sudo apt-get install --reinstall cryptsetup – nickguletskii Jul 18 '12 at 6:34
Thanks, but it doesn't solve. – jasmines Jul 18 '12 at 6:53
Could you please post contents of /scripts/local-top/cryptroot? – nickguletskii Jul 18 '12 at 6:55
File doesn't exist. – jasmines Jul 18 '12 at 6:57
The error message is actually saying that the dirname command is not found while testing for prerequisites for cryptroot. This should be in /usr/bin/dirname as is part of coreutils (which is a fairly fundamental package). I would suggest a (re)install of coreutils as this would appear to be broken. – StarNamer Jul 23 '12 at 22:09
up vote 2 down vote accepted

The error and the path given /scripts/... indicate that this is happening inside the initramfs filesystem.

I suggest backing up the contents of /boot, eg

tar -cvzf ~/boot_backup.tar.gz /boot

And then remove cryptsetup with apt-get; that should recreate the initramfs without the cryptroot script. If everything works, that's your solution. If not, you can restore the originals by extracting the backup tarball, reinstall cryptsetup, comment here and we can continue troubleshooting further.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.