Can't delete from SD card, 'Read-only file system'Error mounting a CF cardFile system that never breaks (data loss acceptable)mounting a SD card without a partitionCan't mount SD card - Wrong filesystemHow to create a new partitioning table on SD card from the command line ?How to finally mount FAT16 USB flash driveconverting partition on the SD card to FATCan't remove a file in a partition in SD cardHow does the kernel decide to make an SD card filesystem read-only?Why does my SD card change to readonly when I mounted it as readwrite?
What is it called when one voice type sings a 'solo'?
How can I fix this gap between bookcases I made?
Is domain driven design an anti-SQL pattern?
When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?
Finding files for which a command fails
Prime joint compound before latex paint?
Manga about a female worker who got dragged into another world together with this high school girl and she was just told she's not needed anymore
Email Account under attack (really) - anything I can do?
Could Giant Ground Sloths have been a good pack animal for the ancient Mayans?
Lied on resume at previous job
What do the Banks children have against barley water?
Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?
What are the advantages and disadvantages of running one shots compared to campaigns?
Why airport relocation isn't done gradually?
aging parents with no investments
Can a planet have a different gravitational pull depending on its location in orbit around its sun?
Why was the "bread communication" in the arena of Catching Fire left out in the movie?
Need help identifying/translating a plaque in Tangier, Morocco
Landlord wants to switch my lease to a "Land contract" to "get back at the city"
Domain expired, GoDaddy holds it and is asking more money
map list to bin numbers
Pristine Bit Checking
What is the meaning of "of trouble" in the following sentence?
What is the offset in a seaplane's hull?
Can't delete from SD card, 'Read-only file system'
Error mounting a CF cardFile system that never breaks (data loss acceptable)mounting a SD card without a partitionCan't mount SD card - Wrong filesystemHow to create a new partitioning table on SD card from the command line ?How to finally mount FAT16 USB flash driveconverting partition on the SD card to FATCan't remove a file in a partition in SD cardHow does the kernel decide to make an SD card filesystem read-only?Why does my SD card change to readonly when I mounted it as readwrite?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm using Ubuntu 14.04.
I have an SD card that I use with my camera, and I'm trying to delete photos from it. I was able to move them to the Trash, but when I try to delete any of the files out of the Trash I get Failed to delete the item from the trash
.
I can navigate to the .Trash-1000/files
directory on the device, but when I try to sudo rm
the files, I get rm: cannot remove ‘IMG_1483.JPG’: Read-only file system
.
mount
gives me this:
/dev/sdb1 on /media/zack/6562-61611 type vfat (ro,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
I tried re-mounting the device using sudo mount /dev/sdb1 /media/zack/SD -o rw,dmask=0000
and got the same error when I tried to delete the files.
Finally, I have checked the switch on the card itself and confirmed it's in the unlocked position. I tried switching it to locked just in case it was a goofy card and I couldn't delete off of it then either.
What's going on here? How can I get rid of these files?
Update 1: I tried a couple other things in response to aventurin's comment. I took a new picture, then tried to sudo rm
it and that worked. When I went back to .Trash-1000/files
and tried it again, I was able to delete some files but not others:
$ ls
100___12
101___01
102___02 # directories
103___03
...
IMG_1365.JPG
IMG_1374.JPG
IMG_1375.JPG
IMG_1380.JPG
...
$ sudo rm -rvf *.JPG
removed ‘IMG_1365.JPG’
removed ‘IMG_1374.JPG’
removed ‘IMG_1375.JPG’
rm: cannot remove ‘IMG_1380.JPG’: Read-only file system
rm: cannot remove ‘IMG_1381.JPG’: Read-only file system
rm: cannot remove ‘IMG_1383.JPG’: Read-only file system
...
...and so on. I did an ll
right before I deleted those files, and the permissions for all of the .JPG files look exactly the same.
Update 2:
$ dmesg | grep sdb1
[ 714.950034] FAT-fs (sdb1): error, invalid access to FAT (entry 0x6ce0c8c0)
... # a bunch more of those
[ 2192.017345] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 2192.663466] sdb1: rw=0, want=105540772768, limit=62325760
[ 2192.663470] sdb1: rw=0, want=105540772744, limit=62325760
[ 2192.663499] FAT-fs (sdb1): error, invalid access to FAT (entry 0xad23600b)
[ 2192.663501] FAT-fs (sdb1): Filesystem has been set read-only
[ 2192.663601] FAT-fs (sdb1): error, invalid access to FAT (entry 0x58f3a807)
[ 2271.537913] sdb: sdb1
[ 2273.782060] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 2407.374492] FAT-fs (sdb1): error, fat_free_clusters: deleting FAT entry beyond EOF
[ 2407.374496] FAT-fs (sdb1): Filesystem has been set read-only
I tried sudo fsck /dev/sdb1
and got a lot of errors:
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 1
...
/.Trash-1000/files/IMG_1483.JPG and
/.Trash-1000/files/117___09/IMG_1737.JPG
share clusters.
1) Truncate first to 5439488 bytes
2) Truncate second to 0 bytes
? 1
I told it to fix them all, but when I run it again they all show up again.
Update 3:
I unmounted the card, and ran sudo fsck /dev/sdb1 -a
. It ran for about 6 hours and still wasn't finished so I eventually Ctrl-C'd it. It mostly seemed to be renaming files with corruped usernames, and was up to almost 18000 files renamed before I killed it (I've certainly never taken that many photos before...).
I then tried sudo mount /dev/sdb1 /media/zack/SD -v -o rw
and got this output:
$ sudo mount /dev/sdb1 /media/zack/SD -v -o rw
mount: you didn't specify a filesystem type for /dev/sdb1
I will try type vfat
/dev/sdb1 on /media/zack/SD type vfat (rw)
Despite not having an error, I still cannot delete the files and get the same old "read-only file system" error.
mount sd-card
|
show 6 more comments
I'm using Ubuntu 14.04.
I have an SD card that I use with my camera, and I'm trying to delete photos from it. I was able to move them to the Trash, but when I try to delete any of the files out of the Trash I get Failed to delete the item from the trash
.
I can navigate to the .Trash-1000/files
directory on the device, but when I try to sudo rm
the files, I get rm: cannot remove ‘IMG_1483.JPG’: Read-only file system
.
mount
gives me this:
/dev/sdb1 on /media/zack/6562-61611 type vfat (ro,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
I tried re-mounting the device using sudo mount /dev/sdb1 /media/zack/SD -o rw,dmask=0000
and got the same error when I tried to delete the files.
Finally, I have checked the switch on the card itself and confirmed it's in the unlocked position. I tried switching it to locked just in case it was a goofy card and I couldn't delete off of it then either.
What's going on here? How can I get rid of these files?
Update 1: I tried a couple other things in response to aventurin's comment. I took a new picture, then tried to sudo rm
it and that worked. When I went back to .Trash-1000/files
and tried it again, I was able to delete some files but not others:
$ ls
100___12
101___01
102___02 # directories
103___03
...
IMG_1365.JPG
IMG_1374.JPG
IMG_1375.JPG
IMG_1380.JPG
...
$ sudo rm -rvf *.JPG
removed ‘IMG_1365.JPG’
removed ‘IMG_1374.JPG’
removed ‘IMG_1375.JPG’
rm: cannot remove ‘IMG_1380.JPG’: Read-only file system
rm: cannot remove ‘IMG_1381.JPG’: Read-only file system
rm: cannot remove ‘IMG_1383.JPG’: Read-only file system
...
...and so on. I did an ll
right before I deleted those files, and the permissions for all of the .JPG files look exactly the same.
Update 2:
$ dmesg | grep sdb1
[ 714.950034] FAT-fs (sdb1): error, invalid access to FAT (entry 0x6ce0c8c0)
... # a bunch more of those
[ 2192.017345] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 2192.663466] sdb1: rw=0, want=105540772768, limit=62325760
[ 2192.663470] sdb1: rw=0, want=105540772744, limit=62325760
[ 2192.663499] FAT-fs (sdb1): error, invalid access to FAT (entry 0xad23600b)
[ 2192.663501] FAT-fs (sdb1): Filesystem has been set read-only
[ 2192.663601] FAT-fs (sdb1): error, invalid access to FAT (entry 0x58f3a807)
[ 2271.537913] sdb: sdb1
[ 2273.782060] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 2407.374492] FAT-fs (sdb1): error, fat_free_clusters: deleting FAT entry beyond EOF
[ 2407.374496] FAT-fs (sdb1): Filesystem has been set read-only
I tried sudo fsck /dev/sdb1
and got a lot of errors:
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 1
...
/.Trash-1000/files/IMG_1483.JPG and
/.Trash-1000/files/117___09/IMG_1737.JPG
share clusters.
1) Truncate first to 5439488 bytes
2) Truncate second to 0 bytes
? 1
I told it to fix them all, but when I run it again they all show up again.
Update 3:
I unmounted the card, and ran sudo fsck /dev/sdb1 -a
. It ran for about 6 hours and still wasn't finished so I eventually Ctrl-C'd it. It mostly seemed to be renaming files with corruped usernames, and was up to almost 18000 files renamed before I killed it (I've certainly never taken that many photos before...).
I then tried sudo mount /dev/sdb1 /media/zack/SD -v -o rw
and got this output:
$ sudo mount /dev/sdb1 /media/zack/SD -v -o rw
mount: you didn't specify a filesystem type for /dev/sdb1
I will try type vfat
/dev/sdb1 on /media/zack/SD type vfat (rw)
Despite not having an error, I still cannot delete the files and get the same old "read-only file system" error.
mount sd-card
Does rm as root work? Does rm work for files not in trash?
– aventurin
Sep 5 '16 at 16:57
@aventurin, sorry, I should have specified that I was usingsudo
for just about everything. I've updated the question with that change, as well as the results of your second suggestion.
– Zack
Sep 5 '16 at 17:13
Does dmesg show any errors related to the SD card?
– aventurin
Sep 5 '16 at 17:19
@aventurin, updated the question again.
– Zack
Sep 5 '16 at 17:28
1
Some SD cards have an mechanical RW lock. Does yours?
– Serge
Sep 5 '16 at 19:05
|
show 6 more comments
I'm using Ubuntu 14.04.
I have an SD card that I use with my camera, and I'm trying to delete photos from it. I was able to move them to the Trash, but when I try to delete any of the files out of the Trash I get Failed to delete the item from the trash
.
I can navigate to the .Trash-1000/files
directory on the device, but when I try to sudo rm
the files, I get rm: cannot remove ‘IMG_1483.JPG’: Read-only file system
.
mount
gives me this:
/dev/sdb1 on /media/zack/6562-61611 type vfat (ro,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
I tried re-mounting the device using sudo mount /dev/sdb1 /media/zack/SD -o rw,dmask=0000
and got the same error when I tried to delete the files.
Finally, I have checked the switch on the card itself and confirmed it's in the unlocked position. I tried switching it to locked just in case it was a goofy card and I couldn't delete off of it then either.
What's going on here? How can I get rid of these files?
Update 1: I tried a couple other things in response to aventurin's comment. I took a new picture, then tried to sudo rm
it and that worked. When I went back to .Trash-1000/files
and tried it again, I was able to delete some files but not others:
$ ls
100___12
101___01
102___02 # directories
103___03
...
IMG_1365.JPG
IMG_1374.JPG
IMG_1375.JPG
IMG_1380.JPG
...
$ sudo rm -rvf *.JPG
removed ‘IMG_1365.JPG’
removed ‘IMG_1374.JPG’
removed ‘IMG_1375.JPG’
rm: cannot remove ‘IMG_1380.JPG’: Read-only file system
rm: cannot remove ‘IMG_1381.JPG’: Read-only file system
rm: cannot remove ‘IMG_1383.JPG’: Read-only file system
...
...and so on. I did an ll
right before I deleted those files, and the permissions for all of the .JPG files look exactly the same.
Update 2:
$ dmesg | grep sdb1
[ 714.950034] FAT-fs (sdb1): error, invalid access to FAT (entry 0x6ce0c8c0)
... # a bunch more of those
[ 2192.017345] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 2192.663466] sdb1: rw=0, want=105540772768, limit=62325760
[ 2192.663470] sdb1: rw=0, want=105540772744, limit=62325760
[ 2192.663499] FAT-fs (sdb1): error, invalid access to FAT (entry 0xad23600b)
[ 2192.663501] FAT-fs (sdb1): Filesystem has been set read-only
[ 2192.663601] FAT-fs (sdb1): error, invalid access to FAT (entry 0x58f3a807)
[ 2271.537913] sdb: sdb1
[ 2273.782060] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 2407.374492] FAT-fs (sdb1): error, fat_free_clusters: deleting FAT entry beyond EOF
[ 2407.374496] FAT-fs (sdb1): Filesystem has been set read-only
I tried sudo fsck /dev/sdb1
and got a lot of errors:
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 1
...
/.Trash-1000/files/IMG_1483.JPG and
/.Trash-1000/files/117___09/IMG_1737.JPG
share clusters.
1) Truncate first to 5439488 bytes
2) Truncate second to 0 bytes
? 1
I told it to fix them all, but when I run it again they all show up again.
Update 3:
I unmounted the card, and ran sudo fsck /dev/sdb1 -a
. It ran for about 6 hours and still wasn't finished so I eventually Ctrl-C'd it. It mostly seemed to be renaming files with corruped usernames, and was up to almost 18000 files renamed before I killed it (I've certainly never taken that many photos before...).
I then tried sudo mount /dev/sdb1 /media/zack/SD -v -o rw
and got this output:
$ sudo mount /dev/sdb1 /media/zack/SD -v -o rw
mount: you didn't specify a filesystem type for /dev/sdb1
I will try type vfat
/dev/sdb1 on /media/zack/SD type vfat (rw)
Despite not having an error, I still cannot delete the files and get the same old "read-only file system" error.
mount sd-card
I'm using Ubuntu 14.04.
I have an SD card that I use with my camera, and I'm trying to delete photos from it. I was able to move them to the Trash, but when I try to delete any of the files out of the Trash I get Failed to delete the item from the trash
.
I can navigate to the .Trash-1000/files
directory on the device, but when I try to sudo rm
the files, I get rm: cannot remove ‘IMG_1483.JPG’: Read-only file system
.
mount
gives me this:
/dev/sdb1 on /media/zack/6562-61611 type vfat (ro,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
I tried re-mounting the device using sudo mount /dev/sdb1 /media/zack/SD -o rw,dmask=0000
and got the same error when I tried to delete the files.
Finally, I have checked the switch on the card itself and confirmed it's in the unlocked position. I tried switching it to locked just in case it was a goofy card and I couldn't delete off of it then either.
What's going on here? How can I get rid of these files?
Update 1: I tried a couple other things in response to aventurin's comment. I took a new picture, then tried to sudo rm
it and that worked. When I went back to .Trash-1000/files
and tried it again, I was able to delete some files but not others:
$ ls
100___12
101___01
102___02 # directories
103___03
...
IMG_1365.JPG
IMG_1374.JPG
IMG_1375.JPG
IMG_1380.JPG
...
$ sudo rm -rvf *.JPG
removed ‘IMG_1365.JPG’
removed ‘IMG_1374.JPG’
removed ‘IMG_1375.JPG’
rm: cannot remove ‘IMG_1380.JPG’: Read-only file system
rm: cannot remove ‘IMG_1381.JPG’: Read-only file system
rm: cannot remove ‘IMG_1383.JPG’: Read-only file system
...
...and so on. I did an ll
right before I deleted those files, and the permissions for all of the .JPG files look exactly the same.
Update 2:
$ dmesg | grep sdb1
[ 714.950034] FAT-fs (sdb1): error, invalid access to FAT (entry 0x6ce0c8c0)
... # a bunch more of those
[ 2192.017345] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 2192.663466] sdb1: rw=0, want=105540772768, limit=62325760
[ 2192.663470] sdb1: rw=0, want=105540772744, limit=62325760
[ 2192.663499] FAT-fs (sdb1): error, invalid access to FAT (entry 0xad23600b)
[ 2192.663501] FAT-fs (sdb1): Filesystem has been set read-only
[ 2192.663601] FAT-fs (sdb1): error, invalid access to FAT (entry 0x58f3a807)
[ 2271.537913] sdb: sdb1
[ 2273.782060] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 2407.374492] FAT-fs (sdb1): error, fat_free_clusters: deleting FAT entry beyond EOF
[ 2407.374496] FAT-fs (sdb1): Filesystem has been set read-only
I tried sudo fsck /dev/sdb1
and got a lot of errors:
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 1
...
/.Trash-1000/files/IMG_1483.JPG and
/.Trash-1000/files/117___09/IMG_1737.JPG
share clusters.
1) Truncate first to 5439488 bytes
2) Truncate second to 0 bytes
? 1
I told it to fix them all, but when I run it again they all show up again.
Update 3:
I unmounted the card, and ran sudo fsck /dev/sdb1 -a
. It ran for about 6 hours and still wasn't finished so I eventually Ctrl-C'd it. It mostly seemed to be renaming files with corruped usernames, and was up to almost 18000 files renamed before I killed it (I've certainly never taken that many photos before...).
I then tried sudo mount /dev/sdb1 /media/zack/SD -v -o rw
and got this output:
$ sudo mount /dev/sdb1 /media/zack/SD -v -o rw
mount: you didn't specify a filesystem type for /dev/sdb1
I will try type vfat
/dev/sdb1 on /media/zack/SD type vfat (rw)
Despite not having an error, I still cannot delete the files and get the same old "read-only file system" error.
mount sd-card
mount sd-card
edited Sep 5 '16 at 23:45
Zack
asked Sep 5 '16 at 16:48
ZackZack
814
814
Does rm as root work? Does rm work for files not in trash?
– aventurin
Sep 5 '16 at 16:57
@aventurin, sorry, I should have specified that I was usingsudo
for just about everything. I've updated the question with that change, as well as the results of your second suggestion.
– Zack
Sep 5 '16 at 17:13
Does dmesg show any errors related to the SD card?
– aventurin
Sep 5 '16 at 17:19
@aventurin, updated the question again.
– Zack
Sep 5 '16 at 17:28
1
Some SD cards have an mechanical RW lock. Does yours?
– Serge
Sep 5 '16 at 19:05
|
show 6 more comments
Does rm as root work? Does rm work for files not in trash?
– aventurin
Sep 5 '16 at 16:57
@aventurin, sorry, I should have specified that I was usingsudo
for just about everything. I've updated the question with that change, as well as the results of your second suggestion.
– Zack
Sep 5 '16 at 17:13
Does dmesg show any errors related to the SD card?
– aventurin
Sep 5 '16 at 17:19
@aventurin, updated the question again.
– Zack
Sep 5 '16 at 17:28
1
Some SD cards have an mechanical RW lock. Does yours?
– Serge
Sep 5 '16 at 19:05
Does rm as root work? Does rm work for files not in trash?
– aventurin
Sep 5 '16 at 16:57
Does rm as root work? Does rm work for files not in trash?
– aventurin
Sep 5 '16 at 16:57
@aventurin, sorry, I should have specified that I was using
sudo
for just about everything. I've updated the question with that change, as well as the results of your second suggestion.– Zack
Sep 5 '16 at 17:13
@aventurin, sorry, I should have specified that I was using
sudo
for just about everything. I've updated the question with that change, as well as the results of your second suggestion.– Zack
Sep 5 '16 at 17:13
Does dmesg show any errors related to the SD card?
– aventurin
Sep 5 '16 at 17:19
Does dmesg show any errors related to the SD card?
– aventurin
Sep 5 '16 at 17:19
@aventurin, updated the question again.
– Zack
Sep 5 '16 at 17:28
@aventurin, updated the question again.
– Zack
Sep 5 '16 at 17:28
1
1
Some SD cards have an mechanical RW lock. Does yours?
– Serge
Sep 5 '16 at 19:05
Some SD cards have an mechanical RW lock. Does yours?
– Serge
Sep 5 '16 at 19:05
|
show 6 more comments
4 Answers
4
active
oldest
votes
Your filesystem seems to be corrupted. If you can't let fsck run until the end, I suggest reformating the card with mkfs.vfat
. But to avoid later corruption, I advise you to check your SD card with badblocks
first (you can use the destructive -w
option, but you will need to recreate the partition table afterwards - with cfdisk
, for instance).
Then, if you have any bad blocks, you can pass them to the mkfs command like so:
badblocks -w -o ~/badblocksList /dev/sda
mkfs.vfat -l ~/badblocksList /dev/sda
Note: alternatively, you can use mkfs.vfat -c
to perform a simple bad blocks check when formatting. Please also note that FAT is not a journaling filesystem, and, as such, is quite sensitive to corruption if not properly unmounted. If possible, try to avoid its use on devices you carry around.
I tried this, and it didn't find any bad blocks.mkfs.vfat
also returned an error, though I don't remember now what it was. I decided to just use gparted to reformat the card to FAT32, and it seems like everything's working now. Thanks for your help, everyone!
– Zack
Sep 8 '16 at 23:48
add a comment |
rm: cannot remove '/XXX/.Trash-1000/files/XXX.rtf': Read-only file system
Hours ago, on a USB stick, I got the same error as shown above. By googling, I found this webpage. I tried the suggested methods but to no avail. Then I started Windows in VirtualBox. Windows successfully deleted the ".Trash-1000" folder and everything inside it.
add a comment |
Actually hdparm -r0 /dev/sda1
(modify to your device path as appropriate), then ejecting and re-inserting the card worked for me. Simply remounting with the mount
command didn't.
Got the answer from https://askubuntu.com/a/342448/638715
add a comment |
I had the exact same problem. This worked for me:
Put the SD card in a USB reader
mount it
go to its folder in terminal
sudo rm -Rf .Trash-1000/
This removes your trash. Why on earth would this work?
– knezi
Jan 21 at 7:23
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f308009%2fcant-delete-from-sd-card-read-only-file-system%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your filesystem seems to be corrupted. If you can't let fsck run until the end, I suggest reformating the card with mkfs.vfat
. But to avoid later corruption, I advise you to check your SD card with badblocks
first (you can use the destructive -w
option, but you will need to recreate the partition table afterwards - with cfdisk
, for instance).
Then, if you have any bad blocks, you can pass them to the mkfs command like so:
badblocks -w -o ~/badblocksList /dev/sda
mkfs.vfat -l ~/badblocksList /dev/sda
Note: alternatively, you can use mkfs.vfat -c
to perform a simple bad blocks check when formatting. Please also note that FAT is not a journaling filesystem, and, as such, is quite sensitive to corruption if not properly unmounted. If possible, try to avoid its use on devices you carry around.
I tried this, and it didn't find any bad blocks.mkfs.vfat
also returned an error, though I don't remember now what it was. I decided to just use gparted to reformat the card to FAT32, and it seems like everything's working now. Thanks for your help, everyone!
– Zack
Sep 8 '16 at 23:48
add a comment |
Your filesystem seems to be corrupted. If you can't let fsck run until the end, I suggest reformating the card with mkfs.vfat
. But to avoid later corruption, I advise you to check your SD card with badblocks
first (you can use the destructive -w
option, but you will need to recreate the partition table afterwards - with cfdisk
, for instance).
Then, if you have any bad blocks, you can pass them to the mkfs command like so:
badblocks -w -o ~/badblocksList /dev/sda
mkfs.vfat -l ~/badblocksList /dev/sda
Note: alternatively, you can use mkfs.vfat -c
to perform a simple bad blocks check when formatting. Please also note that FAT is not a journaling filesystem, and, as such, is quite sensitive to corruption if not properly unmounted. If possible, try to avoid its use on devices you carry around.
I tried this, and it didn't find any bad blocks.mkfs.vfat
also returned an error, though I don't remember now what it was. I decided to just use gparted to reformat the card to FAT32, and it seems like everything's working now. Thanks for your help, everyone!
– Zack
Sep 8 '16 at 23:48
add a comment |
Your filesystem seems to be corrupted. If you can't let fsck run until the end, I suggest reformating the card with mkfs.vfat
. But to avoid later corruption, I advise you to check your SD card with badblocks
first (you can use the destructive -w
option, but you will need to recreate the partition table afterwards - with cfdisk
, for instance).
Then, if you have any bad blocks, you can pass them to the mkfs command like so:
badblocks -w -o ~/badblocksList /dev/sda
mkfs.vfat -l ~/badblocksList /dev/sda
Note: alternatively, you can use mkfs.vfat -c
to perform a simple bad blocks check when formatting. Please also note that FAT is not a journaling filesystem, and, as such, is quite sensitive to corruption if not properly unmounted. If possible, try to avoid its use on devices you carry around.
Your filesystem seems to be corrupted. If you can't let fsck run until the end, I suggest reformating the card with mkfs.vfat
. But to avoid later corruption, I advise you to check your SD card with badblocks
first (you can use the destructive -w
option, but you will need to recreate the partition table afterwards - with cfdisk
, for instance).
Then, if you have any bad blocks, you can pass them to the mkfs command like so:
badblocks -w -o ~/badblocksList /dev/sda
mkfs.vfat -l ~/badblocksList /dev/sda
Note: alternatively, you can use mkfs.vfat -c
to perform a simple bad blocks check when formatting. Please also note that FAT is not a journaling filesystem, and, as such, is quite sensitive to corruption if not properly unmounted. If possible, try to avoid its use on devices you carry around.
answered Sep 6 '16 at 6:27
MayeulCMayeulC
1457
1457
I tried this, and it didn't find any bad blocks.mkfs.vfat
also returned an error, though I don't remember now what it was. I decided to just use gparted to reformat the card to FAT32, and it seems like everything's working now. Thanks for your help, everyone!
– Zack
Sep 8 '16 at 23:48
add a comment |
I tried this, and it didn't find any bad blocks.mkfs.vfat
also returned an error, though I don't remember now what it was. I decided to just use gparted to reformat the card to FAT32, and it seems like everything's working now. Thanks for your help, everyone!
– Zack
Sep 8 '16 at 23:48
I tried this, and it didn't find any bad blocks.
mkfs.vfat
also returned an error, though I don't remember now what it was. I decided to just use gparted to reformat the card to FAT32, and it seems like everything's working now. Thanks for your help, everyone!– Zack
Sep 8 '16 at 23:48
I tried this, and it didn't find any bad blocks.
mkfs.vfat
also returned an error, though I don't remember now what it was. I decided to just use gparted to reformat the card to FAT32, and it seems like everything's working now. Thanks for your help, everyone!– Zack
Sep 8 '16 at 23:48
add a comment |
rm: cannot remove '/XXX/.Trash-1000/files/XXX.rtf': Read-only file system
Hours ago, on a USB stick, I got the same error as shown above. By googling, I found this webpage. I tried the suggested methods but to no avail. Then I started Windows in VirtualBox. Windows successfully deleted the ".Trash-1000" folder and everything inside it.
add a comment |
rm: cannot remove '/XXX/.Trash-1000/files/XXX.rtf': Read-only file system
Hours ago, on a USB stick, I got the same error as shown above. By googling, I found this webpage. I tried the suggested methods but to no avail. Then I started Windows in VirtualBox. Windows successfully deleted the ".Trash-1000" folder and everything inside it.
add a comment |
rm: cannot remove '/XXX/.Trash-1000/files/XXX.rtf': Read-only file system
Hours ago, on a USB stick, I got the same error as shown above. By googling, I found this webpage. I tried the suggested methods but to no avail. Then I started Windows in VirtualBox. Windows successfully deleted the ".Trash-1000" folder and everything inside it.
rm: cannot remove '/XXX/.Trash-1000/files/XXX.rtf': Read-only file system
Hours ago, on a USB stick, I got the same error as shown above. By googling, I found this webpage. I tried the suggested methods but to no avail. Then I started Windows in VirtualBox. Windows successfully deleted the ".Trash-1000" folder and everything inside it.
answered Feb 22 at 11:45
Matthew WaiMatthew Wai
1336
1336
add a comment |
add a comment |
Actually hdparm -r0 /dev/sda1
(modify to your device path as appropriate), then ejecting and re-inserting the card worked for me. Simply remounting with the mount
command didn't.
Got the answer from https://askubuntu.com/a/342448/638715
add a comment |
Actually hdparm -r0 /dev/sda1
(modify to your device path as appropriate), then ejecting and re-inserting the card worked for me. Simply remounting with the mount
command didn't.
Got the answer from https://askubuntu.com/a/342448/638715
add a comment |
Actually hdparm -r0 /dev/sda1
(modify to your device path as appropriate), then ejecting and re-inserting the card worked for me. Simply remounting with the mount
command didn't.
Got the answer from https://askubuntu.com/a/342448/638715
Actually hdparm -r0 /dev/sda1
(modify to your device path as appropriate), then ejecting and re-inserting the card worked for me. Simply remounting with the mount
command didn't.
Got the answer from https://askubuntu.com/a/342448/638715
answered Mar 28 at 13:53
Bojan BogdanovicBojan Bogdanovic
1
1
add a comment |
add a comment |
I had the exact same problem. This worked for me:
Put the SD card in a USB reader
mount it
go to its folder in terminal
sudo rm -Rf .Trash-1000/
This removes your trash. Why on earth would this work?
– knezi
Jan 21 at 7:23
add a comment |
I had the exact same problem. This worked for me:
Put the SD card in a USB reader
mount it
go to its folder in terminal
sudo rm -Rf .Trash-1000/
This removes your trash. Why on earth would this work?
– knezi
Jan 21 at 7:23
add a comment |
I had the exact same problem. This worked for me:
Put the SD card in a USB reader
mount it
go to its folder in terminal
sudo rm -Rf .Trash-1000/
I had the exact same problem. This worked for me:
Put the SD card in a USB reader
mount it
go to its folder in terminal
sudo rm -Rf .Trash-1000/
answered Dec 6 '18 at 14:32
FerroaoFerroao
12217
12217
This removes your trash. Why on earth would this work?
– knezi
Jan 21 at 7:23
add a comment |
This removes your trash. Why on earth would this work?
– knezi
Jan 21 at 7:23
This removes your trash. Why on earth would this work?
– knezi
Jan 21 at 7:23
This removes your trash. Why on earth would this work?
– knezi
Jan 21 at 7:23
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f308009%2fcant-delete-from-sd-card-read-only-file-system%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
-mount, sd-card
Does rm as root work? Does rm work for files not in trash?
– aventurin
Sep 5 '16 at 16:57
@aventurin, sorry, I should have specified that I was using
sudo
for just about everything. I've updated the question with that change, as well as the results of your second suggestion.– Zack
Sep 5 '16 at 17:13
Does dmesg show any errors related to the SD card?
– aventurin
Sep 5 '16 at 17:19
@aventurin, updated the question again.
– Zack
Sep 5 '16 at 17:28
1
Some SD cards have an mechanical RW lock. Does yours?
– Serge
Sep 5 '16 at 19:05