Loop device

email.listen at googlemail.com email.listen at googlemail.com
Sun Jun 4 15:23:31 UTC 2006


Am Sun, 4. June 2006 16:33 schrieb VIGNESH:
> Hi!
>        When I try to mount a iso image I get the foll error what do I do ?
>
> root at ubuntu:~# mount ubuntu.iso mnt -o loop
> mount: could not find any free loop device
>
>
> vignesh at ubuntu:~$ sudo mount ubutu.iso mnt -o loop=/dev/loop7
> ioctl: LOOP_SET_FD: Device or resource busy
>
> This also does not work...
>
> its the same with Breezy and Warty..


From 'man mount':

SYNOPSIS
       mount [-lhV]

       mount -a [-fFnrsvw] [-t vfstype] [-O optlist]
       mount [-fnrsvw] [-o options [,...]] device | dir
       mount [-fnrsvw] [-t vfstype] [-o options] device dir

You missed the filesystem type parameter '-t' so your mount command should be:

mount  -t iso9660 -o loop ubuntu.iso mnt 

or:

mount  -t auto -o loop ubuntu.iso mnt 

(This will work on dapper after an iso has been mounted with the '-t iso9660' 
once before. see also [1])

regards,
thomas


[1] more information may be found in 'man mount' and 'man filesystems'

    Background info from man mount:
              If  no  -t  option  is  given, or if the auto type is specified,
              mount will try to guess the desired type.  If mount was compiled
              with  the  blkid  library, the guessing is done by this library.
              Otherwise, mount guesses itself by probing  the  superblock;  if
              that  does  not turn up anything that looks familiar, mount will
              try to read the file /etc/filesystems,  or,  if  that  does  not
              exist,  /proc/filesystems.   All  of the filesystem types listed
              there will be tried, except for those that are  labeled  "nodev"
              (e.g.,  devpts,  proc, nfs, and nfs4).  If /etc/filesystems ends
              in a line with a single * only, mount will  read  /proc/filesys‐
              tems afterwards.

Dapper has no '/etc/filesystems' so mount has to look at '/proc/filesystems'.
But if you do a 'cat /proc/filesystems' on a fresh booted system (no '-t 
iso9660' is used before) you will find no 'iso9660'. 
So mount will fall back on superblock probing which often don't work as 
especed, IMHO... :)

A missing /etc/filesystems causes some (weird) irritations as you saw, rarely 
but anoying for beginners...

Though 'man filesystems' says:
       When, as is customary, the proc filesystem is mounted on /proc, you can
       find  in  the  file  /proc/filesystems  which  filesystems  your kernel
       currently supports. 
Not all supported filesystems show up here. I don't exactly now why but I 
would think this is because of dynamic kernel filesystem modules which will 
be loaded only if needed.

Because of this I like to have a '/etc/filesystems' on my machines:

---8<--- /etc/filesystems ---8<---
vfat
iso9660
ntfs
hfs
minix
reiserfs
*
---8<--- ---8<--- ---8<---
(don't forget the * at the end)

Another positive effect of an /etc/filesystems as above is that fat filesystem 
medias (e.g. floppies) will be mounted as vfat first and not as fat. So you 
can use long filenames and not only 12345678.123 restricted ones. 
This because filesystems will be probed in order of appearance 
in '/etc/filesystems'.




More information about the ubuntu-users mailing list