Mounting disk as ready only in Mac

In this post we are going to discuss, how to mount hard disk as read only in Mac. For mounting disk as read only in windows visit Mounting disk as ready only in Windows. And for mounting disk as read only in Linux visit Mounting disk as ready only in Linux

In order to mount disk as read only, we are going to use Mac in-built command line tool: Diskutil. For this follow below steps

Start Terminal and enter below command to list the disks

$ diskutil list

This will list down all disks attached to Mac and its partitions.

Pick disk partition that you want to mount read only. Assuming you have selected /dev/disk2s1, run below command to first unmount the partition

$ diskutil unmount /dev/disk2s1

Once its unmounted, you can run below command to mount it back as read only

$ diskutil mount readOnly /dev/disk2s1