网上有很多,出现次数比较多的是这一种说法(但是不适用我的情况):
转自:http://blog.csdn.net/slj_win/article/details/50349976
在Windows下,U盘能够正常地读写文件(能复制粘贴),但发现有个文件打不开。然后在Ubuntu Linux下,U对U盘只能读不能写。提示:Read only system.
参考:https://bugs.launchpad.NET/ubuntu/+bug/228608
1,# tail -f /var/log/syslog 查看文件系统的动态信息
May 19 21:31:28 controller kernel: [284792.451452] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
2,df -h 确定U盘的磁盘基本情况
/dev/sdb1 15G 7.8G 6.9G 54% /media/Hadoop/disk
3,运行命令:# fsck -C -a /dev/sdb1 进行自动修复...居然修复成功,而且打不开的文件也完好无缺能够打开了。感叹linux的强大。
还有说重新挂载(不太懂挂载之类的,,确认指令不是错的,照着来了一遍,,,不行):
转载自:http://blog.csdn.net/Lj_550566181/article/details/53924099
$ df -h
可以发现文件系统的路径为/dev/sdd4
$ mount -o remount,rw /dev/sdd4
# /dev/sdd4需要替换成自己看到的文件系统路径
Linux下使用U盘时,在没有卸载的情况下擅自拔出U盘后,U盘成为只读文件系统,说下修复的办法。
环境:
OS
今天向U盘上拷了文件后,没有卸载就拔了U盘,再插上电脑,稍等片刻时,发现成为只读文件系统。尝试使用sudo chmod a+w /U
,显示为只读文件系统。只好查看打印的系统信息
查看系统打印信息:
$
看到如下内容:
[29153.253989] usb 2-1.2.3.3: new full-speed USB device number 40 using ehci-pci
[29153.423524] usb 2-1.2.3.3: not running at top speed; connect to a high speed hub
[29153.431450] scsi20 : usb-storage 2-1.2.3.3:1.0
[29154.435792] scsi 20:0:0:0: Direct-Access Generic Flash Disk 8.07 PQ: 0 ANSI: 2
[29154.437255] sd 20:0:0:0: [sdb] 8212480 512-byte logical blocks: (4.20 GB/3.91 GiB)
[29154.438207] sd 20:0:0:0: [sdb] Write Protect is off
[29154.438214] sd 20:0:0:0: [sdb] Mode Sense: 03 00 00 00
[29154.438930] sd 20:0:0:0: [sdb] No Caching mode page present
[29154.438934] sd 20:0:0:0: [sdb] Assuming drive cache: write through
[29154.442123] sd 20:0:0:0: [sdb] No Caching mode page present
[29154.442128] sd 20:0:0:0: [sdb] Assuming drive cache: write through
[29154.473636] sdb: sdb1
[29154.476380] sd 20:0:0:0: [sdb] No Caching mode page present
[29154.476388] sd 20:0:0:0: [sdb] Assuming drive cache: write through
[29154.476404] sd 20:0:0:0: [sdb] Attached SCSI removable disk
[29155.527602] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[29167.626139] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 2111071)
[29167.626143] FAT-fs (sdb1): Filesystem has been set read-only
[29167.626154] FAT-fs (sdb1): error, fat_get_cluster: invalid cluster chain (i_pos 2111071)
写的很明白,被不适当的卸载造成有些数据错误,请使用fsck修复。
使用fsck修复:(sdb1是U盘的分区)
do fsck -fy /dev/sdb1
含义:肯定回答修复损坏的扇区,保险起见可以不加f与y。
修复后,正常卸载U盘,再插上U盘:
$
看到:
[29665.364058] usb 2-1.2.3.3: new full-speed USB device number 43 using ehci-pci
[29665.543688] usb 2-1.2.3.3: not running at top speed; connect to a high speed hub
[29665.551693] scsi23 : usb-storage 2-1.2.3.3:1.0
[29666.555758] scsi 23:0:0:0: Direct-Access Generic Flash Disk 8.07 PQ: 0 ANSI: 2
[29666.557362] sd 23:0:0:0: [sdb] 8212480 512-byte logical blocks: (4.20 GB/3.91 GiB)
[29666.557984] sd 23:0:0:0: [sdb] Write Protect is off
[29666.557987] sd 23:0:0:0: [sdb] Mode Sense: 03 00 00 00
[29666.558605] sd 23:0:0:0: [sdb] No Caching mode page present
[29666.558608] sd 23:0:0:0: [sdb] Assuming drive cache: write through
[29666.561606] sd 23:0:0:0: [sdb] No Caching mode page present
[29666.561609] sd 23:0:0:0: [sdb] Assuming drive cache: write through
[29666.893013] sdb: sdb1
[29666.895352] sd 23:0:0:0: [sdb] No Caching mode page present
[29666.895357] sd 23:0:0:0: [sdb] Assuming drive cache: write through
[29666.895361] sd 23:0:0:0: [sdb] Attached SCSI removable disk
打开U盘,可以正常读写了。