From owner-freebsd-questions@FreeBSD.ORG Mon Jan 17 11:00:36 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 995A716A4D3 for ; Mon, 17 Jan 2005 11:00:36 +0000 (GMT) Received: from szamoca.krvarr.bc.ca (s142-179-111-232.bc.hsia.telus.net [142.179.111.232]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0AE5243D46 for ; Mon, 17 Jan 2005 11:00:34 +0000 (GMT) (envelope-from sandy@krvarr.bc.ca) Received: from szamoca.krvarr.bc.ca (localhost [127.0.0.1]) by szamoca.krvarr.bc.ca (8.13.1/8.12.11) with ESMTP id j0HB0Vdu030519; Mon, 17 Jan 2005 03:00:31 -0800 (PST) (envelope-from sandy@szamoca.krvarr.bc.ca) Received: (from sandy@localhost) by szamoca.krvarr.bc.ca (8.13.1/8.12.11/Submit) id j0HB0Q3C030516; Mon, 17 Jan 2005 03:00:26 -0800 (PST) (envelope-from sandy) From: Sandy Rutherford MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16875.39625.182375.873896@szamoca.krvarr.bc.ca> Date: Mon, 17 Jan 2005 03:00:25 -0800 To: Vulpes Velox In-Reply-To: <20050115152058.0c3024b0@vixen42.local.lan> References: <1105761003.669.17.camel@owl2> <41E8F9EA.2030900@orchid.homeunix.org> <41E90D40.70000@zonnet.nl> <20050115152058.0c3024b0@vixen42.local.lan> X-Mailer: VM 7.07 under Emacs 21.3.1 cc: Frank Staals cc: freebsd@orchid.homeunix.org cc: freebsd-questions@freebsd.org cc: Sergei Gnezdov Subject: Re: Software mirgration from Windows for my friend X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2005 11:00:36 -0000 >>>>> On Sat, 15 Jan 2005 15:20:58 -0600, >>>>> Vulpes Velox said: >> Virtual CD is a program to mount iso images if I'm correct ( just >> like alcohol or deamontools ) you can just mount .iso files with >> FreeBSD : man mount_cd9660 > Last I checked, it required a bit more... you have to use mdconfig to > create a device entry in /dev for the file so you can point mount at > it. Yes, this is true. Sergei, this should do the job for you and your friend. I have only used this up to FreeBSD 4.10. Therefore, if vnode support is different in 5.x, it may need some updating. To install, just put the script anywhere in your path. umount_iso should be a link (soft or hard) to mount_iso. It looks at how it was called to decide what to do. I also suggest that you sudo it, so you do not need to be root to run it. BTW, this comes with the usual disclaimer. Should it thrash your file system, cause your computer to explode, whatever, I am not liable. However, if anybody hits any bugs in this, I would greatly appreciate hearing about them. ...Sandy ---------------------------------------------------------------------- #!/bin/sh # # File: mount_iso # Description: Mounts an iso image file onto a mount point for previewing. # Usage: mount_iso iso_file mount_point # or umount_iso mount_point ################################################################### # Works with FreeBSD, Linux and Solaris. Should work with other BSDs # too, as long as they have vnode support. # # For FreeBSD, the kernel needs to have vnode support compiled in. # See "man vn". # # For Solaris pre version 8, lofiadm does not exist. # You need to install the fbk driver and modify the script to use it. #################################################################### # Installation: Put this script somewhere in your path and make a hard link # to it called umount_iso. #################################################################### # Author: Sandy Rutherford # Created: Thu Dec 5 16:38:43 2002 by sandy on szamoca.uphill.bc.ca # Modified: Thu Dec 5 19:42:43 2002 by sandy on goethe # Mon Jan 17 01:58:52 2005 by sandy on goethe #################################################################### if [ -z "$OSTYPE" ] then # Get the OS type come hell or high water. OSTYPE=`/bin/uname 2>/dev/null || /sbin/uname 2>/dev/null || \ /usr/bin/uname 2>/dev/null || /usr/sbin/uname 2>/devnull || \ uname 2>/dev/null || \ echo "Cannot determine operating system. Bailing out." 1>&2 ; exit 1` fi case $OSTYPE in *[Bb][Ss][Dd]*) case $0 in *umount_iso) # Find the device file. dev=`/sbin/mount | awk "\\$3 == \"$1\" {print \\$1}"` /sbin/umount $1 /usr/sbin/vnconfig -u $dev ;; *) # Find a free vn device. Note that this assumes that # the device file exists in /dev. If not, you must create it. n=0 while /sbin/mount | grep -q "^/dev/vn$n" do n=`expr $n + 1` done /usr/sbin/vnconfig /dev/vn${n}c $1 if [ $? != 0 ] then echo "Could not configure /dev/vn${n}c. Does the device file exist?" 1>&2 exit 1 fi /sbin/mount_cd9660 -o rdonly /dev/vn${n}c $2 ;; esac ;; *[Ll][Ii][Nn][Uu][Xx]*) case $0 in *umount_iso) /bin/umount $1 ;; *) mount $1 -r -t iso9660 -o loop $2 ;; esac ;; *[Ss][Uu][Nn][Oo][Ss]*|*[Ss][Oo][Ll][Aa][Rr][Ii][Ss]*) case $0 in *umount_iso) dev=`/usr/sbin/mount | awk "\\$1 == \"$1\" {print \\$3}"` /usr/sbin/umount $1 /usr/sbin/lofiadm -d $dev ;; *) dev=`/usr/sbin/lofiadm -a $1` /usr/sbin/mount -F hsfs -o ro $dev $2 ;; esac ;; *) echo "Do not know how to mount an iso image for operating system $OSTYPE." 1>&2 exit 1 ;; esac