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

Click here to return to the 'A simpler way to mount drives - 100%' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A simpler way to mount drives - 100%
Authored by: Cat2Mac on Feb 13, '06 08:49:03PM
Several ways to mount a specified disk @ boot have been suggested ... involving scripts, partition size, & other non-trivial ways of determining the unique identity of a drive/partition. Instead of these methods why not use a constant, unique identifier that is already present in each partition ... the UUID.

I have used the following method, with 100% success for about 18+ months on both 10.3 & 10.4, to mount a second SATA drive I added to my G5 PowerMac as the "/Users" volume:

1. Open Disk Utility.
2. Select the partition/volume (not physical drive) you want to mount & click Info.
3. Write down the value for "Universal Unique Identifier"
4. Edit /etc/fstab & add the following line:

UUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/mountpoint hfs rw 1 2

for example: I used "UUID=832760B0-DA18-3865-B22A-C86F16493D15 /Users hfs rw 1 2" to mount my second drive as my "/Users:" directory, putting all user files are on my other drive. (NOTE: The mount point must be a preexisting empty directory.)

5. Reboot.

This info was discussed in an earlier hint, quite a few months ago.

Hope this is helpfull...

[ Reply to This | # ]
A simpler way to mount drives - 100%
Authored by: syzygies on Feb 14, '06 03:12:18PM

Only after a half hour of experimenting did I realize that you never actually said that you tried this for moving the swapfile. Your confidence threw me.

While Apple is deprecating the use of fstab, your method does a great job of eventually mounting arbitrary volumes in arbitrary locations (as
does mounting by name rather than UUID), with two caveats:

1. The maids come in and sweep /Volumes clean between boots, so any mount point created there will be deleted before it can be used.

2. If one creates a mount point elsewhere, e.g. next to Apple's default location for swapfiles, then the volume does not mount in time to be used for virtual memory.

There's a perennial tug-of-war in hints land, between those who love one-liners and feel sorry anyone who just wasted hundreds of lines of code for the same task, and those who view robustly covering every case as a game, and are willing to codify their strategy using hundreds of lines of code.

If one writes for other people, one has to take the second point of view. A Perl script feels heavy-handed compared to proposing a few manual changes, but look at the one trouble report so far here: A manual editing error by someone who didn't use the Perl script.

[ Reply to This | # ]
A simpler way to mount drives - 100%
Authored by: TigerKR on Feb 14, '06 06:50:46PM

Your suggestion to use fstab will only work 100% of the time for single disk setups. If you have multiple disks, especially across multiple busses, then the disk numbering order won't necessarily be the same after every reboot.

Please see the following link for reference and scroll down to the bottom to read my post:

You can also scroll to the bottom of this page <> and read the comments about using the fstab file.

[ Reply to This | # ]
A simpler way to mount drives - 100%
Authored by: Cat2Mac on Feb 14, '06 08:09:24PM

Each volume/partition has a unique, unchanging UUID.

If you call the volume X & it has a UUID of Y, & your mount point is /Z, then X is Y & will always mount at /Z. I believe the only time the UUID might change is when deleting & recreating the volume. (Note that I have only used this for permament drives, not external/unmountable firewire or USB. SCSI drives should also work.)

Also you can have as many volumes as you want ... just add as many volume definitions as you need to fstab. I only used one, but any number of volumes can be added. If you want 10 volumes then add 10 lines.

[ Reply to This | # ]
A simpler way to mount drives - 100%
Authored by: syzygies on Feb 15, '06 04:21:06AM

UUID fstab mounting also works fine with FireWire drives, you've just got to set the automount preferences right, via

defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true

It won't work for moving the swapfile, because moving the swapfile comes too soon in the boot process. I'd read this widely, and in fact I stated it as a truism on my web page, but after first reading this post I did a double take, "Maybe this behavior changed and I didn't test it recently!?" No, still doesn't work for moving the swap.

[ Reply to This | # ]
Using the UUID to reference volumes
Authored by: Cat2Mac on Feb 15, '06 01:12:58PM
I must cede to your greater knowledge of the nuances of the boot process. My intention was primarily to bring attention to an intrinsic property (that everyone in the thread seemed to be ignoring) of any volume/partition that is:
  1. Generated & recorded on each volume during formatting
  2. UNIQUE to each volume
  3. Stable & unchanging (unless reformatted)
  4. Stays the same even if mounted on a different computer.
Rather than looking for combinations of ephemeral values to identify a volume, why don't you use the one value that is designed to be a unique value: the UUID.

Please let me know if there is some reason why the UUID can't be used to identfy a drive (whether used as a swap volume or some other purpose),

[ Reply to This | # ]
Using the UUID to reference volumes
Authored by: TigerKR on Feb 15, '06 05:01:30PM

This thread is about setting up a swap partition.

You can't use an UUID to setup a swap partition because swap is setup before ANY UUID information is read/used; UUID only comes into play only AFTER the swap is happily swapping along already.

Therefore, this thread is ignoring UUID discussions because this thread is about setting up a swap partition.

[ Reply to This | # ]