prevent kernel 3.10x from spinning up drives

Issues related to hardware problems
Post Reply
dalmata22
Posts: 4
Joined: 2015/09/29 15:50:00

prevent kernel 3.10x from spinning up drives

Post by dalmata22 » 2022/07/15 18:59:28

Hi,

do you know how to disable the kernel function that automatically spins up a standby HDD?

I.e:
- I power off a secondary HDD (sdb) in my machine
- I try and mount it (mount /dev/sdb1 /mnt)
- I would genuinely expect an error
- kernel automatically spins up the HDD
- the HDD mounts correctly


/var/log/messages shows the following

Code: Select all

kernel: sd 0:0:0:0: [sdb] Spinning up disk...
kernel: .....ready
kernel: sdb: sdb1

Any idea on how to force kernel not to spin up the drive for me?

Thanks.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: prevent kernel 3.10x from spinning up drives

Post by TrevorH » 2022/07/16 15:25:20

I'm not sure you can but if you can then perhaps https://askubuntu.com/questions/1311556 ... -not-using might help. It says set an APM power level of less than 128 with hdparm and uses an example of 64.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

dalmata22
Posts: 4
Joined: 2015/09/29 15:50:00

Re: prevent kernel 3.10x from spinning up drives

Post by dalmata22 » 2022/07/16 19:57:12

thanks but the HDD spin down part is ok for me.

What I'm trying to achieve is to avoid kernel to automatically try and spin up the drive when I want to access it.

I'm pretty sure in previous kernels this was no happening: when I tried to mount a "spun down" HDD I received an error, as the system was not able to read the partition table etc, that is basically what I'd like to see again... I think it might be a low level kernel config.

Thanks

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: prevent kernel 3.10x from spinning up drives

Post by TrevorH » 2022/07/16 19:59:28

To be fair, the kernel is only doing what you tell it to. You told it to mount a filesystem on that device and it heard you and did what it was told.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

dalmata22
Posts: 4
Joined: 2015/09/29 15:50:00

Re: prevent kernel 3.10x from spinning up drives

Post by dalmata22 » 2022/07/16 20:23:41

right, the kernel should just try and mount the drive if a valid partition and file system is found, while in this case it powers up the drive, changing its power state.

I would need it to just return an error (something like file system not found), as it used to do in the previous versions.

Post Reply