The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   Mount ISO (http://hintsforums.macworld.com/showthread.php?t=6010)

xJay 09-28-2002 01:33 PM

Mount ISO
 
How do i mount an ISO image with 'mount_cd9660'?
It keeps complaining about proper usage.

mervTormel 09-28-2002 03:24 PM

why don't you provide some samples of what you've tried and the results?

xJay 09-28-2002 10:46 PM

[Jay:~] jay% mount_cd9660 -o loop,unhide -t iso9660 -r diskImages/linkin_park.iso mnt/linkin_park/
usage: mount_cd9660 [-egjr] [-o options] [-s startsector] special node

[Jay:~] jay% mount_cd9660 -o loop,unhide -t iso9660 diskImages/linkin_park.iso mnt/linkin_park/
usage: mount_cd9660 [-egjr] [-o options] [-s startsector] special node
[Jay:~] jay% mount_cd9660 -o loop,unhide -r diskImages/linkin_park.iso mnt/linkin_park/
usage: mount_cd9660 [-egjr] [-o options] [-s startsector] special node
[Jay:~] jay% mount_cd9660 -o loop -t iso9660 -r diskImages/linkin_park.iso mnt/linkin_park/
usage: mount_cd9660 [-egjr] [-o options] [-s startsector] special node
[Jay:~] jay% mount_cd9660 -o unhide -t iso9660 -r diskImages/linkin_park.iso mnt/linkin_park/
usage: mount_cd9660 [-egjr] [-o options] [-s startsector] special node
[Jay:~] jay% mount_cd9660 -t iso9660 -r diskImages/linkin_park.iso mnt/linkin_park/
mount_cd9660: illegal option -- t
usage: mount_cd9660 [-egjr] [-o options] [-s startsector] special node
[Jay:~] jay% mount_cd9660 diskImages/linkin_park.iso mnt/linkin_park/
mount_cd9660: Block device required

[Jay:~] jay% mount -o loop,unhide -t iso9660 -r diskImages/linkin_park.iso mnt/linkin_park/
mount: exec /usr/sbin/mount_iso9660 for /Users/jay/mnt/linkin_park: No such file or directory
[Jay:~] jay%

The file 'diskImages/linkin_park.iso' and the directory mnt/linkin_park/ exist in /Users/jay/ which was the directory i did the commands from. The last command in that list works on linux.

hayne 09-28-2002 11:15 PM

try omitting trailing slash
 
Try omitting the trailing slash on the last argument.
I.e. use mnt/linkin_park insteqad of mnt/linkin_park/

xJay 09-29-2002 01:31 AM

[Jay:~] jay% mount_cd9660 -o loop,unhide -t iso9660 -r diskImages/linkin_park.iso mnt/linkin_park
usage: mount_cd9660 [-egjr] [-o options] [-s startsector] special node
[Jay:~] jay%

hayne 09-29-2002 03:04 AM

no -t option
 
I don't see a -t option in that "usage" message, nor do I see one in the man page. Why do you think there is a -t option?

xJay 09-29-2002 03:48 PM

Check the third command in that list. I tryed it without the -t option and it still didn't work.

blb 09-29-2002 04:32 PM

The error Block device required is one of the more important ones here; mount requires a block device (eg, /dev/disk2), not a file. I'm guessing you want to mount the image, but not under /Volumes, as Disk Copy could do that quite simply. If you want to customize where it mounts, this should work (at least on 10.1.x):
Code:

hdid -nomount /path/to/linkin_park.iso
This will create an hdid process which maps your image to a /dev entry. When this is run, it should output which device it created. You then use that with mount (or mount_cd9660):
Code:

mount -t cd9660 /dev/disk2 /path/to/mnt/linkin_park
You don't need the -t option to any mount_ commands, as the base mount uses that option to know which to really run (eg, mount -t cd9660 will run mount_cd9660).

xJay 09-29-2002 08:55 PM

[Jay:~] jay% hdid -nomount diskImages/linkin_park.iso
/dev/disk2
[Jay:~] jay% mount -t cd9600 /dev/disk2 mnt/linkin_park/
mount: exec /usr/sbin/mount_cd9600 for /Users/jay/mnt/linkin_park: No such file or directory
[Jay:~] jay% ls mnt/linkin_park/
[Jay:~] jay%

That doesn't work either.
Do i need to be root?

hayne 09-29-2002 10:43 PM

try omitting trailing slash
 
Quote:

Originally posted by xJay
[Jay:~] jay% mount -t cd9600 /dev/disk2 mnt/linkin_park/
Try again without the trailing slash. I don't know if this is causing the problem but it might well be. Don't put it there unless you know you need it. (Probably it is filename completion on tcsh that is adding this - so delete it before you press return.)

blb 09-29-2002 11:33 PM

Quote:

Originally posted by xJay
...
[Jay:~] jay% mount -t cd9600 /dev/disk2 mnt/linkin_park/
mount: exec /usr/sbin/mount_cd9600 for /Users/jay/mnt/linkin_park: No such file or directory
...
That doesn't work either.
Do i need to be root?
A little typo there, try -t cd9660. Note how it complains from exec, namely, it can't find mount_cd9600, since it doesn't exist...gotta love those subtle error messages (and, for that matter, errors).

xJay 09-30-2002 09:00 AM

[Jay:~] jay% mount -t cd9660 /dev/disk2 mnt/linkin_park
/sbin/mount_cd9660: Invalid argument
[Jay:~]

hayne 09-30-2002 10:25 AM

try it with sudo
 
Try using 'sudo' when you do the mount command.
I suspect that the "Invalid argument" was a spurious error message and the problem might really be that you need admin privileges.

So try:
sudo mount -t cd9660 /dev/disk2 mnt/linkin_park

(added afterwards: )
I just went and looked at the Darwin source for the mount command. The error message seems to be due to a failure of the 'mount' system call.
man 2 mount
tells me that you can get an "Invalid argument" error [EINVAL] if there is a non-standard character in the 'node' filepath or if the filesystem's super block has a bad magic number or an out of range block size.

xJay 09-30-2002 11:09 AM

[Jay:~] jay% sudo mount_cd9660 /dev/disk2 mnt/lp
Password:
mount_cd9660: Invalid argument
[Jay:~] jay%

hayne 09-30-2002 11:22 AM

check the ISO file is good
 
Before going too much further, you should check that the ISO file is good by burning it to a CD and then letting the Finder mount it in the usual way.

Or, if you want to avoid burning a CD, you probably can make a disk image out of it by using the Disk Copy utility.

mervTormel 09-30-2002 11:30 AM

how about throwing some diag options in there?
Code:

    -d      Causes everything to be done except for the actual system call.
            This option is useful in conjunction with the -v flag to deter-
            mine what the mount command is trying to do.

    -v      Verbose mode.

and reducing the form to:
Code:

% sudo mount -dv -t cd9660
and show us your device table:
Code:

% df
Filesystem          1k-blocks      Used Available Use% Mounted on
/dev/disk1s9          7326256  2153740  5099256  30% /
devfs                        1        1        0 100% /dev
fdesc                        1        1        0 100% /dev
<volfs>                    512      512        0 100% /.vol
/dev/disk1s10          7326256  3439436  3886820  47% /Volumes/banshee
...


xJay 09-30-2002 06:43 PM

[Jay:~] jay% sudo mount -dv -t cd9660 diskImages/linkin_park.iso mnt/linkin_park/
Password:
exec: mount_cd9660 diskImages/linkin_park.iso /Users/jay/mnt/linkin_park
[Jay:~] jay% ls mnt/linkin_park/
[Jay:~] jay%

[Jay:~] jay% df
Filesystem 512-blocks Used Avail Capacity Mounted on
/dev/disk0s5 120093120 27112784 92468336 22% /
devfs 181 181 0 100% /dev
fdesc 2 2 0 100% /dev
<volfs> 1024 1024 0 100% /.vol
automount -fstab [334] 0 0 0 100% /Network/Servers
automount -static [334] 0 0 0 100% /automount
[Jay:~] jay%

Quote:

Before going too much further, you should check that the ISO file is good by burning it to a CD and then letting the Finder mount it in the usual way.
The whole point of this is to see if the image is okay before i waste a cd trying to burn it. Also, i haven't figured out how to use the cd burner yet, and i might have to give the disks back before i can figure out how to burn an ISO. I did check sum the images and they were okay.

Quote:

Or, if you want to avoid burning a CD, you probably can make a disk image out of it by using the Disk Copy utility.
I'll try that now, but i do prefer ISOs since they are exact copies of the disk. How does a dmg differ from an iso anyway?

xJay 09-30-2002 06:58 PM

The disk copy utility won't copy from my CD-ROM so i made it copy from /dev/disk2 which was created when i did 'hdid diskImages/linkin_park.iso'. When i asked disk copy to mount the .dmg it made it said "'lpdmg.dmg' failed to mount due to error 95. (no mountable file systems)"

In linux this is so simple.

# dd if=/dev/scd0 of=diskImage.iso
# mount -o loop,unhide -t iso9660 -r diskImage.iso /mnt/p1/

Unfortunatly my linux box is messed up and it refuses to do anything now.

hayne 10-01-2002 12:30 AM

checksum
 
Could you please verify the checksum again?
I read something on a MkLinux page which seems strange but they said that attempting to mount an ISO might modify the file.

xJay 10-01-2002 11:42 AM

[Jay:~] jay% cksum diskImages/linkin_park.iso
2707754099 400627920 diskImages/linkin_park.iso
[Jay:~] jay% cksum /dev/disk1
2707754099 400627920 /dev/disk1
[Jay:~] jay%

its still good

MasterUltan 10-02-2002 10:24 AM

You can mount it with hdiutil
 
I had this problem with a udf image I was playing with (that I'd made with a recent beta of mkisofs). hdiutil, for some reason, is picky about the file extension. It wouldn't have anything to do with my image *.udf, however, when I changed it to *.dmg (just a name change, nothing else) it mounted the image fine with the command:

hdiutil attach *.dmg

btw, after some experimentation, I was able to mount the image using the hdid -nomount *.img command followed by the mount command only after I'd created a directory which shared the volume name of the image being mounted. This doesn't seem terribly useful, but there you have it.

xJay 10-02-2002 12:12 PM

how did you mount the ISO using the mount command?

MasterUltan 10-02-2002 08:59 PM

well it worked this morning :(
 
So I had a UDF image lying around whose volume name was 'REVOLUTION_OS'. I assigned it a block device like so:

hdid -nomount RevOS.img

Then I made a directory:

mkdir /Volumes/REVOLUTION_OS

Then I issued the mount command:

mount -t udf /dev/disk2 /Volumes/REVOLUTION_OS

et voila! it mounted.

That, however, was this morning. The algorithm doesn't seem to work now.

btw, I tested this out also by making an iso9660 with mkisofs called downloads.iso. hdiutil would mount it fine with the command:

hdiutil attach downloads.iso

However, a similar algorithm to the above doesn't seem to work.


All times are GMT -5. The time now is 06:12 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.