安装15.10后,每次启动都会自动检测硬盘

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
sulow
帖子: 73
注册时间: 2006-04-24 0:36

安装15.10后,每次启动都会自动检测硬盘

#1

帖子 sulow » 2016-01-06 14:35

从15.04升级上来时这样,
重新安装了一次15.10还是这样。

fstab如下
# / was on /dev/sdc1 during installation
UUID=dd5bd93a-6624-4084-ba23-b84bb120a571 / ext4 errors=remount-ro 0 1
# /home was on /dev/sdc3 during installation
UUID=19ca6b75-c2de-4a5b-9bea-f9f4754f8237 /home ext4 defaults 0 2

查了一下,网上说这个errors=remount-ro是正常的
http://ubuntuforums.org/showthread.php?t=845912

不知问题出在哪儿,大家有这个情况吗?
谢谢
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 安装15.10后,每次启动都会自动检测硬盘

#2

帖子 vickycq » 2016-01-06 14:40

网上说这个errors=remount-ro是正常的
这个选项意为 出现错误时 以只读模式(ro)重新挂载

参考
viewtopic.php?f=48&t=474479
http://linux.die.net/man/8/mount
UUID=dd5bd93a-6624-4084-ba23-b84bb120a571 / ext4 errors=remount-ro 0 1
UUID=19ca6b75-c2de-4a5b-9bea-f9f4754f8237 /home ext4 defaults 0 2
第六项为 fs_passno ,当前值分别为1和2。即每次开机都会自动运行 systemd-fsck@.service 和 systemd-fsck-root.service

不过这种检测问题不大吧,一瞬间就过去了。

参考
https://wiki.archlinux.org/index.php/Fsck#Mechanism
http://www.freedesktop.org/software/sys ... rvice.html
http://bbs.archlinuxcn.org/viewtopic.php?id=4011
上次由 vickycq 在 2016-01-06 14:49,总共编辑 1 次。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
sulow
帖子: 73
注册时间: 2006-04-24 0:36

Re: 安装15.10后,每次启动都会自动检测硬盘

#3

帖子 sulow » 2016-01-06 14:49

vickycq 写了: 第六项为 fs_passno ,当前值分别为1和2。即每次开机都会自动运行 systemd-fsck@.service 和 systemd-fsck-root.service

不过这种检测问题不大吧,一瞬间就过去了。
印象中,
1,是开机30次重检(具体几次记不清了)
2,是6个月自动重检(同上)

有改过吗?
15.04之前没这么频繁,现在是只要开机就检测,
老觉得在折磨硬盘,时间倒是还好。

主要是怕硬盘耗损太大,其他到没事。
多谢。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 安装15.10后,每次启动都会自动检测硬盘

#4

帖子 poloshiao » 2016-01-06 16:53

把下面指令 複製 貼進終端機 執行
1. /dev/sdc1
1-1. sudo dumpe2fs /dev/sdc1 | grep "Mount count"
1-2. sudo dumpe2fs /dev/sdc1 | grep "Maximum mount count"
1-3. sudo dumpe2fs /dev/sdc1 | grep "Next check after"
2. /dev/sdc3
2-1. sudo dumpe2fs /dev/sdc3 | grep "Mount count"
2-2. sudo dumpe2fs /dev/sdc3 | grep "Maximum mount count"
2-3. sudo dumpe2fs /dev/sdc3 | grep "Next check after"
把結果直接 選取/複製/貼上來

當你關機時 沒有完成 umount 的動作
下次開機 就一定會检测硬盘掛載分割區
意思是 確認你關機前 都有完成 umount 的動作
sulow
帖子: 73
注册时间: 2006-04-24 0:36

Re: 安装15.10后,每次启动都会自动检测硬盘

#5

帖子 sulow » 2016-01-06 19:09

poloshiao 写了:把下面指令 複製 貼進終端機 執行
1. /dev/sdc1
1-1. sudo dumpe2fs /dev/sdc1 | grep "Mount count"
1-2. sudo dumpe2fs /dev/sdc1 | grep "Maximum mount count"
1-3. sudo dumpe2fs /dev/sdc1 | grep "Next check after"
2. /dev/sdc3
2-1. sudo dumpe2fs /dev/sdc3 | grep "Mount count"
2-2. sudo dumpe2fs /dev/sdc3 | grep "Maximum mount count"
2-3. sudo dumpe2fs /dev/sdc3 | grep "Next check after"
把結果直接 選取/複製/貼上來

當你關機時 沒有完成 umount 的動作
下次開機 就一定會检测硬盘掛載分割區
意思是 確認你關機前 都有完成 umount 的動作
dumpe2fs /dev/sdc1 | grep "Mount count"
dumpe2fs 1.42.12 (29-Aug-2014)
Mount count: 27

dumpe2fs /dev/sdc1 | grep "Maximum mount count"
dumpe2fs 1.42.12 (29-Aug-2014)
Maximum mount count: -1

dumpe2fs /dev/sdc1 | grep "Next check after"
dumpe2fs 1.42.12 (29-Aug-2014)

dumpe2fs /dev/sdc3 | grep "Mount count"
dumpe2fs 1.42.12 (29-Aug-2014)
Mount count: 56

dumpe2fs /dev/sdc3 | grep "Maximum mount count"
dumpe2fs 1.42.12 (29-Aug-2014)
Maximum mount count: -1

dumpe2fs /dev/sdc3 | grep "Next check after"
dumpe2fs 1.42.12 (29-Aug-2014)

请指点,多谢。
sulow
帖子: 73
注册时间: 2006-04-24 0:36

Re: 安装15.10后,每次启动都会自动检测硬盘

#6

帖子 sulow » 2016-01-06 19:11

都没有 next check after??
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 安装15.10后,每次启动都会自动检测硬盘

#7

帖子 vickycq » 2016-01-06 20:44

sulow 写了:都没有 next check after??
这个是上游做出的改动。可以看 Check interval 的值是否为零
$ sudo dumpe2fs /dev/sdc1 | grep -i 'check interval'
dumpe2fs 1.42.13 (17-May-2015)
Check interval: 0 (<none>)
From: Eric Sandeen <sandeen@redhat.com>
Date: Thu, 17 Feb 2011 15:55:15 -0600
Subject: [PATCH] e2fsprogs: turn off enforced fsck intervals by default

The forced fsck often comes at unexpected and inopportune moments,
and even enterprise customers are often caught by surprise when
this happens. Because a filesystem with an error condition will
be marked as requiring fsck anyway, I submit that the time-based
and mount-based checks are not particularly useful, and that
administrators can schedule fscks on their own time, or tune2fs
the enforced intervals if they so choose. This patch disables the
intervals by default, and I've added a new mkfs.conf option to
turn on the old behavior of random, unexpected, time-consuming
fscks at boot time.
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
sulow
帖子: 73
注册时间: 2006-04-24 0:36

Re: 安装15.10后,每次启动都会自动检测硬盘

#8

帖子 sulow » 2016-01-06 21:07

vickycq 写了:这个是上游做出的改动。可以看 Check interval 的值是否为零
两个值都为0,

Check interval: 0 (<none>)

但还是不懂这些数值和开机自动检测有什么关联,
现在我该怎么做才不会每次开机都自动检测呢?
我基本上每天晚上都会关机的。

感谢各位大大。
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 安装15.10后,每次启动都会自动检测硬盘

#9

帖子 vickycq » 2016-01-06 22:16

sulow 写了: 现在我该怎么做才不会每次开机都自动检测呢?
我基本上每天晚上都会关机的。
试试
将 /etc/fstab 中两个 passno(第六个值) 都设置为零

代码: 全选

# / was on /dev/sdc1 during installation
UUID=dd5bd93a-6624-4084-ba23-b84bb120a571 / ext4 errors=remount-ro 0 0
# /home was on /dev/sdc3 during installation
UUID=19ca6b75-c2de-4a5b-9bea-f9f4754f8237 /home ext4 defaults 0 0
或使用 systemctl mask 禁用 systemd-fsck@.service 和 systemd-fsck-root.service
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 安装15.10后,每次启动都会自动检测硬盘

#10

帖子 poloshiao » 2016-01-06 23:59

安装15.10后,每次启动都会自动检测硬盘
開機選單 選擇
advanced
選擇 Upstart
看看 請況有沒有改變

如果沒有改變
把下面指令 複製 貼進終端機 執行
sudo cat /etc/default/rcS | grep FSCKFIX
把結果直接 選取/複製/貼上來
sulow
帖子: 73
注册时间: 2006-04-24 0:36

Re: 安装15.10后,每次启动都会自动检测硬盘

#11

帖子 sulow » 2016-01-07 9:02

poloshiao 写了:
安装15.10后,每次启动都会自动检测硬盘
開機選單 選擇
advanced
選擇 Upstart
看看 請況有沒有改變

如果沒有改變
把下面指令 複製 貼進終端機 執行
sudo cat /etc/default/rcS | grep FSCKFIX
把結果直接 選取/複製/貼上來
神奇,upstart后,关机,开机(非重启),没有自动检测了。
这两天再看看,非常感谢。

sudo cat /etc/default/rcS | grep FSCKFIX
#FSCKFIX=no
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 安装15.10后,每次启动都会自动检测硬盘

#12

帖子 poloshiao » 2016-01-07 10:46

sudo cat /etc/default/rcS | grep FSCKFIX
#FSCKFIX=no
1. http://xmodulo.com/automatic-filesystem ... linux.html
Trigger Automatic Filesystem Check upon Boot
If you want to trigger fsck automatically upon boot, there are distro-specific ways to set up unattended fschk during boot time.
On Debian, Ubuntu or Linux Mint, edit /etc/default/rcS as follows.
$ sudo vi /etc/default/rcS
# automatically repair filesystems with inconsistencies during boot
FSCKFIX=yes
1-1. http://manpages.ubuntu.com/manpages/wil ... rcS.5.html
rcS - variables that affect the behavior of boot scripts
FSCKFIX
When the root and all other file systems are checked, fsck is
invoked with the -a option which means "autorepair". If there
are major inconsistencies then the fsck process will bail out.
The system will print a message asking the administrator to
repair the file system manually and will present a root shell
prompt (actually a sulogin prompt) on the console. Setting this
option to yes causes the fsck commands to be run with the -y
option instead of the -a option. This will tell fsck always to
repair the file systems without asking for permission.
1-1-1. http://manpages.ubuntu.com/manpages/wil ... sck.8.html
fsck - check and repair a Linux filesystem
-a Automatically repair the filesystem without any questions (use
this option with caution).
1-1-2. http://manpages.ubuntu.com/manpages/wil ... sck.8.html
fsck - check and repair a Linux filesystem
-s Serialize fsck operations. This is a good idea if you are
checking multiple filesystems and the checkers are in an
interactive mode.
神奇,upstart后,关机,开机(非重启),没有自动检测了。
2. Ubuntu 15.10 預設使用 systemd 初始化 但是 可以從開機選單選擇 Upstart 初始化
2-1. 上面預設可以被改變為 預設使用 Upstart 初始化 但是 可以從開機選單選擇 systemd 初始化
參見
https://wiki.ubuntu.com/SystemdForUpsta ... to_upstart
Permanent switch back to upstart
2-1-1. 你可以作此改變 預設使用 Upstart 初始化 但是 可以從開機選單選擇 systemd 初始化

3. systemd 開機初始化 對於 /etc/default/rcS 功能 可能還沒妥適處理 導致產生 Bug
3-1. 下面的 Bug 是 針對 /etc/default/rcS 的 UTC 參數
https://bugs.launchpad.net/ubuntu/+sour ... ug/1377258
3-1-1. 暫時解決方案
https://bugs.launchpad.net/ubuntu/+sour ... omments/13
3-2. 你可以參考看看 借鏡 2-1-1 相同方法 能否修正 FSCKFIX 參數

4. 其它參考
特別是 有關 /tmp 關機沒有被清乾淨 是否影響 重開機 的 Bug Report
你可以詳細看看
4-1. http://forums.debian.net/viewtopic.php?f=10&t=119624
4-2. https://bugs.debian.org/cgi-bin/bugrepo ... bug=648527
4-3. https://bugs.debian.org/cgi-bin/bugrepo ... bug=807769
4-4. http://comments.gmane.org/gmane.linux.d ... ral/885067
4-5. https://www.mail-archive.com/debian-bug ... 78960.html

5. 有心得或有新發現 歡迎分享 或 提報 Bug Report
sulow
帖子: 73
注册时间: 2006-04-24 0:36

Re: 安装15.10后,每次启动都会自动检测硬盘

#13

帖子 sulow » 2016-01-07 18:17

poloshiao 写了: 特別是 有關 /tmp 關機沒有被清乾淨 是否影響 重開機 的 Bug Report
哎呀呀。。。
/etc/fstab
tmpfs /tmp tmpfs defaults 0 0

不会是这个出的问题吧??
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 安装15.10后,每次启动都会自动检测硬盘

#14

帖子 poloshiao » 2016-01-07 18:27

/etc/fstab
tmpfs /tmp tmpfs defaults 0 0
不会是这个出的问题吧??
改為
# tmpfs /tmp tmpfs defaults 0 0
試試

效果如何 ? 要試了才知道.
sulow
帖子: 73
注册时间: 2006-04-24 0:36

Re: 安装15.10后,每次启动都会自动检测硬盘

#15

帖子 sulow » 2016-01-08 19:02

poloshiao 写了: # tmpfs /tmp tmpfs defaults 0 0
試試

效果如何 ? 要試了才知道.
关键startup后还没自动检测过。。

猜测如果是tmpfs引发的问题,
可能跟不正常断电有关?
有机会的话会测试看看。

多谢啦,至少startup后,我的问题算是解决了。。 :em11
回复