Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to loop mount my root filesystem (a loop file) within a busybox initramfs.

I try to run the command:

mount /rootfs.raw /root

... which works on my Ubuntu laptop, however, I simply get

mount: mounting /dev/loop0 on /root failed: Invalid argument

No matter what combination of options I use, (including loading to /loop0 manually and trying to mount it), the system will not mount the loop device.

Why can't I mount it?

share|improve this question
    
Have you tried -o loop? –  msw Aug 21 '13 at 2:28
add comment

2 Answers 2

In order to solve this problem, I had to be more verbose about my mounting command. I ended up using:

modprobe loop
mount -t iso9660 -o loop /bootpart/rootfs.raw /root

This worked properly.

share|improve this answer
add comment

According to mount(2):

EINVAL source had an invalid superblock. Or, a remount was attempted, but source was not already mounted on target. Or, a move was attempted, but source was not a mount point, or was '/'.

Of which the first failure seems the most likely and is easy enough to check with

fsck /rootfs.raw

Does the machine you are trying to mount upon have the loop driver built in or loaded? Try

grep loop /proc/devices

If not, is loop a loadable module? Try

# modload loop

Are there loop-device block i-nodes in place? What does

ls -l /dev/loop*

show? Does the major number correspond to the driver number in /proc/devices?

share|improve this answer
    
See my answer please –  Christian Stewart Aug 21 '13 at 17:08
add comment

Your Answer

 
discard

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.