macosmacos-catalinaapfs

Custom path for APFS volume in a external SSD


I have external SSD with APFS volumes inside, when plug-in this automatic mount at /Volumes/Workspace. Have a way to define to automatic mount in a predefined path?


Solution

  • Take a look at current volumes:

    ls /Volumes
    

    Get the UUID of volume:

    diskutil info /Volumes/[name] | grep UUID
    

    Create a folder where you wish add the volume:

    mkdir -p [/absolute/path/to/folder]
    

    Put follow code at fstab:

    echo "UUID=[UUID] [/absolute/path/to/folder] apfs rw" | sudo tee -a /etc/fstab
    

    The example mount a volume with apfs format, but you can use for ntfs, nfs, etc.