Jay Sprenkle wrote:

On 9/28/05, Dennis Jenkins <[EMAIL PROTECTED]> wrote:
Your third statement is not true. On Linux (and FreeBSD, but FreeBSD
does not have Reiser as far as I know) you can treat a regular file as
if it were a filesystem and mount that fiel system via the "loop back"
device. You can mount an ISO image file as an actual CD, for instance.


Cool! Thanks for letting us know :)

I should have mentioned the obvious though... the file must be an image of a valid file system.

for example, the following will fail:

dd if=/dev/zero of=file bs=4096 count=1024
losetup /dev/loop0 file
mount /dev/loop0 /mnt/xxx

However, the following should work:
dd if=/dev/zero of=file bs=4096 count=1024
losetup /dev/loop0 file
mke2fs /dev/loop0
mount /dev/loop0 /mnt/xxx


You can even encrypt the entire filesystem over loop back:
dd if=/dev/zero of=blob bs=1M count=1024
losetup -e AES256 /dev/loop0 blob
mke3fs /dev/loop0 blob
mount /dev/loop0 /mnt/crypto

as usual, do a "man" on "losetup". This is from my Gentoo 2005.1 Linux system (home) with whatever packages it installed a few days ago. At work I use FreeBSD and I've not used loopback devices there, but the FreeBSD Handbook (online for free) shows how to do it.


Reply via email to