我操作一个远程服务器(Ubuntu Server 14.04)。重新启动时,它停止并显示:
Errors were found while checking the disk drive for /.
keys:Press F to attempt to fix the errors, I to ignore, S to skip mounting, or M for manual recovery
我无法按任何键,所以我需要启动到恢复模式。我这样做了。在那里我执行了
fsck -y /dev/sda
sda 和 sdb 很忙。它只适用于 /dev/md12[4567]。
使用 lsof 时,它没有显示 /dev/sd[ab] 的任何使用情况
我该如何正确修复我的系统?
我建议的解决方案是:touch /forcefsck
,这应该可以修复磁盘错误。所以我挂载了我的 raid 分区 /dev/mdX 并在其上创建了 forcefsck。但在启动过程中什么都没有出现。但 ubuntu 挂载脚本在第 3 行包含检查(见下文)。
这就是我被困住的地方:
我无法让 forcefsck 和 fsck 工作。如何正确修复我的文件系统(或让它们工作)?
/mnt/etc/init/mountall.conf
:
script
. /etc/default/rcS || true
[ -f /forcefsck ] && force_fsck="--force-fsck"
[ "$FSCKFIX" = "yes" ] && fsck_fix="--fsck-fix"
# Doesn't work so well if mountall is responsible for mounting /proc, heh.
if [ -e /proc/cmdline ]; then
read line < /proc/cmdline
for arg in $line; do
case $arg in
-q|--quiet|-v|--verbose|--debug)
debug_arg=$arg
;;
esac
done < /proc/cmdline
fi
# set $LANG so that messages appearing in plymouth are translated
if [ -r /etc/default/locale ]; then
. /etc/default/locale || true
export LANG LANGUAGE LC_MESSAGES LC_ALL
fi
exec mountall --daemon $force_fsck $fsck_fix $debug_arg
end script
这是我的输出fdisk -l
:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7ea9111b
Device Boot Start End Blocks Id System
/dev/sda1 2048 2050047 1024000 fd Linux raid autodetect
/dev/sda2 2050048 10049535 3999744 82 Linux swap / Solaris
/dev/sda3 10049536 51009535 20480000 fd Linux raid autodetect
/dev/sda4 51009536 976771071 462880768 f W95 Ext'd (LBA)
/dev/sda5 51011584 606468095 277728256 fd Linux raid autodetect
/dev/sda6 606470144 976769023 185149440 fd Linux raid autodetect
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x203e3ae7
Device Boot Start End Blocks Id System
/dev/sdb1 2048 2050047 1024000 fd Linux raid autodetect
/dev/sdb2 2050048 10049535 3999744 82 Linux swap / Solaris
/dev/sdb3 10049536 51009535 20480000 fd Linux raid autodetect
/dev/sdb4 51009536 976771071 462880768 f W95 Ext'd (LBA)
/dev/sdb5 51011584 606468095 277728256 fd Linux raid autodetect
/dev/sdb6 606470144 976769023 185149440 fd Linux raid autodetect
Disk /dev/md127: 189.6 GB, 189592895488 bytes
2 heads, 4 sectors/track, 46287328 cylinders, total 370298624 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/md127 doesn't contain a valid partition table
Disk /dev/md126: 284.4 GB, 284393537536 bytes
2 heads, 4 sectors/track, 69432016 cylinders, total 555456128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/md126 doesn't contain a valid partition table
Disk /dev/md125: 21.0 GB, 20971388928 bytes
2 heads, 4 sectors/track, 5119968 cylinders, total 40959744 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/md125 doesn't contain a valid partition table
Disk /dev/md124: 1048 MB, 1048510464 bytes
2 heads, 4 sectors/track, 255984 cylinders, total 2047872 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/md124 doesn't contain a valid partition table
这是我的整个启动日志:http://pastebin.com/raw/mTDL6KVk
在这里你可以看到我的 raid 1 状态:
~# cat /proc/mdstat
Personalities : [raid1]
md124 : active raid1 sda1[0] sdb1[1]
1023936 blocks super 1.0 [2/2] [UU]
md125 : active raid1 sda3[0] sdb3[1]
20479872 blocks super 1.0 [2/2] [UU]
md126 : active raid1 sda5[0] sdb5[1]
277728064 blocks super 1.0 [2/2] [UU]
bitmap: 0/3 pages [0KB], 65536KB chunk
md127 : active raid1 sda6[0] sdb6[1]
185149312 blocks super 1.0 [2/2] [UU]
bitmap: 0/2 pages [0KB], 65536KB chunk
unused devices: <none>