[Techtalk] Loop devices

Conor Daly conor.daly at oceanfree.net
Wed Dec 4 23:28:32 EST 2002


On Wed, Dec 04, 2002 at 09:03:49AM -0600 or so it is rumoured hereabouts, 
Judith Elaine Bush thought:
> On Tue, Dec 03, 2002 at 10:45:32AM +0000, Conor Daly wrote:
> > 
> > mount -o loop -t ext2 /User/blondie/TIA3/roar /TIA3-B/part2
> 
> > Sorry I didn't detail the command earlier but I've been using 
> > "mount -o loop" for years now and I'd just assumed people would know...
> 
> So i've run across this before but haven't really paid attention. Why
> DO you use mount as a loop device? I've recall one person who
> described how he was encrypting his life and it seemed he had to mount
> an encrypted file as his home directory -- would that use the loop
> device? Any other useful bits?

Oh, almost anywhere you'd be working on an image of something else:

Checking an ISO before burning it to CD.
Hacking on the LNX Bootable Business Card rescue CD.
Making a bootable rescue floppy.
Manipulating files in a floppy image. 

I used the last one recently to add support for the Intel Etherexpress NIC
to the RH7.2 bootnet.img network install floppy.  The driver for this card
comes on the "drivers" disk but I had 30 of these machines to roll out
using kickstart.

Another interesting one was when I hadn't enough room in my ext2 fs (dual
boot machine) to hold the mozilla source tree.  I tried untarring and
building it in the DOS filesystem but it wasn't happy (probably
permissions stuff).  So I did:

dd if=/dev/zero of=/mnt/dos/linux_fs.img bs=1024k count=100
	# that got me a 100Mb image
mke2fs /mnt/dos/linux_fs.img
	# said "yes" to "not a block device. Proceed?"
	# this put an ext2 fs in the image
mount -o loop /mnt/dos/linux_fs.img $HOME/mozilla_src

Bingo!  An extra 100Mb of _proper_ filesystem to do the build in...

I use it often enough that I have an entry for it in my /etc/sudoers (you
have to be root...)

Conor
-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
---------------------
Faenor.cod.ie
 10:06pm  up 29 days,  6:50,  0 users,  load average: 0.00, 0.00, 0.00
Hobbiton.cod.ie
 10:04pm  up 29 days,  6:41,  3 users,  load average: 0.00, 0.01, 0.00



More information about the Techtalk mailing list