[BusyBox] losetup applet

Magnus Damm damm at opensource.se
Tue Mar 13 13:54:53 UTC 2001


> > Is there any reason for not having a "losetup" applet in BusyBox?
> You dont actually need losetup unless you want encryption.
> 
> e.g.
> 
> dd if=/dev/zero of=loopfs bs=1k count=1000
> mkfs.ext2 -F loopfs
> mount -o loop loopfs /mnt

Yes, I've never used "losetup" before, I've always mounted with "-o
loop"..
But now when I want to use my ROOT filesystem on the loopdevice..

The "Loopback Root Filesystem HOWTO" has a sample "/linuxrc"-file:

#!/bin/sh

echo INITRD: Trying to mount /dev/hda1 as msdos

if /bin/mount -n -t msdos /dev/hda1 /mnt; then

   echo INITRD: Mounted OK
   /bin/losetup /dev/loop0 /mnt/linux/linuxdsk.img
   /bin/losetup /dev/loop1 /mnt/linux/linuxswp.img
   exit 0

else

   echo INITRD: Mount failed
   exit 1

fi

The "/linuxrc"-file seems to use losetup to connect
loop0 to a fileimage and return 0 to let the kernel 
mount the ROOT...

Do you know any way to do this w/o "losetup" ?

Thanks /

Magnus





More information about the busybox mailing list