Loopback devices

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
jinksys

Loopback devices

Post by jinksys »

Im wanting to use a floppy image in place of using the actual floppy drive since images are much
faster and wont kill my drive when testing my kernel with bochs.
I create the image:

$ dd if=/dev/fd1 of=floppy.img

mount it:

$ mount -t msdos floppy.img /media/floppyimage -o loop

everything goes fine, I can do a `ls /media/floppyimage`
and see the contents of the image. My problem is that I
must be root to delete, move, etc files in the mountpoint.
How can I mount a floppy image so that normal users can
write/read ?
Dreamsmith

Re:Loopback devices

Post by Dreamsmith »

Try something like:

Code: Select all

sudo mount disk.img mnt/dir -t vfat -o loop,uid=1000,gid=1000,umask=027
Replace 1000 with your actual UID and GID, and specify the correct paths, of course...
jinksys

Re:Loopback devices

Post by jinksys »

thanks
northfuse

Re:Loopback devices

Post by northfuse »

you could also add an entry to your /etc/fstab file:

/.../disk.img /.../mnt/dir vfat loop,user,noauto 0 0

this is what i do and it seems to work well :) Remember that /etc/fstab requires absolute paths. This way you can just cd into the directory, type mount disk.img, and its mounted! i find it realy easy
Post Reply