- How To Fix Read-Only File System Error When Run Mkdir Command On MacOS
- 1. Fix MacOS Read-Only File System Error Steps.
- 2. Resolve Read-only File System Error When Remove Files.
- 3. Question & Answer.
- 3.1 Python script meets read-only file system error on macOS.
- Файловая система только для чтения при попытке mkdir / data / db на Mac
- Question: Q: Read-only file system external drive
- All replies
- Question: Q: Can’t create folder at root directory
- Helpful answers
- Question: Q: Read-Only File System after updating OSX
- All replies
How To Fix Read-Only File System Error When Run Mkdir Command On MacOS
When I run command mkdir in mac os to create a folder, it gives me an error message mkdir: /data: Read-only file system like below. This article will tell you how to fix it.
1. Fix MacOS Read-Only File System Error Steps.
- Restart macOS, press Command+R to go to macOS utilities window.
- Click menu item Utilities —> Terminal at top menu bar.
- Then input command csrutil disable in the popup terminal window. This command will disable the System Integrity Protection.
- Click Mac Logo —> Restart menu item at the top left corner to restart the macOS.
- After restart macOS, run the command sudo mount -uw / .
- Now you can create a directory successfully with the command mkdir .
- If you want to check whether System Integrity Protection is enabled or disabled, you can run command csrutil status in a terminal.
- If you want to enable System Integrity Protection, you can restart the macOS and press Command + R to go to the macOS utilities window again to enable it with command csrutil enable in terminal.
2. Resolve Read-only File System Error When Remove Files.
Now we can create a directory in the macOS system. But when I want to remove files, it also shows me below error messages.
To fix this issue, you should run command sudo mount -uw / , after that, you can remove files as you want.
3. Question & Answer.
3.1 Python script meets read-only file system error on macOS.
- In my python script, I want to use the python os module’s system function to execute a zip command to make a zip file like below.
But when I run the python script, it shows a permission denied error like below.
I have run the command csrutil disable to disable the System Integrity Protection on my macOS, but it still throws the error when I run the python script.
Источник
Файловая система только для чтения при попытке mkdir / data / db на Mac
Я пытаюсь создать новую папку в основном каталоге
Пробовал всевозможные примеры
sudo mkdir /data/db
sudo mkdir -p /data/db
Я продолжаю получать
mkdir: / data: файловая система только для чтения
Если у вас Mac и вы обновились до Catalina, корневая папка больше не доступна для записи.
Я просто сменил каталог в другом месте.
Я использовал эту команду сейчас
установите homebrew и выполните следующие команды
sudo chown -R $(whoami) $(brew —prefix)/*
brew tap mongodb/brew
brew install mongodb-community@4.2
brew services start mongodb-community
mongod —config /usr/local/etc/mongod.conf
ps aux | grep -v grep | grep mongod
чтобы убедиться, что вы можете запустить show dbs в оболочке mongo
С новым обновлением macOS Catalina папка /data/db становится доступной только для чтения, вы не можете ее изменять. Выполните эту процедуру, чтобы создать БД в другой папке:
Сменить mongod каталог:
sudo mongod —dbpath /System/Volumes/Data/data/db
Дайте ему псевдоним, чтобы использовать его как mongod :
alias mongod=»sudo mongod —dbpath /System/Volumes/Data/data/db»
Просто введите mongod свой терминал, он должен работать.
Extra => Если вам нужно дать ему права текущего пользователя, используйте эту строку кода:
sudo chown -R $(whoami) /System/Volumes/Data/data/db
(Просто для информации -> $(whoami) это просто переменная, которая возвращает вашего текущего пользователя)
Сделать постоянное изменение пути к db папке mongod .
Следуя этим документам, они говорят примерно следующее. Если mongod запущен с сервисами пивоварения:
Он будет использовать файл конфигурации по пути /usr/local/etc/mongod.conf
Чтобы исправить это, отредактируйте файл конфигурации:
И измените, dbPath например, свой домашний каталог следующим образом:
Сохраните файл и перезапустите mongod с помощью brew:
Вот что сработало для меня, когда я проходил курс Udemy: 1. Установите HomeBrew, введя это в свой терминал.
Переместите старую папку / data / db (если вы хотите сделать резервную копию текущих dbs) в некорневую папку и перейдите к следующему шагу
Запустите в Терминале a) brew uninstall mongodb b) При необходимости запустите brew uninstall —force mongodb c) brew tap mongodb/brew d) brew install mongodb-community e) brew services start mongodb/brew/mongodb-community
Все, что вам теперь нужно, это запустить mongo в Терминале, и вы увидите символ оболочки mongo>.
Пожалуйста, дайте мне знать, работает ли это;) Мне потребовалось почти 2 часа, чтобы понять это, основываясь на этой статье: /apple/362883/mongodb-doesnt-work-after-update-to -macos-catalina-10-15
Источник
Question: Q: Read-only file system external drive
Problem: Two of my external Western Digital drives have suddenly and simultaneously been designated as «read-only file systems.» Consequently, I cannot access them, even with sudo.
Need: I want to mount the drives with read-write access.
This problem renders Time Machine useless and means I have to (occasionally) spend hours manually copying files back and forth using the terminal, as the Finder is never capable of doing so without an error.
At the very least, I would like a workaround to remove whatever marker the OS uses to designate the drives as read-only. Compared to copying hundreds of GB for no reason, I’d be happy to execute a Terminal command or two.
I suspect the problem is caused because WD drives spin down regularly and take longer than macOS would like to spin back up. They are then designated as read-only because the OS has had difficulties accessing them multiple times.
This Mac is running a pristine version of Sierra, installed about two weeks ago after erasing the internal drive. I do not manually change system files or install programs which modify system files (cache-cleaners, etc.).
The drives are not damaged. I have checked them many times on multiple computers. Unfortunately, this is not the first time I’ve been locked out. Please let us work on the assumption that they are in good working order.
The drives appear in the finder on restart only.
Once unmounted (ejected), I cannot remount them using:
- the GUI Disk Utility
- diskutil
- mount (the -uw option doesn’t work on hfs as demonstrated with -dv), or
- mount_hfs
I can read from the drives.
I tried Nicholas Vahalik’s idea of turning off journaling with hfs.util and running fsck_hfs. hfs.util worked, but the disk wasn’t journaled. fsck_hfs was unable to write to the drive.
I am unable to change permissions using the Finder or the shell, but they appear to be set correctly for my user to have read/write access anyway.
Both drives contain some hidden files in their root directories. I suspect one (or more) may have locked the file system. In other words, when the OS goes to use the drive, if it sees one of these files present, it designates it as read-only. The suspect files are:
- .apdisk (apparently a new apple fs?)
- .fseventsd (a directory, but may contain something pertinent)
- two others I’ll need to reboot to see again. Something like .diskID and .diskIDx2
However, I cannot access the above files to move or delete them for testing purposes.
There is something «higher-level» going on that prevents write access on the drives. Any help determining what that is, would be appreciated!
Mac mini, macOS Sierra (10.12.1)
Posted on Oct 26, 2016 9:24 AM
All replies
Loading page content
Page content loaded
How are they formatted?
Oct 26, 2016 9:27 AM
Oct 27, 2016 8:57 AM
Thats correct (except for the lack of journaling), but doesn’t explain why they don’t write. Can you temporarily move the content of one of them off the drive and reformat it correctly?
Oct 27, 2016 9:01 AM
$ diskutil info disk3s2
has revealed that the drives are «Read-Only Volumes,» but I haven’t been able to discover why this is the case or how they were designated as such.
I have found that the following commands save me from having to restart the Mac to remount the drive each time:
$ sudo mkdir /Volumes/BackupDrive
$ sudo /System/Library/Filesystems/hfs.fs/Contents/Resources/hfs.util -m disk3s2 /Volumes/BackupDrive fixed readonly nosuid nodev
The fixed flag came from the diskutil info command above. The readonly flag appears to be required, as writeable (or «writable» in the error message, also see man entry) will not work.
The fact that the writeable flag will not work makes me think that the file system has been set to read-only in some other way. It is not simply a matter of deliberately mounting it rw. I have tried chmod, xattr, and attempted to change the UUID (hfs.util -s) of the partition in the hope that this would separate the drive info from whatever is designating it read-only. This was unsuccessful.
I suspect this is less complicated than it seems, but no solution yet.
This does seem to be a common problem, and has been for many versions of macOS.
Источник
Question: Q: Can’t create folder at root directory
After i upgade to catalina, i try create folder at root directory but get error.
mkdir: /app: Read-only file system
Please help me resolve it. Many thanks.
Posted on Oct 9, 2019 10:14 AM
Helpful answers
You cannot resolve it. Catalina put the operating system and operating system installed applications on their own read-only partition. Neither root nor sudo privileges are going to let you modify it. Welcome to enhanced operating system security.
Oct 9, 2019 10:31 AM
There’s more to the conversation
Loading page content
Page content loaded
You cannot resolve it. Catalina put the operating system and operating system installed applications on their own read-only partition. Neither root nor sudo privileges are going to let you modify it. Welcome to enhanced operating system security.
Oct 9, 2019 10:31 AM
You cannot resolve it. Catalina put the operating system and operating system installed applications on their own read-only partition. Neither root nor sudo privileges are going to let you modify it. Welcome to enhanced operating system security.
That may be so, but there is (obviously) a logical equivalent in how the separate partitions are logically presented as a single unit. I’ve tried some suggestions from the web which supposedly worked with the developer previews but don’t appear to do so with the release.
For better or worse in the corporate development environment I interact with I have a need to be able to mount (or provide a link to a separate mount location) remote storage whose path begins with a specific name under the root. Not being able to do so is an annoyance at best.
Источник
Question: Q: Read-Only File System after updating OSX
I just updated my iMac’s OSX to 10.11.4, and now my FCPX project on an external drive keeps getting a «Read-Only File System» message! Anybody else have this issue? Wondering if I should roll-back my OS to the previous version, where I had no problems accessing my Library.
iMac, OS X El Capitan (10.11.4)
Posted on Apr 28, 2016 11:14 AM
All replies
Loading page content
Page content loaded
Get info (command+i) on your external Volume and check to see if the checkbox at the bottom of the window («Ignore ownership on this Volume») is UN-checked.
Apr 28, 2016 11:28 AM
How is the disk drive formatted?
Apr 28, 2016 11:34 AM
I looked in the Info window, but nothing appeared below «Sharing & Permissions: You can only read». Is this a feature of the new update?
I restored to my previous version of El Capitan and everything works again.
Thanks for the info.
Apr 29, 2016 10:23 AM
Yeah, I was just using the Tuxera NTFS format that it came with.
I restored to previous version of El Capitan, and everything’s working. I’ll look for another drive large enough to hold it all, format it with Mac OS, and transfer everything over before I update the OS again.
Apr 29, 2016 10:25 AM
OS X is able to read NTFS but needs third party software in order to be able to write to it. The El Capitan upgrade to OS X broke many of the third party NTFS software and need. so the third party NTFS software needed to be upgraded to work with El Capitan.
For that reason plus the fact that many applications do work properly with NTFS even with up today third party NTFS software, I have always refused to have anything to do with disk drives that were format with NTFS.
Источник