You are not logged in.
Pages: 1
Hi,
I have a third hard disk in my machine for Windows. When in Linux, I want it to spin down because it makes noise. I already tried the hdparm -y and -Y and such, but there still are some instances where the disk is accessed and therefore spins up (for example, opening a "save as" dialog in Thunderbird).
Is it possible, with some command, udev rule or kernel parameter or something, to make the disk not be seen by the kernel?
Offline
Maybe you can disable it in BIOS or unmount it in the system.
Offline
Disabling in the BIOS doesn't help, because the Linux kernel does its own hard disk detection.
And unmounting works on servers, in my experience, but as I mentioned, some things (like the "save as" dialog in Thunderbird) cause it to spin up again. I guess it's because of dbus/hal discovering devices.
Offline
The disk is only accessed because it's mounted, if it's not mounted, then there won't be any access to it when a program looks for locations to save a file. It can only save to mounted locations, after all...
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
I know how mounting works. Keeping it unmounted on a server system works fine, but modern desktop systems work differently. When I open the thunderbird save-as dialog, I get a list of devices on the left side. One is a 137 GB disk, which is the disk in question.
"mount |grep -i sdc" doesn't give any output BTW, so it's really not mounted.
Offline
You can try 'chmod 000 /dev/sdX' as root, with X being the hard drive you want to prevent access to. You won't be able to access the drive before you change the chmod settings back however.
Last edited by gonX (2010-10-13 12:59:30)
since 2009
Offline
You can try 'chmod 000 /dev/sdX' as root, with X being the hard drive you want to prevent access to. You won't be able to access the drive before you change the chmod settings back however.
Doesn't help And accessing the drive works fine, even with perms 000... Weird...
Offline
Sumount?
It requires scsiadd and lsscsi.
Script:
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: $0 <device>"
exit 1
fi
if ! which lsscsi >/dev/null 2>&1; then
echo "Error: lsscsi not installed";
exit 1
fi
if ! which scsiadd >/dev/null 2>&1; then
echo "Error: scsiadd not installed"
exit 1
fi
device=`lsscsi | grep $1`
if [ -z "$device" ]; then
echo "Error: could not find device: $1"
exit 1
fi
hcil=`echo $device | awk \
'{split(substr($0, 2, 7),a,":"); print a[1], a[2], a[3], a[4]}'`
scsiadd -r $hcil
Last edited by kfgz (2010-10-14 11:22:50)
Offline
gonX wrote:You can try 'chmod 000 /dev/sdX' as root, with X being the hard drive you want to prevent access to. You won't be able to access the drive before you change the chmod settings back however.
Doesn't help
And accessing the drive works fine, even with perms 000... Weird...
My guess is that HAL is giving you the rights as a user on the console.
Offline
@kfgz
it worked, except that I had to run the scsiadd -r command manually; the script you provided didn't work. I'll bugfix that later...
Thanks
Offline
Pages: 1