linux开机文件系统mount错误处理

By | 2016年4月2日

Checking filesystems
Checking all file systems.
[/sbin/fsck.ext4 (1) — /] fsck.ext4 -a /dev/mapper/VolGroup-lv_root 
/dev/mapper/VolGroup-lv_root: clean, 48362/1150560 files, 671788/4597760 blocks
[/sbin/fsck.ext4 (1) — /boot] fsck.ext4 -a /dev/xvda1 
/dev/xvda1: clean, 38/128016 files, 57625/512000 blocks
[/sbin/fsck.ext4 (1) — /dev/xvdb] fsck.ext4 -a /sdb 
fsck.ext4: Is a directory while trying to open /sdb
/sdb: 
The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

上面是fstab错误,修改/etc/fstab文件,造成linux无法启动,修复:
1.启动linux提示失败,输入root账户密码,进入 repair filesystem#,注意此时修复fstab文件会提示readonly无法保存修改。
2.mount / -o remount
3.修改fstab文件 vi /etc/fstab
4.:wq 保存退出
5.reboot

一般挂载时,可以用
echo "/dev/sdb /mnt ext4 default 0 1" >> /etc/fstab
或者直接改fstab
vi /etc/fstab
/dev/sdb /mnt ext4 default 0 1

改好后, 请一定用mount -a 进行挂在载测试。修改前最好做个备份cp /etc/fstab /etc/fstab.bak