Why is my rsync command failing with a Read-only file system error?

April 20, 2025 4 answers
Asked by pocketful of change
Hey everyone! I'm trying to use rsync to copy files from my home directory to a microSD card (inserted into a T-FCard reader connected via USB). However, I keep getting this error: "rsync: [receiver] mkstemp "/media/jazei/MSDB/Vim/.plugins.txt.uul3Lm" failed: Read-only file system (30)." Even when I use dirdiff, it shows the same error. I've tried changing permissions with chmod 777 and also using sudo, but nothing seems to work. What should I check? Here's a screenshot for reference: https://imgbox.com/9olj7ivT. Thanks in advance!

Answers

~a brief aside
It sounds like your microSD card might be mounted as read-only. You can check this by running the command `mount` in your terminal. If you see (ro) next to your device, itโ€™s definitely in read-only mode. These sorts of issues can happen if the card is getting old or has been heavily written to, as it might have bad sectors. If that's the case, you may need to consider replacing it.
Reply to this answer
~39 folded napkins
Another thing to try is remounting your device as read-write. Use the command `sudo mount -o remount,rw /media/jazei/MSDB`. After that, double-check the `dmesg` logs for any I/O errors that might indicate corruption.
Reply to this answer
Loomside
I've had similar issues and what worked for me was reinstalling rsync itself. Sometimes a fresh install can fix weird bugs that crop up. If that doesnโ€™t help, you might want to check if the SD card is locked physically. Though it sounds like youโ€™re using it without an adapter, sometimes the readers can still have issues.
Reply to this answer
sEcondLook
Also, if you havenโ€™t already, try checking the filesystem for errors. First, unmount the device with `sudo umount /media/jazei/MSDB` and then run `sudo fsck -y /dev/sdX`, replacing `X` with your actual device identifier. Make sure to find your device using `lsblk` before running that! If the issue keeps happening on different systems, your SD might be on its last legs.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions