Perfect solution to linux U disk file read only problem
- 2020-05-15 03:20:17
- OfStack
1. Run the following command on the terminal
tail -f /var/log/syslog
2. Insert U disk with a read-only file system failure
3. Watch the command line output
The output part is as follows:
Jul 8 16:44:50 cslouis-pc kernel: [15595.155904] FAT: Filesystem error (dev sdb4)
Jul 8 16:44:50 cslouis-pc kernel: [15595.155905] fat_get_cluster: invalid cluster chain (i_pos 0)
It can be seen from the above that the file system mounted by U disk is /dev/sdb4, and the file system has failed (FAT: Filesystem error).
4. Enter the following command:
umount /media/ZCF(ZCF is your U drive name, which can be viewed using ls in the media directory)
5. Fix U disk file system failure
sudo dosfsck -v -a /dev/sdb4
After the above five steps, the U disk can resume reading and writing.