Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 4, 2006, 04:15 PM   #1
TypeR389
macrumors member
 
Join Date: Apr 2002
Location: Seattle
Send a message via AIM to TypeR389 Send a message via Yahoo to TypeR389
managing external drive mount points

Hi, I am trying to manage my multiple external firewire drives to not automount on the desktop when they are attached, but rather to force them to mount at an arbitrary folder location. I cannot seem to find a way to do this via the gui, can this be done by making some entries in my fstab file? I know how to do this on a linux machine, but is there a better way to do this in 10.4?
TypeR389 is offline   0 Reply With Quote
Old Jan 4, 2006, 04:39 PM   #2
belvdr
macrumors 68040
 
Join Date: Aug 2005
The problem with fstab is the device name, say if a device is connected later.

Any volume is mounted under /Volumes. So why not create a symlink from your location to /Volumes/<volume_name>. It would have the same effect.
belvdr is offline   0 Reply With Quote
Old Jan 4, 2006, 05:12 PM   #3
mrichmon
macrumors 6502a
 
Join Date: Jun 2003
Quote:
Originally Posted by TypeR389
Hi, I am trying to manage my multiple external firewire drives to not automount on the desktop when they are attached, but rather to force them to mount at an arbitrary folder location. I cannot seem to find a way to do this via the gui, can this be done by making some entries in my fstab file? I know how to do this on a linux machine, but is there a better way to do this in 10.4?
You need to do two things:
  1. create an fstab entry, and
  2. set the automounter to run during system boot.

Set up fstab
The OS X fstab entry is almost identical to the linux fstab format. However, since you are talking about external drives then you need to use a unique identifier to identify the drive rather than the device id. The problem with using the device id (eg. /dev/disk2) is that any changes in the connected devices (adding or removing an external drive, adding a hub, etc) can change the order in which the devices are enumerated and thus changing the device id (eg. from /dev/disk2 to /dev/disk3 if you add a new drive).

An OS X fstab should look like:
Code:
#                                                               Fsck Pass Number
#                                                                           |
#                                                                Dump Flag  |
#                                                                       |   |
#                                                        Mount Options  |   |
#                                                               |       |   |
#                                                  Filesystem   |       |   |
#                                                       |       |       |   |
#                                         Mount Point   |       |       |   |
#    Filesystem Identifer from diskutil         |       |       |       |   |
#         |                                     |       |       |       |   |
UUID=4236231D-1117-333F-8899-3235F9B8000E       none    hfs     rw,auto 1   2
Where the fields in order are:
  1. first field is the unique device id,
  2. second field is the mount point. That is, where you want the device to mount such as /mounts/mydisk -- in this case "none" is specified with causes the drive to default to the /Volumes/<filesystem name> mount point,
  3. third field is the filesystem type,
  4. fourth field is the mount options,
  5. fifth field is the dump flag, and
  6. sixth field is the fsck pass number.

To find the UUID for a particular drive you should open the terminal and run mount without any arguments to list the mounted filesystems and identify the device node for your external drive. The device node will be something like /dev/disk1s3. Ensure that the device you identify is for your external drive and not your internal drives. Now, using the device node you found, run the command diskutil info <device node> to obtain the UUID. For example, if your device node is /dev/disk1s3 then you run the command diskutil info /dev/disk1s3. In the list of information printed you will see a long UUID string. This is the UUID you need to use in your fstab file instead of the traditional device node entry.

Setting up a /etc/fstab file will ensure that drives will mount with your specified options when they are automounted. But an additional step must be performed to ensure that the automounter mounts the drives when the system boots.

Set automounter to run
Under OS X by default, external drives are only mounted when a user logs into the system on the console. Other systems such as linux and Solaris typically mount drives during system boot. This means that if you ssh into OS X then your external drives will not be mounted until someone logs into the console.

To change this default behavior you need to set a property on the system to ensure that the automounter runs when the system boots. To do so, open a terminal window and run the following command:

Code:
sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisks
mrichmon is offline   0 Reply With Quote
Old Jan 4, 2006, 06:31 PM   #4
belvdr
macrumors 68040
 
Join Date: Aug 2005
Man, OS X makes things too difficult sometimes.
belvdr is offline   0 Reply With Quote
Old Jan 4, 2006, 06:40 PM   #5
mrichmon
macrumors 6502a
 
Join Date: Jun 2003
Quote:
Originally Posted by belvdr
Man, OS X makes things too difficult sometimes.
In reality the only difference in OS X compared to other Unix machines is the use of the UUID and that the automounter does not run at boot by default.

My post was long because it took me a while to iron out how to control drive mounting under OS X for my MacMini home server. Once I got it working I wrote myself a howto so I didn't forget the details. I just cut and pasted most of the howto into the post above since I know those instructions work.
mrichmon is offline   0 Reply With Quote
Old Jan 4, 2006, 07:48 PM   #6
belvdr
macrumors 68040
 
Join Date: Aug 2005
Quote:
Originally Posted by mrichmon
In reality the only difference in OS X compared to other Unix machines is the use of the UUID and that the automounter does not run at boot by default.

My post was long because it took me a while to iron out how to control drive mounting under OS X for my MacMini home server. Once I got it working I wrote myself a howto so I didn't forget the details. I just cut and pasted most of the howto into the post above since I know those instructions work.
Yeah, and the UUID is the pain. Shame you can't just label the thing as you would do in HP-UX or Solaris, or even Linux. The reality is the UUID just gets in the way sometimes.
belvdr is offline   0 Reply With Quote
Old Jan 4, 2006, 08:04 PM   #7
mrichmon
macrumors 6502a
 
Join Date: Jun 2003
Quote:
Originally Posted by belvdr
Yeah, and the UUID is the pain. Shame you can't just label the thing as you would do in HP-UX or Solaris, or even Linux. The reality is the UUID just gets in the way sometimes.
How does the UUID get in the way? I'm not sure what you are referring to.

In terms of just labeling the volume you sort of can do that. If you use the construct LABEL=MyDiskName instead of the UUID=SomeBigIdentifier then you can specify your fstab in terms of the volume name. Volume names can be changed using diskutil rename <device id> <name>. Not quite the same as labels in other systems but it gives you roughly the same behavior.
mrichmon is offline   0 Reply With Quote
Old Jan 5, 2006, 06:34 PM   #8
belvdr
macrumors 68040
 
Join Date: Aug 2005
Quote:
Originally Posted by mrichmon
How does the UUID get in the way? I'm not sure what you are referring to.

In terms of just labeling the volume you sort of can do that. If you use the construct LABEL=MyDiskName instead of the UUID=SomeBigIdentifier then you can specify your fstab in terms of the volume name. Volume names can be changed using diskutil rename <device id> <name>. Not quite the same as labels in other systems but it gives you roughly the same behavior.
I mean that the UUID is so long and unrelated to the volume in question, in terms of a human. Thus, using a label makes it easier.
belvdr is offline   0 Reply With Quote
Old Jan 6, 2006, 02:20 PM   #9
TypeR389
Thread Starter
macrumors member
 
Join Date: Apr 2002
Location: Seattle
Send a message via AIM to TypeR389 Send a message via Yahoo to TypeR389
Thanks!

this all makes sense, I knew how to add the fstab entries, but I was unaware that I needed to use the UUID field, which makes sense since I couldn't specify a volume name.

I also didn't realize that volumes didn't get mounted until login, which explains some weird behavior when accessing these drives via samba. Sometimes I would get permission denied errors for what I thought was no appearent reason, then I would check the mac, and it would start working! the light brightens slowly
TypeR389 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Spotlight compatibility for external drives in Leopard, Snow Leopard, and Lion MacInMotion OS X 0 Oct 25, 2011 12:39 PM
External drive or conversion kit? waltervt MacBook Pro 4 Sep 24, 2011 08:21 AM
How to change an external HDDs Mount Point? marklight Mac Basics and Help 0 Feb 19, 2011 04:43 PM
iPhoto and External Drive angelpeach838 Mac Applications and Mac App Store 1 Jan 17, 2011 01:23 PM
Using an Mac-used External Drive on a Windows jlcaine Windows, Linux & Others on the Mac 1 Nov 17, 2010 03:40 PM


All times are GMT -5. The time now is 10:25 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC