You are not logged in.

#1 2014-02-14 16:58:02

ltb
Member
Registered: 2013-12-19
Posts: 4

how to write udev rules to prevent detect my secondary HDD at boot?

Hi, everyone, I'm new to arch.
Here is my situation: I got a Acer 4820TG and have a SSD in my HDD bay and my original WDC HDD in my optical bay.
If I turn on it after some time not use, the system hangs at "triggering uevents". But when I reboot it, it works fine.
I'm quite sure it's sth. to do with my secondary HDD, because when I remove the HDD, everything works fine.

Here is my question: how, or is it possible to write udev rules, to make the system ignore the HDD at boot(do not create the /dev/sdb), and detect the HDD again after boot, just as if I plugin a removable disk?

Now I'm reading the article 'Writing udev rules' http://www.reactivated.net/writing_udev_rules.html.
But I'm not sure if it would help.
Any help would be appreciated.

P.S. I'm Chinese and I hope my poor English is understandable.

Offline

#2 2014-02-15 20:13:40

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: how to write udev rules to prevent detect my secondary HDD at boot?

Sounds like a problem inside the BIOS.

Something like that is being done here. The guy reports he is failing to do it, but I think that is because he's filtering output from the USB subsystem. And, as you can see, he shows output from the BLOCK subsystem. So you should probably create two rules: one for BLOCK and one for USB. An alternative is to only use the vendor and model id (don't know if that is possible).


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#3 2014-02-19 22:13:40

danitool
Member
Registered: 2011-04-20
Posts: 4

Re: how to write udev rules to prevent detect my secondary HDD at boot?

Did you try the command?

echo 1 > /sys/block/sdb/device/delete

I also have a similar problem with a faulty optical drive, this command solved my problem.

I created a super-simple systemd service

[Unit]
Description=Silence HD

[Service]
Type=oneshot

ExecStart=/usr/bin/bash -c '/usr/bin/echo 1> /sys/block/sdb/device/delete'
ExecStart=/usr/bin/bash -c '/usr/bin/echo 1> /sys/block/sr0/device/delete'
ExecStart=/usr/bin/bash -c '/usr/bin/echo 1> /sys/block/sdc/device/delete'

[Install]
WantedBy=basic.target

I also included other hard drives to silence them. They are detected but then removed so no interaction betwen the system and the drives.

Offline

#4 2014-02-19 23:42:00

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: how to write udev rules to prevent detect my secondary HDD at boot?

ltb wrote:

triggering uevents

See thread - maybe loglevel=7 shows better debugging information.

ltb wrote:

make the system ignore the HDD at boot(do not create the /dev/sdb)

No. Debug the problem, maybe it's in the kernel, or udev.

Offline

Board footer

Powered by FluxBB