update-initramfs: mount/losetup are broken in initrd

maximilian attems maks at sternwelten.at
Wed Dec 20 09:51:55 UTC 2006


tags 403846 moreinfo
stop

On Wed, 20 Dec 2006, root wrote:

> my / is on sdb; sda+sdc are set up as RAID=>/dev/md0
> 
> At the moment, I boot my system on sdb; file systems of sdb have been copied
> to md0.
> 
> After booting sdb, I can run successfully:
> mount -o offset=2564014080 /dev/md0 /mnt/whatever
> 
> So, to boot and use md0 as root, I changed the boor arguments from
> /vmlinuz ro initrd=/initrd.img root=/dev/sdb3
> to
> /vmlinuz ro initrd=/initrd.img root=/dev/md0 rootflags=offset=2564014080
> 
> In short, at bot time I am said that md0 is not mountable; then, I fallback to some
> prompt.

if you report wants to be helpfull we need as much written down
from your boot process, without any error message from your side,
we have no idea what's happening on your box.

> Ther, I try to mount md0 manually, running exactly the same command:
> mount -o offset=2564014080 /dev/md0 /mnt/
> and I am said from memory "invalid argument".

the busybox mount has not the offset arg for losetup presumbably.
i have zero idea what you are trying to do,
if you want an encrypted root use luks.
cryptsetup has the relevant initramfs-tools boot scripts.
 
> After 2 weeks trying EVERY THING I could think of, I have embedded losetup
> from the main system in the ramdisk; once in the prompt, the procedure
> became:
> - losetup -o 2564014080 /dev/loop4 /dev/md0
> - /scripts/dhp/losetup -o 2564014080 /dev/loop6 /dev/md0
> - mount -o ro /dev/loop4 /root
> - mount -o ro /dev/loop6 /root
> 
> First call is using losetup from the ramdisk made by update-initramfs; the
> second one is using losetup I put in the ramdisk. 3rd call fails, 4th works.
> 
> This means losetup actually embedded in initramdisk does not support
> properly the offset option. The result is that loop device can not be set
> up, and everything fails.
> 
> I do not know if other scripts also have this failure (to assume that the
> offset option is never passed), but please, check so.
> 
> I will do more testing within days, to see if rebuilding the ramdisk
> manually and swicthing the losetup binary solves the problem; if yes, then
> other scripts are OK.

again it might be helpfull to explain what you are trying to do.
losetup is known to be flacky.

-- 
maks



More information about the pkg-mdadm-devel mailing list