"Read-only file system" when I try to touch in Mac OS Catalina
I'm logged in as admin in MacOS Catalina. When I try to add quota file, I get this output:
sudo touch /.quota.ops.user
> touch: /.quota.ops.user: Read-only file system
Than I tried:
mount -uw /
...and got an error:
mount_apfs: volume could not be mounted: Operation not permitted
mount: / failed with 77
Solution 1:
Copied directly from Apple KB - About the read-only system volume in macOS Catalina*
TL:DR
With macOS Catalina, you can no longer store files or data in the read-only system volume, nor can you write to the "root" directory ( / ) from the command line, such as with Terminal.
macOS Catalina runs in a read-only system volume, separate from other files on your Mac. When you upgrade to Catalina, a second volume is created, and some files may move to a Relocated Items folder.
macOS Catalina runs on a dedicated, read-only system volume called Macintosh HD. This volume is completely separate from all other data to help prevent the accidental overwriting of critical operating system files. Your files and data are stored in another volume named Macintosh HD - Data. In the Finder, both volumes appear as Macintosh HD.
The Disk Utility app in macOS Catalina shows that Macintosh HD is the read-only system volume and Macintosh HD - Data contains the the rest of your files and data.
If you upgrade to macOS Catalina from an earlier version of macOS, the read-only volume is created during the upgrade process. Files or data that you previously stored in the startup volume are now stored in this new volume, and some of these files may appear in a new folder called Relocated Items. You can check this folder for any files that you can’t locate.
With macOS Catalina, you can no longer store files or data in the read-only system volume, nor can you write to the "root" directory ( / ) from the command line, such as with Terminal.
About the Relocated Items folder
While creating the two separate volumes during the upgrade process, files and data that couldn’t be moved to their new location are placed in a Relocated Items folder. The Relocated Items folder is in the Shared folder within the User folder (/Users/Shared/Relocated Items) and available though a shortcut on the Desktop. The Relocated Items folder includes a PDF document with more details about these files.
*Copied from en-gb site, link will redirect your your local language site
See also Ask Different - Where does the upgrade to macOS Catalina move root “/” directory files?
Solution 2:
See complete answer with more info here: https://stackoverflow.com/a/59395264/2919326
The command mount -uw /
works if you first boot into Recovery Mode by holding Command + r while booting, and then run csrutil disable
in Utilities -> Terminal.