[问题] 关于“完美解决Ubuntu Linux关机异响[SATA硬盘] ”

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

[问题] 关于“完美解决Ubuntu Linux关机异响[SATA硬盘] ”

#1

帖子 baoshaojing » 2007-09-19 16:02

以下是别人写的,我按照他的方法了,可是没有成功,麻烦大家看看是不是有问题啊。



作者:Webmaster


在Linux中关机或者休眠, 进行到最后切断电源时硬盘发出啾的一声, 就像windows中突然断电时的硬盘声音


在fedora core和ubuntu里面都存在, 而windows下没问题, 所以基本上是linux系统本身的原因, 导致硬盘电源管理不正常

看起来这会严重地划伤硬盘, 硬盘还是比较精贵的东西, 少受罪为好.

参考了别人的方案, 问题解决:


1、新建文件 "/etc/rc0.d/S00hdd-shutdown-workaround" 内容为:

#!/bin/sh

echo 1 > /sys/class/scsi_disk/0\:0\:0\:0/stop_on_shutdown


注意: "/sys/class/scsi_disk"里面可能有几个类似 "0\:0\:0\:0"的目录, 查看你

的"/sys/class/scsi_disk/a\:b\:c\:d/device/model" 文件,

判断哪个是跟你的硬盘对应的(通常就是0\:0\:0\:0).


2、chmod +x S00hdd-shutdown-workaround

此时关机异响已经解决


3、把文件cp到 "/ect/init.d/hdd-shutdown-workaround"


4、建立连接

#ln -s /etc/init.d/hdd-shutdown-workaround /etc/rcS.d/S99hdd-shutdown-workaround

当然, 你需要首先su得到#权限

此时关机和休眠等等情况下硬盘电源切断正常, 不再有异响


5、完成
头像
xhy
帖子: 3916
注册时间: 2005-12-28 1:16
系统: Ubuntu 12.10 X64
来自: 火星

#2

帖子 xhy » 2007-09-19 16:26

作者是白痴
连机械归位都不懂
目前负债150多万
头像
baoshaojing
帖子: 85
注册时间: 2007-05-30 9:23

#3

帖子 baoshaojing » 2007-09-19 16:52

这个~~~sata硬盘在ubuntu 下的关机声音确实和win下不一样,跟断电的时候是一样的声音。作者的etc写成ect啥的就不说了,他的方法有问题么?
头像
xhy
帖子: 3916
注册时间: 2005-12-28 1:16
系统: Ubuntu 12.10 X64
来自: 火星

#4

帖子 xhy » 2007-09-19 17:29

windows采用了电流驱动下的归位
linux采用了机械归位

都是正常的归位方式 都不会对硬盘造成伤害(除非是古老的 容量<1G的硬盘 否则没必要电流下归位)

脱裤子放屁的事情
目前负债150多万
头像
xhy
帖子: 3916
注册时间: 2005-12-28 1:16
系统: Ubuntu 12.10 X64
来自: 火星

#5

帖子 xhy » 2007-09-19 17:49

When the platters are not spinning, the heads rest on the surface of the disk. When the platters spin
up, the heads rub along the surface of the platters until sufficient speed is gained for them to "lift off"
and float on their cushion of air. When the drive is spun down, the process is repeated in reverse. In
each case, for a period of time the heads make contact with the surface of the disk--while in motion,
in fact.

While the platters and heads are designed with the knowledge in mind that this contact will occur, it
still makes sense to avoid having this happen over an area of disk where there is data! For this reason,
most disks set aside a special track that is designated to be where the heads will be placed for takeoffs
and landings. Appropriately, this area is called the landing zone, and no data is placed there. The process
of moving the heads to this designated area is called head parking.

Most early hard drives that used stepper motors did not automatically park the heads of the drive. As a
safety precaution, small utilities were written that the user would run before shutting down the PC. The
utility would instruct the disk to move the heads to the landing zone, and then the PC could be shut off
safely. A parameter in the BIOS setup for the hard disk told the system which track was the landing
zone for the particular model of hard disk. Usually, it was the next consecutive-numbered track above
the largest-numbered one actually used for data.

Modern voice-coil actuated hard disk drives are all auto-parking. On some disks, a weak spring is
attached to the head assembly that tries to pull the heads to the landing zone. When power is applied
the actuator is able to overpower the spring and position the heads normally. When the power is shut
off, the electromagnetic force from the voice coil abates, and the spring yanks the heads to the landing
zone before the platters can spin down; this can sometimes be heard on older drives as an audible clunk
when you turn the power off. Other disks use a different mechanical or electronic scheme to achieve
the same goal. Some even make use of the rotational energy remaining in the spindle motor to move
the heads off the data surface when the power is cut off! This means that modern hard disks will
automatically park their heads--even in the event of a power failure--and no utilities are required. The
BIOS landing zone parameter for modern drives is ignored.

Some people still think that it is necessary to manually park the heads of modern hard disks, but this
is not true. I sometimes think of head parking utilities as the disk drive's equivalent of a screen saver.
In both cases, the software was invented as a preventative measure, and one that made sense for use
with the technology that prevailed at the time it was thought up. And in both cases, the technology has
evolved to the point where utility is no longer necessary, yet many people still think it is.

IBM has developed an alternative to conventional head parking that I think is really a great idea. Instead
of letting the heads fall down to the surface of the disk when the disk's motor is stopped, the heads are
lifted completely off the surface of the disk while the drive is still spinning, using a special ramp. Only
then are the disks allowed to spin down. When the power is reapplied to the spindle motor, the process is
reversed: the disks spin up, and once they are going fast enough to let the heads fly without contacting
the disk surface, the heads are moved off the "ramp" and back onto the surface of the platters. IBM calls
this load/unload technology. In theory it should improve the reliability of the hard disk as a whole, by
eliminating most contact between the heads and platters entirely. I am unaware of any other drive
manufacturers using it at this time. You can read more about it here.

Another feature related to reducing damage to the hard disks caused by wear from the heads is wear
leveling, which moves the heads over the surface of the drive to avoid "wearing out" one section of the
drive. It is discussed in this quality and reliability section.
目前负债150多万
头像
xhy
帖子: 3916
注册时间: 2005-12-28 1:16
系统: Ubuntu 12.10 X64
来自: 火星

#6

帖子 xhy » 2007-09-19 17:56

http://www.storagereview.com/guide2000/ ... rking.html

原文在此 我想还是有必要看一下的
不要被那些想当然的观点欺骗了
目前负债150多万
头像
baoshaojing
帖子: 85
注册时间: 2007-05-30 9:23

#7

帖子 baoshaojing » 2007-09-20 10:15

xhy 写了:http://www.storagereview.com/guide2000/ ... rking.html

原文在此 我想还是有必要看一下的
不要被那些想当然的观点欺骗了
谢谢。嗬嗬,对于这个机械归位的问题我也不懂,以前没有研究过,谢谢你提供的资料和帮助。
笑行者
帖子: 26
注册时间: 2005-06-13 11:55
来自: 路上
联系:

#8

帖子 笑行者 » 2007-09-21 10:02

好像SATA硬盘支持热插拔吧?那么只要没有读写动作,断电就不回有什么影响的吧?
图片
头像
windwiny
帖子: 2254
注册时间: 2007-03-13 17:26

#9

帖子 windwiny » 2007-09-21 10:39

反正我在 /etc/init.d/halt 文件里 do_stop 函数尾 halt 前一行加上 sleep 3 关机时就没声音了
头像
shugoal
帖子: 1109
注册时间: 2007-08-20 21:39
来自: 沈阳
联系:

#10

帖子 shugoal » 2007-09-21 13:59

不管是什么东西 至少关机时那个声音太大听着不爽!
头像
baoshaojing
帖子: 85
注册时间: 2007-05-30 9:23

#11

帖子 baoshaojing » 2007-09-22 9:08

windwiny 写了:反正我在 /etc/init.d/halt 文件里 do_stop 函数尾 halt 前一行加上 sleep 3 关机时就没声音了
我的里面已经有一行sleep 1了把1改成3了还是不行阿。
头像
JangMunho
帖子: 1347
注册时间: 2006-01-18 12:55
来自: 也许真的没有人理解

#12

帖子 JangMunho » 2007-10-07 11:32

xhy 写了:http://www.storagereview.com/guide2000/ ... rking.html

原文在此 我想还是有必要看一下的
不要被那些想当然的观点欺骗了
这个已经确定为内核的Bug,并且Linux小组已经写了补丁,这样你也认为是机械复位的问题吗?!
Launchpad上已经又很多人发现6.06和6.10版本是不存在该问题的,出问题的版本就是7.04和最新的Fedora。
MacBook Pro 15" User
Cocoa Programmer
头像
JangMunho
帖子: 1347
注册时间: 2006-01-18 12:55
来自: 也许真的没有人理解

#13

帖子 JangMunho » 2007-10-07 11:39

原Bug描述及解决方案(看回帖):https://bugs.launchpad.net/ubuntu/+sour ... +bug/67810
网上流传的这个方案是从这些回帖中摘出来的,回帖中就错把etc写成了ect,中文帖子原封不动就照搬了过来。
MacBook Pro 15" User
Cocoa Programmer
头像
baoshaojing
帖子: 85
注册时间: 2007-05-30 9:23

#14

帖子 baoshaojing » 2007-10-07 15:28

JangMunho 写了:原Bug描述及解决方案(看回帖):https://bugs.launchpad.net/ubuntu/+sour ... +bug/67810
网上流传的这个方案是从这些回帖中摘出来的,回帖中就错把etc写成了ect,中文帖子原封不动就照搬了过来。
呵呵,谢谢阿

我看看了看那个英文版的bug,看不太懂。可能是因为自己不是学计算机的原因吧,总之这个问题没有解决。不过既然是内核问题,那么把内核升级一下,到Kernel 2.6.22-11
应该就没有问题了吧,我先升级一下内核。
头像
xhy
帖子: 3916
注册时间: 2005-12-28 1:16
系统: Ubuntu 12.10 X64
来自: 火星

#15

帖子 xhy » 2007-10-07 17:18

JangMunho 写了:
xhy 写了:http://www.storagereview.com/guide2000/ ... rking.html

原文在此 我想还是有必要看一下的
不要被那些想当然的观点欺骗了
这个已经确定为内核的Bug,并且Linux小组已经写了补丁,这样你也认为是机械复位的问题吗?!
Launchpad上已经又很多人发现6.06和6.10版本是不存在该问题的,出问题的版本就是7.04和最新的Fedora。

难道使用软件有办法做到伤害磁盘?
你先好好了解一下现代硬盘的构造吧

内核小组的人只是满足用户的需求
他们未必真的去研究过硬盘的这个响声问题

就算他们知道这个响声无伤大雅

(发布一个大部分人不理解的声明 然后引起人们心理上的不舒服; and
修改不到10行代码就解决问题 赢得赞扬声)之间 你说他们会选择哪个?
目前负债150多万
回复