Re: mounting a .iso image? ... missing man page

2013-10-09 Thread cary
Gary Aitken wrote:
> On 10/09/13 21:25, Polytropon wrote:
>> On Wed, 09 Oct 2013 21:14:22 -0600, Gary Aitken wrote:
>>> Seems like it must be possible to mount a cd9660 image somehow without
>>> burning an actual disc?
>>
>> Of course. :-)
> 
> I guess knowing it's possible is a start;
> couldn't figure out where to look to get the magic combination.
> 
>> It is possible by using a virtual node "connected" to the
>> ISO file. Without having tested, according to your example:
>>
>>  # mdconfig -u 0 -t vnode -f 
>> /hd1/Downloads/FreeBSD/9_1/FreeBSD-9.1-RELEASE-amd64-disc1.iso
> 
> for the record, that's:
>   mdconfig -a -t vnode -u 0 -f 
> 
>>  # mount -o ro -t cd9660 /dev/md0 /mnt/tmp
>>  ... do stuff ...
>>  # umount /mnt/tmp
>>  # mdconfig -u 0 -d
> 
> and that one is
>   mdconfig -d -u 0
> 
> order appears to be important
> 
> Thanks again,
> 
> Gary
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
> 
> 


To avoid having to recall the arguments for mdconfig(8):


#/bin/sh
#start_isofs
#two commands to attach and mount or umount file.iso
#
isofs_stop() {
(umount -f /mnt &&
mdconfig -d -u $NUM)
}
NUM=3

DEV="/dev/md${NUM}"
IMGFS=$1
case $2 in
"start")
# first check whether target mount point is in use
if mount | grep -q "/mnt"; then
printf "Exiting: mount point '/mnt' currently unavailable.\n"
exit 1
fi
(mdconfig -a -t vnode -f "$IMGFS" -u $NUM &&
mount -o ro -t cd9660 $DEV /mnt) ;;
"stop")
isofs_stop ;;
*)
if [ "$IMGFS" = "stop" ]; then
isofs_stop
else
your_script="$(basename $0)"
printf "Usage: %s [isofile] start|stop\n" $your_script
fi
;;
esac
exit


-- 
c...@sdf.org
SDF Public Access UNIX System - http://sdf.org


--
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: mounting a .iso image? ... missing man page

2013-10-09 Thread Polytropon
On Wed, 09 Oct 2013 22:18:41 -0600, Gary Aitken wrote:
> for the record, that's:
>   mdconfig -a -t vnode -u 0 -f 

Correct, I noticed too late that -a was missing. But "man mdconfig"
mentions all parts that are needed. :-)



> > # mount -o ro -t cd9660 /dev/md0 /mnt/tmp
> > ... do stuff ...
> > # umount /mnt/tmp
> > # mdconfig -u 0 -d
> 
> and that one is
>   mdconfig -d -u 0
> 
> order appears to be important

The manpage doesn't seem to explicitely mention this, but if
I remember correctly, it actually matters, as you said.

By the way, the manpage mentions

mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt

as an interesting construction in the EXAMPLES section. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: mounting a .iso image? ... missing man page

2013-10-09 Thread Gary Aitken
On 10/09/13 21:25, Polytropon wrote:
> On Wed, 09 Oct 2013 21:14:22 -0600, Gary Aitken wrote:
>> Seems like it must be possible to mount a cd9660 image somehow without
>> burning an actual disc?
> 
> Of course. :-)

I guess knowing it's possible is a start;
couldn't figure out where to look to get the magic combination.

> It is possible by using a virtual node "connected" to the
> ISO file. Without having tested, according to your example:
> 
>   # mdconfig -u 0 -t vnode -f 
> /hd1/Downloads/FreeBSD/9_1/FreeBSD-9.1-RELEASE-amd64-disc1.iso

for the record, that's:
  mdconfig -a -t vnode -u 0 -f 

>   # mount -o ro -t cd9660 /dev/md0 /mnt/tmp
>   ... do stuff ...
>   # umount /mnt/tmp
>   # mdconfig -u 0 -d

and that one is
  mdconfig -d -u 0

order appears to be important

Thanks again,

Gary
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: mounting a .iso image? ... missing man page

2013-10-09 Thread Polytropon
On Wed, 09 Oct 2013 21:14:22 -0600, Gary Aitken wrote:
> Seems like it must be possible to mount a cd9660 image somehow without
> burning an actual disc?

Of course. :-)

It is possible by using a virtual node "connected" to the
ISO file. Without having tested, according to your example:

# mdconfig -u 0 -t vnode -f 
/hd1/Downloads/FreeBSD/9_1/FreeBSD-9.1-RELEASE-amd64-disc1.iso
# mount -o ro -t cd9660 /dev/md0 /mnt/tmp
... do stuff ...
# umount /mnt/tmp
# mdconfig -u 0 -d

An alternative would be to use tar to extract the files from
the image, change whatever you want, and use mkisofs afterwards
to rebuild the (new) image, in case you want to modify its
content.

-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: mounting a .iso image? ... missing man page

2013-10-09 Thread dweimer

On 10/09/2013 10:14 pm, Gary Aitken wrote:
For some strange reason, my 9.1 system seems to be missing the section 
1

man page for tar, although everything else seems to be there.

I have an iso9660 image of 9.1 release which I tried to mount to copy
the missing file, but that didn't work (can't find the CD I burned...).

#mount -t cd9660 -o ro FreeBSD-9.1-RELEASE-amd64-disc1.iso /mnt/tmp
mount_cd9660:
/hd1/Downloads/FreeBSD/9_1/FreeBSD-9.1-RELEASE-amd64-disc1.iso: Block
device required

Seems like it must be possible to mount a cd9660 image somehow without
burning an actual disc?

Gary
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
"freebsd-questions-unsubscr...@freebsd.org"


mdconfig -a -t vnode -f /path/to/file.iso

this will create a /dev/md# where # starts at 0 for first one

mount it with

mount -t cd9660 -o ro /dev/md# /mnt



--
Thanks,
   Dean E. Weimer
   http://www.dweimer.net/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"