Date: Wed, 09 Oct 2013 22:10:40 -0700 From: cary <cary@sdf.org> To: freebsd-questions@freebsd.org Subject: Re: mounting a .iso image? ... missing man page Message-ID: <525636D0.7020101@sdf.org> In-Reply-To: <52562AA1.4020202@dreamchaser.org> References: <52561B8E.100@dreamchaser.org> <20131010052527.56e80b94.freebsd@edvax.de> <52562AA1.4020202@dreamchaser.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <file> > >> # 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-unsubscribe@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 -- cary@sdf.org SDF Public Access UNIX System - http://sdf.org ------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?525636D0.7020101>