Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Control mounting via FSTAB' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Control mounting via FSTAB
Authored by: alset on Jul 16, '07 08:49:22AM
I wrote this as a reminder to myself when I learned how to configure FSTAB to prevent my backup drives from mounting on each login. I figured it would be relevant here.

Editing fstab research and success.

Disambiguation:

The Universally Unique ID is a 16 character alphanumeric string identifying a disk, hereafter seen as FFFF.
vi requires pressing "i" to enter Input Mode, "esc" to return to Command Mode
vi uses additional controls to write files: :w = write; :q = quit vi; :q! = quit without saving


Steps:
1. Obtain UUID of device
2. Write and save fstab file in /etc/
3. Reboot.


Step 1: obtaining the UUID
There are two methods I have learned to obtain the UUID of a device:

1. Connect the device while monitoring the System Logs in Console.
2a. From the command line, run diskutil list to get the slice number of the volume (disk#s#)
2b. From the command line, run diskutil info deviceid.


Step 2: Creating the fstab file
Create the fstab file in /private/etc/ using vi with root privileges (can't save w/out root)

sudo vi /private/etc/fstab

enter the following:

UUID=FFFF /mount-point device-type options


Disambiguation:

The mount-point is the location where the drive should appear (I chose /Volumes).
The device-type will be hfs for Mac drives, other for windrives, etc.
The options field is comma separated; rw = Read / Write; noauto = No auto-mount

So, the final text entry was:
UUID=FFFF /Volumes hfs rw,noauto

A real world example might look like this:
UUID=138AAB6E-3D84-3754-8FBF-ECC91BB9940F none hfs rw,noauto 0 0


Step 3: Reboot and test.


Further Notes:

When formatting the order of the string in the fstab file I combined examples found in two sources:
1. fstab man page
2. Comments following this hint: http://www.macosxhints.com/article.php?story=20030227194830916

After rebooting the drive does not auto mount, but can be seen in Disk Utility. Disconnecting the FW cable and reconnecting shows the volume become unavailable in Disk Utility and then available, again without mounting.

It has been my experience that SuperDuper! will find the drive and mount them for scheduled backup without issue. I have not tested this hint with Carbon Copy Cloner or other backup apps. YMMV.

---
standing on the shoulders of giants

[ Reply to This | # ]

Control mounting via FSTAB
Authored by: agnaL on Dec 11, '07 01:04:03AM

It seems that using /etc/fstab to mount firewire drives using UUIDs does not work anymore in Leopard (10.5). I used it on Tiger to mount external firewire drives at boot time, but now on Leopard it's broken (or not supported anymore).

One workaround could be to install the above shell script as a startup item. I'm going to give this a shot.

Is system_profiler able to display info for USB drives too?



[ Reply to This | # ]
Control mounting via FSTAB
Authored by: agnaL on Jan 04, '08 03:10:54PM

Yes the script is also able to mount USB drives. Just replace
SPFireWireDataType with SPUSBDataType.

There is one drawback to using this script over the previously working /etc/fstab entry on OSX 10.4 Tiger: On OSX 10.5 Leopard the Finder seems to unmount these drives during logout.

Does anyone know a way to prevent the Finder from ejecting the drives?



[ Reply to This | # ]