1
I'm trying to fix a corrupted FAT32 partition. The partition is working again, but I want to delete the remaining files containing wrong names and similar.
I have a full dump of the SD-card in question, but even if I try to mount it as writable, it's still read-only:
# losetup -o 4194304 /dev/loop0 sdcard.img
# mount -o rw,loop /dev/loop0 /mnt/sdcard
# cd /mnt/sdcard/Android/data
# rm $'\265'LI@BO\~1.APP
rm: cannot remove '\265LI@BO~1.APP': Read-only file system
Any idea how I can mount it as writable?
EDIT:
The following doesn't work either
mount -t vfat -o rw,offset=4194304,utf8,umask=0000,uid=1000,gid=1000 sdcard.img /mnt/tmp
That doesn't work either - see my update to my question. The partition is mounted correctly, and I can browse files as normal. The thing is that it's read-only although all files looks writable. – simendsjo – 2015-06-18T14:03:18.200
googling shows lots of such cases caused by corrupted filesystems. Here's an example: http://www.linuxquestions.org/questions/linux-general-1/mounted-read-write-fat32-partition-suddenly-becomes-read-only-166190/. Unmounting it then fixing it (using
– Dan Cornilescu – 2015-06-18T14:20:00.477fsck.vfat
in linux orscandisk
in windows worked for many). Make a copy beforehand.Cornielscu: Yes, I found out
fsck.vfat
had to be run many times until all errors were fixed, but forgot to update my question. Only when I looked at certain filenames would the filesystem become read-only, so I guess the driver noticed the corruption and put it in read-only to avoid further dataloss. Add an answer, and I'll accept it. – simendsjo – 2015-06-19T05:41:22.717