150

At some point, the filesystem on my digital audio player has become read-only. I cannot copy files into it or remove files on it.

Are there some possible reasons for the player's file system to change permissions in this way?

I tried using chmod:

$ sudo chmod a+rw SGTL\ MSCN/ 
chmod: changing permissions of `SGTL MSCN/': Read-only file system

SGTL MSCN is the mount point of the digital audio player.

What else can I try to make it writeable?

Zanna
  • 70,465
Tim
  • 25,177

7 Answers7

155

If a filesystem has been mounted read-only, chmod will not work since it's a write operation too.

Try remounting it read-write:

sudo mount -o remount,rw '/media/SGTL MSCN'

If the device has a write lock on it (like SD memory cards), you need to turn it off. Hardware locks cannot be disabled by software. Note that the write lock on SD memory cards is located from the sight you see the letters near the up left corner and it looks like a very small switch.

Some filesystem drivers may also not support write operations, this is the case with the older NTFS module supported by Linux. For NTFS filesystems, be sure to use the ntfs-3g driver which should be picked automatically nowadays. If not, you can force the driver with something like:

sudo mount -t ntfs-3g -o uid=$(id -u) /dev/sdb1 /mnt/

(where /dev/sdb1 has to be substituted for your block device and /mnt/ for your destination)

Lekensteyn
  • 174,277
  • 4
    I'm trying this, and getting "DRIVE not mounted or bad option." – JeanSibelius Apr 15 '13 at 22:22
  • @mattshepherd if you have whitespace in the file name, you need to surround it with quotes. – Lekensteyn Apr 16 '13 at 08:23
  • No, no whitespaces. I, er, wound up doing it in Windows. – JeanSibelius Apr 16 '13 at 22:50
  • it doesn't work without root, and in companies always root isn't given to developers – Shirish Herwade May 30 '14 at 06:19
  • @ShirishHerwade In those companies, there is likely a policy restricting the use of external USB drives. – Lekensteyn May 30 '14 at 08:55
  • @Lekensteyn no, you are wrong. In any mobile development company like mine, you always come in such situations where you have to use different vendor's devices to unit test your work – Shirish Herwade May 30 '14 at 12:44
  • @ShirishHerwade So... choose a different filesystem then if you need rw access? Like FAT32? – Lekensteyn May 30 '14 at 13:11
  • @Lekensteyn Typing the second command results in 'Mount is denied because the NTFS volume is already exclusively opened. The volume may be already mounted, or another software may use it which could be identified for example by the help of the 'fuser' command.' It looks like a catch22 situation. – XavierStuvw Aug 21 '16 at 14:48
  • @XavierStuvw Are you sure you have not mounted it elsewhere? mount | grep /dev/sdb1 would tell. – Lekensteyn Aug 21 '16 at 15:23
  • @Lekensteyn Thanks for the answer. It was an read/write protected USB stick where an old Fedora live had been installed. There, GParted, in some way, did not manage to completely wipe the old setting causing conflicts with other applications such as Startup Disk Creator. This caused troubles aplenty and I found the hardware solution: I threw the USB stick in the trash bin. – XavierStuvw Aug 21 '16 at 15:46
  • 1
    @XavierStuvw If read/write protected means readonly, ok. Otherwise you could try to wipe it and repurpose it. The wipefs command can be used on a partition to ensure that no filesystem is recognized. See man wipefs (part of util-linux). – Lekensteyn Aug 21 '16 at 16:37
  • @Lekensteyn wipefs has been been a useful, hence an upvote. I have rescued one USB stick that can be used for ordinary purposes now (that is, I can read and write on it). Startup Disk Creator still fails to see any space free on it whereas it is empty, but I guess this is another topic. – XavierStuvw Aug 21 '16 at 17:42
  • 1
    it says : mount: cannot remount /dev/sdb1 read-write, is write-protected. What to do ?? – mrid Feb 06 '17 at 07:34
  • @mrid are you sure you use ntfs-3g and option remount? E.g. "mount -t ntfs-3g -o remount,rw ...". You could also try this https://askubuntu.com/a/138051/358665. Btw one upvote for "For NTFS filesystems, be sure to use the ntfs-3g driver" – ArchLinuxTux Dec 06 '17 at 15:01
  • It worked perfectly, but how could I enable the read-write automatically after reboot? – Joshua Salazar Feb 16 '18 at 20:04
  • 1
    @JoshuaSalazar how did you mount it? Perhaps you could create a new question and include such details, this comment section is getting a bit too large. – Lekensteyn Feb 16 '18 at 22:30
  • Worked perfect, thank you. For some reason this happened randomly after a boot, I changed no permissions nor anything else when it happened too! Weird – Joe Jul 01 '19 at 01:57
  • I rant sudo mount -t ntfs-3g -o uid=$(id -u) /dev/sdb1 /mnt/ and got this: Mount is denied because the NTFS volume is already exclusively opened. The volume may be already mounted, or another software may use it which could be identified for example by the help of the 'fuser' command.

    What to do?

    – jsibs May 10 '23 at 19:17
27

For NTFS file systems this problem may occur when it is not properly unmounted (probably by unexpected shutdown of windows). In such cases the file systems are marked as locked.

You can mount them properly using the following ntfsfix command, for example:

sudo ntfsfix /dev/sda3

Please replace /dev/sda3 with your own device name.

4

I couldn't easily take my problematic NTFS-formatted external drive back to the Windows system that had apparently failed to dismount it safely (causing Mint to insist on mounting it "read-only").

But the easy answer for me was to run the Mint "Disks" utility and select "Repair filesystem"...

enter image description here

FumbleFingers
  • 226
  • 2
  • 13
4

I had this problem occur on several USB sticks. Each time I searched for an answer and tried various suggestions, including using Terminal to run commands, reformatting on both Linux and Windows machines, etc. All to no avail.

It happened to me again today so again I went looking to see if I could find a solution. I tried the things here, but they didn't work.

Out of desperation I again went to Disk Utility. I unmounted the drive and then hit "Format" on the partition portion, not the drive portion - USB only had the single partition. This time it WORKED!!!!. Then I went to the drive portion and again reformatted the single partition as a master boot drive and monkeyed a bit more with it.

The upshot is, I'm now able to read and write to the drive again.

I don't know if I just got lucky this time or not. But it is working again.

Zanna
  • 70,465
Ned
  • 51
3

In Case of Dual Booting Operating System (for me Windows 10 and Linux Mint 19.1), when windows10 was not properly shutdown, this problem will occur to my disk partition on the Linux,

The Solution is to start up the Windows 10 then shut it down properly.

Now you can write file to the partition on Linux again.

Hope this will help

3

If the USB stick is mounted as read-only. Go to Disk Utility and unmount the disk. Then click on Check Filesystem if there are no problems remount the disk. After mounting the disk it should work correctly, at least that is how I solved this problem.

Braiam
  • 67,791
  • 32
  • 179
  • 269
SunTaoRus
  • 39
  • 1
2

In case it is a fixed drive and not a removable drive, you can add the entry permanently.

sudo vi /etc/fstab

Add an entry in the following format:

<file-system> <mount-point> <type> <options> <dump> <pass>

And then do:

mount -a
Tarun
  • 21