分页: 1 / 1

请问:如何取消硬盘挂载30次强行检查?

发表于 : 2007-05-22 15:36
tonytam
对于笔记本来说,开关机是家常菜,这30次也太强硬了吧?

发表于 : 2007-05-22 15:37
_____
把/etc/fstab每一行的最后两个数字都改成0就可以了

P.S. 强硬也是为了你好

发表于 : 2007-05-22 15:49
tonytam
谢谢,指导飞速。

发表于 : 2007-05-22 17:03
jimmin
如果嫌30次太频繁了,可以改大一点,比如100次。

代码: 全选

sudo tune2fs -c 100
不推荐关掉检查。

发表于 : 2007-05-22 17:08
_____
jimmin 写了:如果嫌30次太频繁了,可以改大一点,比如100次。

代码: 全选

sudo tune2fs -c 100
不推荐关掉检查。
:em25

发表于 : 2007-05-22 17:27
jimmin
详细的用法如下:

代码: 全选

tune2fs--调整ext2/ext3文件系统特性的工具。
-l <device> 查看文件系统信息
-c <count> 设置强制自检的挂载次数
-i <nday> 设置强制自检的时间间隔
-m <percentage> 保留块的百分比
-j 将ext2文件系统转换为ext3类型的文件系统

ext2文件系统不具备日志功能。将ext3文件系统转换为ext3类型就能为服务器增加日志功能,对于老的服务器,用了很久的服务器来说,这是一个非常有用的功能。它可以防止因为断电,异常关机,数据丢失;或者是长时间的自检。

# tune2fs -l /dev/sdb1
# mount /dev/sdb1 /mnt/d1
# tune2fs -l /dev/sdb1
查看 mount count 挂载次数
Maximum mount count 最大挂载次数。达到最大挂载次数后,再次开机时就会强制自检。

使用tune2fs -c 参数修改强制自检次数
# tune2fs -c 2 /dev/sdb1
# tune2fs -l /dev/sdb1 |grep -i "mount count"
# tune2fs -l /dev/sdb1 |grep -i "mount count"
# umount /mnt/d1
# mount /dev/sdb1 /mnt/d1
# tune2fs -l /dev/sdb1 |grep -i "mount count"
此时这个 sdb1 已经达到了最大挂载次数2。此时,如果重启计算机,这个设备肯定会强制自检的。
# umount /mnt/d1
# mount /dev/sdb1 /mnt/d1
# tune2fs -l /dev/sdb1 |grep -i "mount count"
# tune2fs -c -1 /dev/sdb1 #使用负值设置某一设备永远不要自检。

-i check interval 系统自检间隔时间
默认系统自检时间为6个月。如果不希望它自检。可以改为0或-1,如果想每天自检一次,可以改为2 。
# tune2fs -c -1 -i -1 /dev/sdb1

如果需要自检可以使用手动的自检。fsck工具。

>居中<文件系统检查工具

fsck--检查文件系统数据完整性的工具。
用法一:fsck -t ext2 /dev/sdb1
用法二:fsck.ext2 /dev/sdb1
e2fsck:检查ext2/ext3文件系统的工具
(注意:这个e2fsck有很多的危险性。有不少同学反映使用这个工具会对文件系统造成一定的破坏。特别是同时使用ext2和ext3文件系统时。它在自动识别的时候会产生一定的误差,所以它非常的危险。不要使用.)
以后使用fsck工具。fsck工具有两种用法,类似于mkfs。一种是fsck -t 后面跟一个类型。还有一种就是fsck后用.连接文件系统类型,后面跟一个设备。它主要是检查文件是否有错误,是否有数据不完整的错误节点。它会帮你自动修复文件系统上的错误。
<注意:fsck不要用错参数>
# fsck.ext2 /dev/sdb1
# fsck.ext3 /dev/sdb4
/etc/fstab文件中,在挂载选项后面的最后 一位有1或者2都是开机自检的。一些设备长期不自检也是不好的。根分区是第一个被自检的,所以标为1。
# df
# mkfs.ext2 /dev/sdb1 使用ext2文件系统格式化/dev/sdb1
# mkfs -t ext3 /dev/sdb4
# fsck -t ext3 /dev/sdb1
# fsck.ext3 -y /dev/sdb4 自动修复sdb4上的文件系统错误。-y表示yes的意思。

发表于 : 2007-05-22 17:49
dajian0509
楼上的解释正解啊
点子上了 !

发表于 : 2007-05-22 18:10
ipv6now
Ubuntu forces drives to be checked once for every 30 times the filesystem is mounted. This means that on an average, once every 30 times you bootup your computer, the filesystem integrity is checked. This is very reasonable for a desktop, which is seldom rebooted. However, for a laptop, this means pain, since you may be planning on making a presentation, and Ubuntu may start a filesystem check just when you hook up your laptop to the projector and bootup! Today we will see how to disable (or force) the checking temporarily, and also how to adjust the period and frequency of the check.

To disable filesystem integrity check for the next bootup, create a file called /fastboot. So a
$sudo touch /fastboot
will disable filesystem check for the next time you bootup. Since the /fastboot file is removed during bootup, this will disable filesystem check only once - for the one time you bootup after you create the /fastboot file (which need not have anything in it — hence the touch, which only creates the file)
On the contrary to force a filesystem check the next time you bootup, create a file called /forcefsck by doing
$sudo touch /forcefsck

Now, on to the more interesting business of how to change the number of bootups between filesystem checks, and modifying the period with which the filesystem is checked. The following applies to ext2 and ext3 filesystems.

tune2fs is an utility that you can use to change both the number of bootups between filesystem checks, and the number of days/weeks/months between filesystem checks.

For example to have the filesystem checked once every 60 bootups use
$sudo tune2fs -c 60

To have the filesystem check run periodically, say once a week, use
$sudo tune2fs -i 1w
changing the “w” to “d” or “m” will have the check run once daily and once monthly - you get the idea.

As always, you can read
$man tune2fs
for more detailed information and examples.

发表于 : 2007-05-22 18:14
PL7s
其他分区建议改成0,系统分区还是保留检查比较好。

发表于 : 2007-05-22 18:19
ipv6now
reiser的怎么让它隔一段时间检查一次?

发表于 : 2007-05-22 19:37
forrid
reiser的不用检查?

发表于 : 2007-05-22 20:34
tommy007
貌似只检查ext3
xfs也不检查

发表于 : 2007-05-22 22:17
stlxv
:shock:

发表于 : 2007-05-22 22:23
ipv6now
我的reiser是检查的啊,不过检查比较快.前天改了一下fstab,不让它检查了,后来断了几次电,变得启动超慢,就又改回来了,查出来一堆错误