当前位置: 首页>>技术教程>>正文


Amazon EC2上的Ubuntu 12.04:/dev/xvda1将在下次重启时检查错误吗?

,

问题描述

我正在亚马逊EC2上运行最新的Ubuntu 12.04 AMI(ami-a29943cb)from Canonical,并且在我登录时经常收到消息:

*** /dev/xvda1 will be checked for errors at next reboot ***

我已经阅读了大量关于此的文档并且似乎明白每次重启(大约37次,请参阅下面的Mount count /Maximum mount count)Ubuntu想要检查磁盘是否有错误。通过使用dumpe2fs -h /dev/xvda1(reference)获取以下信息,我可以看到:

Last mounted on:          /
Filesystem UUID:          1ad27d06-4ecf-493d-bb19-4710c3caf924
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash 
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              524288
Block count:              2097152
Reserved block count:     104857
Free blocks:              1778055
Free inodes:              482659
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      511
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Tue Apr 24 03:07:48 2012
Last mount time:          Thu Nov  8 03:17:58 2012
Last write time:          Tue Apr 24 03:08:52 2012
Mount count:              3
Maximum mount count:      37
Last checked:             Tue Apr 24 03:07:48 2012
Check interval:           15552000 (6 months)
Next check after:         Sun Oct 21 03:07:48 2012
Lifetime writes:          2454 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:           256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      0a25e04c-6169-4d68-bfa6-a1acd8e39632
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke
Journal size:             128M
Journal length:           32768
Journal sequence:         0x0000158b
Journal start:            1

我已经尝试过这些东西来消除这个消息,通常badblocks对我来说是什么:

运行此命令并重新启动:

sudo touch /forcefsck

运行badblocks来检查磁盘:

badblocks /dev/sda1

编辑/etc/fstab并相应地更改最后一个”0″,即fs_passno列,然后重新启动:

The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2.

我不明白:

  1. 如果这是一个虚拟驱动器不应该不容易出错?

  2. 是否设置了其中一个标志创建的图像?如果不是什么触发它?

  3. 为什么fs_passno在Amazon EC2 Ubuntu映像上设置为0?这不是第一个这样的。

最佳解决方案

Why is fs_passno set to 0 on Amazon EC2 Ubuntu images?

如果fsck在启动时运行并发现问题,那么它可能正在等待提示的答案。但是,由于Amazon EC2不提供对实例上控制台的访问权限,因此无法回答提示,实例将无法使用。


关联Q& A:

次佳解决方案

来自Eric的linked Q&A,简短版本是:

It is a bug on Ubuntu 11.04 and 12.04 … which causes a file to be created with a future time stamp that contains that message.

解决此错误的最简单方法是删除通知文件:

sudo rm /var/lib/update-notifier/fsck-at-reboot

其他处理方法可以在Q&A中找到。

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/6777.html,未经允许,请勿转载。