(转)linux常见故障一:linux 文件系统变只读

linux常见故障一:linux 文件系统变只读

原文:https://www.cnblogs.com/ginvip/p/6375672.html

1. 重启系统看是否可以自动修复。

2. 使用fsck -y /dev/sda1 进行自动修复。(用”-y”选项来执行该命令对硬盘进行检查和修复)
添加参数:fsck -y -C -t ext3 /dev/sda1 (一般情况下修复完成后,所有文件移动到 lost+found目录,文件名会被改变)
(-C 显示进度条 -t 指定文件系统类型 -y 默认自动yes修复)

3. 如果fsck修复完成后,启动系统依然自读。
查看分区结构:

1
2
3
4
5
6
7
8
[root@localhost ~]# more /etc/fstab
   
[root@localhost ~]# more /proc/mounts
 
[root@localhost ~]# mount
/dev/sda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)


[root@localhost ~]# more /etc/fstab

[root@localhost ~]# more /proc/mounts

[root@localhost ~]# mount
/dev/sda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
查看ro挂载的分区,如果发现有ro,就重新mount

1
2
umount /dev/sda1
mount /dev/sda1 /boot


umount /dev/sda1
mount /dev/sda1 /boot
如果发现有提示“device is busy”,找到是什么进程使得他busy

1
2
fuser -m /boot ##将会显示使用这个模块的pid
fuser -mk /boot ##将会直接kill那个pid


fuser -m /boot ##将会显示使用这个模块的pid
fuser -mk /boot ##将会直接kill那个pid
然后重新mount即可。

4. 直接remount

[root@localhost ~]# mount -o rw,remount /dev/sda1


[root@localhost ~]# mount -o rw,remount /dev/sda1

原文地址:https://www.cnblogs.com/liujiacai/p/8433434.html