LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   SLE11 mount -o loop displays /dev/loop0 instead of iso file name (https://www.linuxquestions.org/questions/suse-opensuse-60/sle11-mount-o-loop-displays-dev-loop0-instead-of-iso-file-name-796118/)

wendycray 03-17-2010 04:19 PM

SLE11 mount -o loop displays /dev/loop0 instead of iso file name
 
I'm having a behavior change problem with mount of a loop device that is really driving me nuts.

I have an iso image I'm mounting-

# mount -o loop /root/image.iso /media/cdrom

in SLES10 (and SLES9), "mount" displays the name of the iso file:
# mount
...
/root/image.iso on /media/cdrom type iso9660 (rw,loop=/dev/loop0)

However, in SLES11, "mount" now displays the loop device rather than the filename:
# mount
...
/dev/loop0 on /media/cdrom type iso9660 (rw)

This is somewhat less than useful. Is there any way to display the filename rather than the loop device?

Simon Bridge 03-18-2010 11:27 AM

Welcome to LQ.

You are talking about this behavior:
Code:

$ sudo mount ubuntu.iso /mnt -o loop
[sudo] password for simon:
simon@indigo-prime:~/Projects$ ls /mnt
autorun.inf  dists    isolinux    pics  preseed            ubuntu
casper      install  md5sum.txt  pool  README.diskdefines  wubi.exe

$ mount
[snip]
/dev/loop0 on /mnt type iso9660

So the iso is actually mounted - you have access to the files? How is this less than useful?

Anyway, this behaviour is run by udev.

It makes sense because mount only works on block devices - eg. not isos. The mount command is correctly displaying that /dev/loop0 is what it has mounted - which is what the -o option does.

It is usually considered good practise to name the mountpoint for the iso.

mkdir /mnt/karmic-iso
sudo mount -o loop ubuntu.iso /mnt/karmic-iso

What are you trying to do that needs you to keep track of the actual filename?
Why are you logged in as root?

wendycray 03-19-2010 09:23 PM

I'm one of the developers for the install tool for Cray systems, so I'm doing a lot of things that are rather unusual for standard systems.

I'm logged in as root because I'm installing our OS, and this is one of the steps.

Yes, the iso is indeed mounted and we have access to the contents, but it's more valuable to know both the file mounted and the device (like SLES10 shows).

During my monitoring of others' install tests, a key thing to know is whether the install person actually mounted the correct iso image file. Hence, the desire to see what file is actually mounted and the appreciation of the SLES10 version of mount, which shows both the device and the file mounted.

We test many versions of our OS, so it's not practical to name a mount point for each individual iso file.

syg00 03-19-2010 09:34 PM

Things change - maybe you could just parse the output from "losetup -a".

wendycray 03-22-2010 10:20 AM

thanks - losetup -a works great for what i need.


All times are GMT -5. The time now is 03:10 AM.