From owner-freebsd-questions@FreeBSD.ORG Thu Mar 24 16:28:04 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D67F21065672 for ; Thu, 24 Mar 2011 16:28:04 +0000 (UTC) (envelope-from four.harrisons@googlemail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 696C78FC21 for ; Thu, 24 Mar 2011 16:28:04 +0000 (UTC) Received: by eyg7 with SMTP id 7so104629eyg.13 for ; Thu, 24 Mar 2011 09:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:message-id:subject:from:to:cc:date:mime-version :content-type:content-transfer-encoding; bh=YfqnnHOtRnoasxh2w0GD089aeo1eKs4qHZZ6XQNwZrA=; b=SqT+MshDBEG5nS31ew3M0mfQQq9ay4LhOADWgeDB057+kir5F97Eh4R2Q8V6Mb2nhT 7Ewen3MBX4cRXH3FybH2uQE+KHLIfBtH0w64uU6MvC4Ff6cEjAHzXof+lsvk6PZVSsaV 8HBy2nrg/GQFzs09Wd7cEb2wORqldOGzYqzBg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:subject:from:to:cc:date:mime-version:content-type :content-transfer-encoding; b=EoiZ+c5e5ioa/9R9qvdOmvy+rUXDsLjgyUCix5Amf66aQ4KCUjZw3rPjFdPDAJ/D1n dj5YRJh0P6BK4RpswX9YfOewg62ITO1I8SUH8r7/mKwODUxXc7dOfYR7S5AnS3qdVUZU 6sDLnk3liS1AWI4gPC05ekEdGJUuLV/RF5cwM= Received: by 10.223.98.141 with SMTP id q13mr371298fan.96.1300984083348; Thu, 24 Mar 2011 09:28:03 -0700 (PDT) Received: from ecs ([213.8.162.222]) by mx.google.com with ESMTPS id o17sm35451fal.25.2011.03.24.09.28.01 (version=SSLv3 cipher=OTHER); Thu, 24 Mar 2011 09:28:02 -0700 (PDT) Message-ID: <4d8b7112.9155df0a.0c42.049b@mx.google.com> From: four.harrisons@googlemail.com To: editor@d3photography.com Date: Wed, 23 Mar 2011 19:48:49 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: Automating mounting of ISO images X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 16:28:05 -0000 -----BEGIN PGP SIGNED MESSAGE-----=0D=0AHash: SHA1=0D=0A=0D=0AOn 3/23/11 = 2:49 PM, Ryan Coleman wrote:=0D=0A> I have a folder full of ISOs that we'= re sharing on the network instead of having the discs available (seems li= ke a good idea, right?)=0D=0A>=20=0D=0A> But I want to automate the proce= ss on boot instead of having to write a static script to do the work.=0D= =0A>=20=0D=0A> Disc images are located in /mount/disc_images/ (all are IS= Os)=0D=0A> They need to mount into /mount/office_files/images/FILENAME [w= ithout the .iso extension]=0D=0A>=20=0D=0A> How can I do this? I've alway= s been given these types of scripts in the past at an old job but I don't= have access to those examples anymore.=0D=0A=0D=0AHi Ryan,=0D=0A=0D=0AYo= u can put something like this in /etc/rc.conf to get the device files=0D=0A= created automatically:=0D=0A=0D=0Amdconfig_md0=3D"-t vnode -f /mount/disc= _images/Image1.iso"=0D=0Amdconfig_md1=3D"-t vnode -f /mount/disc_images/I= mage2.iso"=0D=0Amdconfig_md2=3D"-t vnode -f /mount/disc_images/Image3.iso= "=0D=0A=0D=0ABecause these devices (/dev/md0, /dev/md1, /dev/md2) will be= created=0D=0Abefore /etc/fstab is processed, you can then add the follow= ing entries=0D=0Ain that file:=0D=0A=0D=0A/dev/md0 /mount/office_files= /images/Image1 cd9660 ro 0 0=0D=0A/dev/md1 /mount/office_f= iles/images/Image2 cd9660 ro 0 0=0D=0A/dev/md2 /mount/offi= ce_files/images/Image3 cd9660 ro 0 0=0D=0A=0D=0ACheck out the= rc(8) man page (http://bit.ly/fuwn5n) for more information=0D=0Aabout ho= w the startup scripts work, as well as the one that processes=0D=0Athe de= vice creation directives above - /etc/rc.d/mdconfig=0D=0A=0D=0AFinally, y= ou can always add your own custom startup scripts to=0D=0A/usr/local/etc/= rc.d if you need to do something that the standard=0D=0Astartup scripts c= an't handle.=0D=0A=0D=0AHope that helps,=0D=0AGreg=0D=0A- --=20=0D=0AGreg= Larkin=0D=0A=0D=0Ahttp://www.FreeBSD.org/ - The Power To Serve= =0D=0Ahttp://www.sourcehosting.net/ - Ready. Set. Code.=0D=0Ahttp://t= witter.com/sourcehosting/ - Follow me, follow you=0D=0A-----BEGIN PGP SIG= NATURE-----=0D=0AVersion: GnuPG v1.4.11 (Darwin)=0D=0AComment: Using GnuP= G with Mozilla - http://enigmail.mozdev.org/=0D=0A=0D=0AiEYEARECAAYFAk2KT= n4ACgkQ0sRouByUApCAiwCfZzO8jnaKIFxuOoZotU8Ac49I=0D=0AMMIAni1KMFDqLe1YeMaS= /LZUsgrV1PfY=0D=0A=3DJUk3=0D=0A-----END PGP SIGNATURE-----=0D=0A_________= ______________________________________=0D=0Afreebsd-questions@freebsd.org= mailing list=0D=0Ahttp://lists.freebsd.org/mailman/listinfo/freebsd-ques= tions=0D=0ATo unsubscribe, send any mail to "freebsd-questions-unsubscrib= e@freebsd.org"=0D=0A