Mount USB drive at system boot

Joined
Jan 4, 2011
Messages
2
Reaction score
0
Points
1
I have a Mac Mini PowerPC with OSX 10.4 installed. The Mac will be used as a "hub" file server for Unison synchronization of several "spoke" computers, each running Linux, Mac OS, or Windows. The Unison file synchronizer software will access the Mac from the spoke computers using ssh from the command line. In somewhat unfamiliar terrain, I still have gotten the basic setup working, except for one bit.

The drive for backup is a USB 2 hard drive, that I have formatted with hfs. By default, the Mac OS does not mount this drive unless someone logs in through the Mac's GUI. I do not want to have to log in through the Mac's GUI to mount the drive, and, in fact, I don't expect the Mac to have a monitor. With some experimentation, I have found that the following command suffices to manually mount the drive when logged in remotely as root:
mount -t hfs /dev/disk1s3 /redMyBook/

However, I would like to have the drive mounted once and only once, every time the system boots, without anyone having being logged in. That way, I can set Unison to sync the spokes using cron (or the equivalent). I am sure I can kludge something but there must be a best/proper way to set this up?

Thanks!
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
/etc/fstab is your key. Take a look at post #3 here. It's older but still looks to be accurate.
 
OP
K
Joined
Jan 4, 2011
Messages
2
Reaction score
0
Points
1
Thanks vansmith, that was very useful, although not entirely accurate, for my configuration at least. That post recommends two things, an entry in fstab and an automount. The recommended automount:
Code:
sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisks
produced the following response:
Code:
AutomountDisks
2011-01-04 19:15:00.421 defaults[595] 
Rep argument is not a dictionary
Defaults have not been changed.

It turns out that all that was needed was to create fstab and give it an entry. I used:
Code:
UUID=<value of uuid>       /redMyBook      hfs     rw,auto 1       2

I am not sure this is 100% correct (in particular whether it should be hfs or hfs+; whether I need the ",auto"; whether it should be 1 2 or 0 0 or something else), but it does seem to work. I referred to the last couple posts in the following thread: Apple - Support - Discussions - Leopard and /etc/fstab ...
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top