Ferk / udev-media-automount

A simple automount mechanism using udev rules
Other
121 stars 59 forks source link

Recording problem #16

Closed c7v closed 1 year ago

c7v commented 1 year ago

Hi all. Thanks to the authors for their work.

flash software works fine, but when I inserted an external hard drive and it mounted. I tried to create a folder on the disk using the command: mkdir. however I received an error.

web@server:/media/ExternalDisk.ntfs$ mkdir knowledge_base
mkdir: cannot create directory ‘knowledge_base’: Read-only file system

Maybe something needs to be added to the config /etc/media-automount.d/ntfs?

c7v commented 1 year ago

Found the problem, the problem was that the software was running as root.

web@server:~$ ls -al /media/ExternalDisk.ntfs/
total 8
drwxrwxrwx 1 root root 4096 сен 13 11:09 .
drwxr-xr-x 3 root root 4096 сен 13 11:10 ..
Ferk commented 11 months ago

Hi!

I think the reason you can't write is because it was mounted 'Read-only', as the error points out. In fact, I expect even as root you would not be able to write on it, so it's not really the permissions what's the problem. It would have to be remounted for it to work.

Most likely, the cause of the issue is the NTFS filsystem being locked, probably because of a previous Windows session not cleanly closing the filesystem, like in this example: https://superuser.com/questions/1743578/not-possible-to-mount-windows-11-ntfs-partition-for-read-write-even-with-fast

You can try to mount it manually and see if you get a similar error.

You can run the command below to try to remount it as writeable, or at least you might get some feedback on why is it happening:

mount -o remount,rw /media/ExternalDisk.ntfs