Using autofs to mount your install CDs

Prompted by Kyle’s presentation at NBLUG on autofs; I decided to try my hand at it.

I figured the perfect task for autofs would be to automatically mount my install CDs when I needed them. For instance, when I want to install software; instead of physically loading the CD into the drive I can just hit “install” and magically have the software loaded and installed.

In a previous entry I showed how easy it was to store your install CDs as ISOs on your hard drive. From there all you need to do is edit a few configuration files to get autofs working for you.

First is /etc/auto.master which is the main configuration file for autofs. I altered the file so that there was only a single non-commented line:

/mnt/iso /etc/auto.iso –timeout=60 .

Now to create the file /etc/auto.iso, which I wrote to look like this:

mdkinstall_1 -fstype=iso9660,ro,loop :/iso/Mandrake-10.0-install_1.iso
mdkinstall_2 -fstype=iso9660,ro,loop :/iso/Mandrake-10.0-install_2.iso
mdkinstall_3 -fstype=iso9660,ro,loop :/iso/Mandrake-10.0-install_3.iso

Now whenever you try to navigate to either /mnt/iso/mdkinstall_1 , /mnt/iso/mdkinstall_2 , or /mnt/iso/mdkinstall_3 the images are automatically mounted for you and you can easily browse them.

In order to make this new magic usable by my software installation tool I updated my software sources to point to file://mnt/iso/mdkinstall_1/Mandrake/RPMS/ , file://mnt/iso/mdkinstall_2/Mandrake/RPMS2/ , and file://mnt/iso/mdkinstall_3/Mandrake/RPMS3 for “Installation CD 1″, “installation CD 2″, and “Installation CD 3″ respectively.

Now when I want to install software from the installation CDs I just fire up my install tool, select the software I want and go; no wasting time loading CDs into the tray, or even taking the time to mount the images anymore. Life is good.

This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

2 Responses to Using autofs to mount your install CDs

  1. Auto-mounting makes sense for removable things and perhaps network devices, but why ISOs? Why not just have them mounted at start-up and stay that way? That might even have some additional benefits– they might be indexed with locate, allowing another way to review data on them.

  2. SLX says:

    Not only removable. If someone has many possible mounts, but needed from time to time – like I – it will be unnecessary to mount all that stuff on everyday boot. It will only delay booting without benefits.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>