7

I am trying to prevent 2 volumes from mounting at startup.

I created a new fstab using vifs and added the UUIDs of the volumes I don't want to mount at system startup, but for some reason this does not seam to work in High Sierra. Both volumes will mount as usual.

Any idea what's missing?

The following syntax is what i used -

UUID= none apfs rw,noauto

7

To prevent a volume from automatically mounting you need to know the filesystem type and either the volume name or volume UUID. This information can be found by using the Terminal application command diskutil info name, where name is the volume name. For example, volume names can be found under Devices in the sidebar of a Finder application window.

On my computer, the output from the command diskutil info "Macintosh HD" is given below.

   Device Identifier:        disk2s1
   Device Node:              /dev/disk2s1
   Whole:                    No
   Part of Whole:            disk2

   Volume Name:              Macintosh HD
   Mounted:                  Yes
   Mount Point:              /Volumes/Macintosh HD

   Partition Type:           41504653-0000-11AA-AA11-00306543ECAC
   File System Personality:  APFS
   Type (Bundle):            apfs
   Name (User Visible):      APFS
   Owners:                   Disabled

   OS Can Be Installed:      Yes
   Media Type:               Generic
   Protocol:                 Disk Image
   SMART Status:             Not Supported
   Volume UUID:              F21AD81B-B114-456C-B2A0-BF4452E4842D
   Disk / Partition UUID:    F21AD81B-B114-456C-B2A0-BF4452E4842D

   Disk Size:                1000.0 MB (999981056 Bytes) (exactly 1953088 512-Byte-Units)
   Device Block Size:        4096 Bytes

   Volume Total Space:       1000.0 MB (999981056 Bytes) (exactly 1953088 512-Byte-Units)
   Volume Used Space:        3.4 MB (3416064 Bytes) (exactly 6672 512-Byte-Units) (0.3%)
   Volume Available Space:   996.6 MB (996564992 Bytes) (exactly 1946416 512-Byte-Units) (99.7%)
   Allocation Block Size:    4096 Bytes

   Read-Only Media:          No
   Read-Only Volume:         No

   Device Location:          External
   Removable Media:          Removable
   Media Removal:            Software-Activated

The pertinent lines are shown below.

   Volume Name:              Macintosh HD
   Type (Bundle):            apfs
   Volume UUID:              F21AD81B-B114-456C-B2A0-BF4452E4842D

Note: You can not use the Disk / Partition UUID, except when the Disk / Partition UUID is the same as the Volume UUID.

Either of the lines given below could be added to the /etc/fstab file to prevent this volume from automatically mounting.

UUID=F21AD81B-B114-456C-B2A0-BF4452E4842D none apfs rw,noauto
LABEL=Macintosh\040HD none apfs rw,noauto

Note: The character sequence \040 is just the octal representation of the space character.

  • Your fundamental error in the 1st version was: APFS containers don't accept HFS/HFS+ volumes. So far only APFS volumes are supported... – klanomath Dec 30 '17 at 1:52
  • I've used the method you outlined here many times for non-APFS volumes, but it doesn't seem to work for me using APFS volumes on Mojave. I have an external SSD with two APFS volumes (1 container) and I only want one of them to mount automatically. Regardless of whether I add the Volume UUID or the label (or both), every time I plug in the device, both volumes mount. Any suggestions? – parzival Mar 15 at 1:23
  • 2
    APFS volumes on Mojave fail for me (nothing happens) if I use UUID. Referring to the same volume by its device name (e.g. /dev/disk3s3) works fine. Seems bugged. – Ammo Goettsch Apr 19 at 21:02
  • @AmmoGoettsch could you provide an example? I don't seem to get this working using LABEL= or UUID= for device name. – riorben May 25 at 20:36
  • @riorben correct, I cannot get it to work with LABEL or UUID either, so I use the device name itself. I am currently running with two lines in my fstab. The first one keeps MacOS disk utility from mounting my drive to the default /Volumes/volumename, and the second one allows me to mount it to a specific location via 'sudo mount -a'. It does not process the second line automatically on start up though, so I still have to mount it via login script. LABEL=volumename /Users/username/Pictures apfs rw 0 2 /dev/disk3s3 /Users/username/Pictures apfs rw 0 2 – Ammo Goettsch May 26 at 17:34
0

You may also want to check this out for more casual automounting : http://henri.shustak.org/tools/ejector

  • 1
    Welcome to Ask Different and thank you for your answer. :) Unfortunately, short answers such as this don't really provide enough detail or context to help many users. And, just providing a link isn't very helpful as it may no longer work in future. Instead, could you please edit your answer (there's an edit link below it) to include a summary of the content you're linking to? This will make your answer more self-contained and help preserve it for other users in future. – Monomeeth Aug 7 at 22:52
  • 1
    Also, please be careful if you're promoting your own site, blog, software, etc. The community frowns on overt self-promotion and tends to vote it down and flag it as spam. Post good, relevant answers, and if some (but not all) happen to be about your product or website, so be it. However, you must disclose your affiliation in your answers. – Monomeeth Aug 8 at 0:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .