Showing posts with label mount. Show all posts
Showing posts with label mount. Show all posts

Solution for mount fails with "No such file or directory"

If you find yourself stuck in an initramfs Busybox shell, trying to manually mount the root filesystem (using a command such as mount /dev/mapper/yourrootfs /root) and getting a confusing "No such file or directory" message in response, then check whether the appropriate kernel module for your filesystem type is loaded (i.e. run "lsmod"). Something as simple as "modprobe ext2" before the mount command might be the entire solution you need (it was for me today, in context of an interrupted Debian dist-upgrade from squeeze to wheezy)!

Fix for "No such file or directory" while trying to mount --bind

Problem: The command mount --bind /mnt/data/usr /usr in Linux fails with "No such file directory". /mnt/data is a mount point of a dm-crypt device. strace shows ENOENT for the mount syscall, no other clues. Variants that don't refer to /usr (for example, to /usr2 instead), do work as expected. The same error occurs after and during boot process, so it's not explainable by used files.

Solution: The problem disappeared after upgrading the kernel from 2.6.34 to 2.6.38.8.