-   Linux - General (
-   -   mounting loop device at boot? (

linus72 01-21-2011 06:41 AM

mounting loop device at boot?
hey guys
so, I'm trying to make a persistent ttylinux usb
it doesn't have persistence yet so I'm improvising:)

First, I gunzipped the ttylinux "filesys.gz", then mounted it
mkdir mnt
mount -o loop filesys mnt

then I edited /mnt/etc/fstab as so


/dev/ram0    /          ext2    defaults                    0 0
#UUID=858bbfc6-4d93-47f8-a6ad-c59e961a606d    /home      ext3    auto,user,noatime  0 0
#/dev/loop5  none      swap    defaults                    0 0 # /dev/sda_

devpts      /dev/pts  devpts  gid=5,mode=0620            0 0
tmpfs        /dev/shm  tmpfs    rw,noexec,nosuid,size=24k  0 0
proc        /proc      proc    noauto                      0 0
sysfs        /sys      sysfs    noauto                      0 0

and that works great!

However, I would really like to instead mount a ext3 file (think casper-rw) as /home at boot


UUID=858bbfc6-4d93-47f8-a6ad-c59e961a606d/ttylinux-rw    /home      ext3    loop,user,auto 0 0
but it says "no loop devices loaded"
so it's not doing "modprobe loop" or loading loop modules at startup

How do I get it to load loop at startup??

Can I edit /etc/modprobe.d/modprobe.conf?
add "modprobe loop" or what?

linus72 01-21-2011 08:29 AM


I edited /etc/fstab again and made it like this


UUID=858bbfc6-4d93-47f8-a6ad-c59e961a606d    /tmp      ext3    auto,user,noatime  0 0
/tmp/ttylinux-rw    /home      ext3    loop,user,auto,noatime 0 0

but now it doesn't auto mount /home, I have to issue "mount /home" as root after logging in

why doesn't it automount it??
it does automount UUID=858bbfc6-4d93-47f8-a6ad-c59e961a606d /tmp so why not the other??


linus72 01-21-2011 08:47 AM

I got it to automount by editing /etc/rc.d/rc.local and added

/sbin/modprobe loop

mount -a

So, now it mounts the ext3 "ttylinux-rw" 100MB file on usb as /home!

Is there a more elegant or simpler way to do this?

All times are GMT -5. The time now is 09:46 AM.