Avoid mounting a partition on OSX (1 code line)


If you have two operating systems installed on your OSX is quite annoying that you automatically mount those two partitions. Running this simple line you will prevent mount the partition that you do not use.

Just type the next:

echo 'UUID='$(diskutil info /Volumes/XXX/ | grep 'Volume UUID' | awk '{ print $3 }') 'none hfs rw,noauto' | sudo tee -a /etc/fstab

Where XXX is the partition that you DON'T want to be mounted automatically. In case you want to access the other partition in read-only mode, replace rw,noauto with ro.

It's usefull to connected external drives, too. If the file format is NTFS, change in the previous line hfs with ntfs.

To undo the changes, delete the line added in /etc/fstab.

Now it restart to check if it's works.

We request your permission to obtain statistical data on its navigation on this website. If you continue to browse we consider to accept the use of cookies. OK | More Information