17

I have four disks in my Mac Pro. The boot disk and two others mount when OS X starts but the fourth one does not. I can mount it in Disk Utility and it appears to be all right.

How can I tell Mac OS X to mount it?

diskutil list /dev/disk2s2
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk2
   1:                        EFI                         209.7 MB   disk2s1
   2:                  Apple_HFS Broken                  999.9 GB   disk2s2

Update: There seems to have been a misunderstanding about this question. I do not want to find out what's wrong' with my disk I named "Broken". It appears to work fine. I also reformatted it several times. I want to know how to tell OS X to mount a specific disk at boot. I named the disk "Broken" because it doesn't mount automatically, not because I have any problems with it as such and nor are there any error messages. Just forget I mentioned the disk and answer the question how to tell OS X which disks to mount at boot, if you know the answer. Thanks.

  • You say you can mount it in Disk Utility as if you cannot mount it via the Finder sidebar? http://cl.ly/DC0k – gentmatt Jan 09 '12 at 18:40
  • How would I mount it via the Finder sidebar? – Andrew J. Brehm Jan 09 '12 at 19:28
  • Did you click on the link of the first comment? – gentmatt Jan 09 '12 at 19:29
  • Yes. But my Finder is configured to show all hard disks. Don't know how to make the Finder mount disks though. Your screenshot doesn't show that. – Andrew J. Brehm Jan 09 '12 at 19:32
  • Why do you need it to be auto mounted upon start? I mounts quickly as soon as you navigate there in finder. – gentmatt Jan 09 '12 at 19:40
  • 1
    How can I navigate to it when it isn't mounted? I think you are confusing mounting a drive with opening it in Finder. The drive is not mounted. This means it is not available to the system as a volume, only as a device (like "disk2s2" in the case of this drive). When Mac OS X boots it mounts all the drives, usually. – Andrew J. Brehm Jan 09 '12 at 20:21
  • You're right, I'm confused. I need to fully understand the difference between volume and device. I'll google bait about this now.....To me those two things were the same?! So I guess, you'll have to edit /etc/fstab then? – gentmatt Jan 09 '12 at 20:26
  • 1
    Linux has an /etc/fstab, Mac OS X does not (at least my installation doesn't seem to have one). Here a "device" is really a lot of things, but some devices are really disks (or similar) and contain file systems. By mounting them, the file system becomes part of the system and can be accessed by the Finder and other programs. – Andrew J. Brehm Jan 09 '12 at 20:41
  • I was confused because both internal and external drives show up in /Volumes. Still there are different devices. I have a file /etc/fstab.hd. What's your output in the Terminal for diskutil list? (BTW: If you want, we can delete all these comments and continue talking in chat.) – gentmatt Jan 09 '12 at 20:45
  • Is the fourth disk formatted in any particular way? – Jason Salaz Jan 09 '12 at 22:11
  • Non-journaled HFS+ or whatever Disk Utility uses at its default. – Andrew J. Brehm Jan 10 '12 at 12:19
  • 1
    Non-journaled HFS+ hasn't been the default for many years. Journaling should be enabled on all your HFS+ volumes, unless you have a very good reason not to - I think some Linux/BSD HFS utilities don't like journaled HFS+. – Brett Dikeman Jan 10 '12 at 17:41
  • 2
    These answers mostly miss the point! He is not looking to mount at login. He wants to mount at boot time. This isn't exactly a difficult question but it seems to be a difficult answer. For example, you want an external disk (these are not auto mounted it seems while internal drives are) to be used for a network Time Machine Backup location. You don't want to limit network devices to being able to backup only when a certain user is logged into the computer. You want it to backup ALL THE TIME. So, the question isn't why or why not at login time but how do you mount an external drive at BOOT time –  Aug 16 '15 at 21:29

6 Answers6

16

OS X uses diskarbitrationd which discovers new storage devices and probes them for mountable filesystems. The Disk Arbitration framework handles notifying applications of disk mount/unmount events, and allows them to influence whether a volume is mounted or not.

Consult the man page for diskarbitrationd for very limited further information; for example, diskarbitrationd consults /etc/fstab to determine if the discovered filesystem should be mounted other than at the default location(/Volumes/) or with special options (or not mounted at all.)

Reasons for diskarbitrationd not mounting a filesystem or "volume" on a device may include:

  • Errors (corruption) in the partition table.
  • A mismatch between the partition type and the filesystem.
  • A damaged filesystem which fsck cannot repair.
  • Hardware failure.
  • Filesystem is listed in /etc/fstab with noauto.
  • An application has used the Disk Arbitration framework to prevent auto-mounting

According to your comments, all your journaled filesystems are mounting, and the filesystem which isn't mounting doesn't have journaling turned on. Journaling was introduced in 10.2 Server and 10.3 Client and by now is considered a vital, critical feature. It should be enabled unless you really know what you're doing; hence why you must hold down the option-key in Disk Utility to disable it in modern versions of OS X. Make sure the volume has journaling enabled:

  1. Select the volume in Disk Utility
  2. Choose File->Enable journaling (if it is greyed out, journaling is enabled.
  3. Verify by choosing File->Get info; you should see "Mac OS Extended (Journaled)" as the filesystem type.
  • The file system is clean and the volume has been formatted twice. I can also mount the volume manually both in Disk Utility and in the command line. – Andrew J. Brehm Jan 10 '12 at 12:17
  • Yes, yes, yes, wait until I get home... Now. – Andrew J. Brehm Jan 10 '12 at 17:23
  • Like I said in the comments earlier, the device name is disk2s2. – Andrew J. Brehm Jan 10 '12 at 17:25
  • 1
    diskutil list /dev/disk2s2 /dev/disk2 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *1.0 TB disk2 1: EFI 209.7 MB disk2s1 2: Apple_HFS Broken 999.9 GB disk2s2 – Andrew J. Brehm Jan 10 '12 at 17:25
  • 1
    Note that "Broken" is the name of the volume. – Andrew J. Brehm Jan 10 '12 at 17:25
  • diskutil: did not recognize verb "activity"; type "diskutil" for a list – Andrew J. Brehm Jan 10 '12 at 17:27
  • There are no new messages in Console All Messages when I mount the drive in Disk Utility – Andrew J. Brehm Jan 10 '12 at 17:29
  • 1
    I think you are labouring under the assumption that there is something wrong with the mount process itself. There is not. Mounting the drive works. It just doesn't mount at boot. – Andrew J. Brehm Jan 10 '12 at 17:30
  • 1
    It's only happening to one drive, and it's not automounting. Unmount and unplug the drive, then reconnect it, and I bet it won't mount automatically. There's nothing special about boot-time mounting, really.

    Please post all the information I requested by updating your question, not by pasting it here - the formatting is broken.

    – Brett Dikeman Jan 10 '12 at 17:32
  • There is obviously something special about boot-time mounting, otherwise this problem wouldn't exist. I cannot unplug the disk. – Andrew J. Brehm Jan 10 '12 at 17:40
  • 1
    There's no real functional difference between a device appearing at boot, and a device being plugged in after boot. The same logic is followed. It's not the same logic as when you click "mount". The fact that this only happens to one of four drives in your system indicates strongly that it IS a problem specific to that one drive, which is why I've repeatedly asked you for several pieces of information about that one drive. Please provide that information by clicking "edit" below your question and pasting it into the question, or by using pastebin and including a link. – Brett Dikeman Jan 10 '12 at 17:59
  • Ok, so there is a difference between the mount command and mounting at boot-time, like I said. I have provided the information you asked for. – Andrew J. Brehm Jan 10 '12 at 18:07
  • Clicking Mount in Disk Util forces a mount. Automatic mounting can be aborted by a bunch of different factors. Please provide *all the information I asked for, not just the output of diksutil list. Lastly, the device name is disk2; disk2s2 is a partition. – Brett Dikeman Jan 10 '12 at 18:17
  • I provided ALL the information where possible and explained why it wasn't possible for the rest. – Andrew J. Brehm Jan 10 '12 at 18:19
  • Open Disk Utility. Select the drive. Click File-> Get Info. Select all the text in the window. Click Edit->Copy. Paste it into the question. Click on the volume ("Broken"). Repeat pasting this info. Next, in Terminal, type "mount". Copy the output and paste it into the question. – Brett Dikeman Jan 10 '12 at 18:27
  • I'm not sure moderators are supposed to close questions based on whether the user provides all the information you ask for or not. Besides, I have provided all the information you asked for, just not twice or when it wasn't possible. (For example, one of the commands you told me to run didn't work.) – Andrew J. Brehm Jan 10 '12 at 18:59
  • 2
    Sometimes there are questions with insufficient detail and the asker never comes back, so they're closed. However, in this case, Andrew seems to be actively responding, so I'm going to leave the question open. He seems invested enough to realize that omitting troubleshooting steps may result in not getting an answer. – Kyle Cronin Jan 10 '12 at 19:56
  • 1
    You haven't provided anything I asked for except for the output from diskutil list, which is not helpful. I understand diskutil activity doesn't work on your system; that's fine. You have not provided the disk and filesystem information I asked for from Disk Utility, which I even provided step-by-step instructions on how to do. – Brett Dikeman Jan 10 '12 at 21:44
  • 1
    BeeDee, that information is virtually identical with that of the other three drives. The only difference is, as I said before, that the file system is not journaled. Can you accept that the problem has nothing to do with the file system? I do not see that following troubleshooting steps going into a random direction does anything to help, especially when you don't accept answers. – Andrew J. Brehm Jan 11 '12 at 15:14
  • 1
    In fact my question is simply about how Mac OS X determines which disks to automount. Technically, no info at all is needed about the disks affected for that question to be answered. It just so happens that I cannot find the information anywhere on the Internet. It seems like nobody ever wrote down how Mac OS X decides what volumes to mount at boot. In Linux it's in /etc/fstab, quite independently of whether disk 3 is HFS+ or NTFS or chocolate-covered. How is it done in Mac OS X? – Andrew J. Brehm Jan 11 '12 at 15:16
6

A little late, but hopefully this helps anyone else searching (since the rest of the answers here are useless!)

Quoting https://discussions.apple.com/message/29744735#29744735 -

Since at least Panther and through to El Capitan, AutomountDisksWithoutUserLogin needs to be set to true (1) in /Library/Preferences/SystemConfiguration/autodiskmount.plist, then all external storage should be mounted at boot.

Check current setting: sudo defaults read /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin

The output will be either 0 or 1 0 = false 1 = true

Set to true: sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true

1

In my case I had to mount an afp volume at boot, and I wanted it to be transparent. What I did was to create an script and added it to login items. That way the window is not shown.

tell application "Finder"
    mount volume "afp://ServerName._afpovertcp._tcp.local/VOLUMENAME" as user name "macUser"
end tell

you can try to do something similar with

do shell script "diskutil mount /dev/disk2s1"
jigzat
  • 133
1

Assuming there's no dramas with the volumes themselves, you can mount additional volumes at login by adding them as Login Items for your user account in the System Preferences.

  • That opens a new finder window every login. No matter if you check-mark 'hide'. Kind of annoying. – gentmatt Jan 10 '12 at 06:58
  • It's also impossible since Login Items are opened, not mounted. How would Finder even know which device to mount for an icon named "Hard Disk 2"? – Andrew J. Brehm Jan 10 '12 at 08:30
  • 1
    In my experience, it doesn't open Finder, it just mounts the Volume. I use this to mount shares from my Drobo (although I admit that I'm assuming that this works the same for local volumes). Will confirm the steps when I get home. – Tony Johnson Jan 10 '12 at 09:17
  • Volumes can be added to startup items by going to System Preferences > Users & Groups > Login Items. Select "+" to add a new item and select the Volume in question. Have confirmed that this works with Local Volumes as well as Network Shares. The result is the Volume mounted and an icon on the desktop. No finder windows are opened. – Tony Johnson Jan 10 '12 at 10:12
  • So this will really mount the volume, not just open (the already mounted) volume? – Andrew J. Brehm Jan 10 '12 at 12:17
  • Adding volumes to startup items (if it will even work) is a bandaid, not a fix to the original problem. – Brett Dikeman Jan 10 '12 at 17:54
  • 1
    Yes, the volume will be mounted. The only condition is that you can see the Volume in the "Add Startup Item" dialog. Agree that it's a bandaid, but if it works, does it matter? – Tony Johnson Jan 10 '12 at 23:27
1

The volume is mounted automatically again.

I never did find out how Mac OS X decides which volumes to mount and which not. But whatever it is, Mac OS decided to mount the volume again. Apparently the solution is to reboot until it works.

1

Go to System Preferences>Accounts>Login Items. Click on the plus sign and add your drive on that list. Every time you log into your account, Finder will automatically mount that drive.

Club17
  • 11