PDA

View Full Version : Bad HDD, stop the kernel from checking it



lhorace
24th August 2009, 04:18 AM
I will keep this short, I have a bad HDD possibly PCB damage due to heat... It's a laptop although I can remove it but in the mean time till then, is there any way I can pass an option to the kernel to stop scanning it....

My OS mounted on a 8 gb sd card plus 4 gb flash drive..

It takes 20 minutes for Fedora to bootup and Debian base Linux 30 to 35 minutes...

It wouldn't been a problem setting my laptop to sleep mode when I'm done and it was working fine but after a few updates, once I put my laptop to sleep I can't do it again in the same row. I have to shutdown. Lets say I tried anyway, system stop being responsive, while I let it continue to see it will become responsive again, it went on for an hour and half. It's annoying... So my question is, what option can tell the kernel to not scan my HDD. Also, from what I see know HDD is ata1, DVD drive ata3, not sure this helps...



Aug 23 22:13:04 lhorace kernel: sd 0:0:0:0: [sda] 488397168 512-byte hardware sectors (250059 MB)
Aug 23 22:13:04 lhorace kernel: sd 0:0:0:0: [sda] Write Protect is off
Aug 23 22:13:04 lhorace kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Aug 23 22:13:07 lhorace kernel: ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
Aug 23 22:13:07 lhorace kernel: ata1.00: irq_stat 0x40000008
Aug 23 22:13:07 lhorace kernel: ata1.00: cmd 60/08:00:bf:44:1c/00:00:1d:00:00/40 tag 0 ncq 4096 in
Aug 23 22:13:07 lhorace kernel: res 41/40:00:bf:44:1c/76:00:1d:00:00/40 Emask 0x409 (media error) <F>
Aug 23 22:13:07 lhorace kernel: ata1.00: status: { DRDY ERR }
Aug 23 22:13:07 lhorace kernel: ata1.00: error: { UNC }
Aug 23 22:13:07 lhorace kernel: ata1.00: configured for UDMA/133
Aug 23 22:13:07 lhorace kernel: ata1: EH complete
Aug 23 22:13:07 lhorace kernel: sd 0:0:0:0: [sda] 488397168 512-byte hardware sectors (250059 MB)
Aug 23 22:13:07 lhorace kernel: sd 0:0:0:0: [sda] Write Protect is off
Aug 23 22:13:07 lhorace kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Aug 23 22:13:10 lhorace kernel: ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
Aug 23 22:13:10 lhorace kernel: ata1.00: irq_stat 0x40000008
Aug 23 22:13:10 lhorace kernel: ata1.00: cmd 60/08:00:bf:44:1c/00:00:1d:00:00/40 tag 0 ncq 4096 in
Aug 23 22:13:10 lhorace kernel: res 41/40:00:bf:44:1c/76:00:1d:00:00/40 Emask 0x409 (media error) <F>
Aug 23 22:13:10 lhorace kernel: ata1.00: status: { DRDY ERR }
Aug 23 22:13:10 lhorace kernel: ata1.00: error: { UNC }
Aug 23 22:13:10 lhorace kernel: ata1.00: configured for UDMA/133
Aug 23 22:13:10 lhorace kernel: ata1: EH complete

stevea
24th August 2009, 05:54 AM
The kernel isn't "scanning" the drive. It's initializing the driver & drive for normal use.

Assuming you don't want to access the drive at all, you could disable the loading of the kernel module that controls it ..
lspci -k , as root will show which driver uses the interface. Than you can block is in /etc/udev or in /etc/modprobe.d/ . You'll likely need to use mkinitrd to create a new /boot/initrd-$(uname -r).img

If you want to use the drive, you'll get the errors. The "DRDY ERR" looks pretty bad to me. Might still be the drive.

lhorace
25th August 2009, 05:02 AM
From what can I see below, thats probably the driver that's in control. However, what if disabling that driver and I also lose access to my DVD drive.


00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode]
Kernel driver in use: ahci


Also is there any configuration option for ahci where I can tell it to skip ata1... Or atleast in dev...

lhorace
27th August 2009, 06:06 AM
I haven't gotten any response so I did some research on my own and found out about udev. Well I wrote a udev rule to ignore the device and not initialize it



KERNEL==”sda", SUBSYSTEMS==”scsi”, ATTRS{model}=="WDC WD2500BEVS-2", OPTIONS+=”ignore_device”


and place in /etc/udev/rules.d/10-local.rules. Well udev is complaining


udevd[728]: add_to_rules: invalid rule '/etc/udev/rules.d/10-local.rules:1'


And there is no information to why udev don't like the rule, I'm clueless. Can anyone tell me if I'm doing it right