changing drive nodes & hdparm

Posted by Kalamalka Kid on Ask Ubuntu See other posts from Ask Ubuntu or by Kalamalka Kid
Published on 2014-06-13T06:36:03Z Indexed on 2014/06/13 9:42 UTC
Read the original article Hit count: 308

Filed under:
|

I am currently attempting to create a command that works at startup to kill the power on two of my very noisy hard drives. I have edited the etc/rc.local file to include this command:

sudo hdparm -y /dev/sdc 
sudo hdparm -y /dev/sdd

exit 0

While I think this should work, it seems the allocated drives keep switching around every time I reboot. I have sda, sdb, sdc, sdd, and sde but they keep getting jumbled around (making the drive I wish to shut different than sdd which is making the task of shutting down the right drive on start-up quite cumbersome.

I had a perfectly functioning ftstab file working which disappeard, but I restored it from the back up into the etc/ dir:

# <file system> <mount point>   <type>  <options>       <dump>  <pass>


#Entry for /dev/sda1 :
UUID=43c09daf-08a5-44f2-89b0-fc7c6f0d1e67    /    ext4    errors=remount-ro    0    1
#Entry for /dev/sdd1 :
UUID=443AFBAD7FE50945    /media/DX100    ntfs-3g    defaults,nosuid,nodev,locale=en_CA.UTF-8    0    0
#Entry for /dev/sdb1 :
UUID=FCE456F5E456B21E   /media/GalaxyM83    ntfs-3g    defaults,nosuid,nodev,locale=en_CA.UTF-8    0    0
#Entry for /dev/sdf1 :
UUID=1CA057FDA057DBB8    /media/Holideck    ntfs-3g    defaults,nosuid,nodev,locale=en_CA.UTF-8    0    0
#Entry for /dev/sdc1 :
UUID=7ABB49654B799D40    /media/JX3P    ntfs    defaults,nosuid,nodev,locale=en_CA.UTF-8    0    0

it seems every time I boot the order of the drives changes. I do not know how to resolve this. A quick workaround the problem was to go with UUID instead of the DEV letter by editing the etc/rc.local file to include:

hdparm -y /dev/disk/by-uuid/443AFBAD7FE50945

hdparm -y /dev/disk/by-uuid/7ABB49654B799D40

So I thought I was in the clear, as I heard both hard drives die down during the boot sequence, BUT, as soon as I log in both drives start up again! so now I have to figure out what is making them start up again after log in, or perhaps another way to get them to turn off. Is there some kind of command i can get to execute after log in? I tried editing the startup applications to include an autossh with:

autoshh - sudo hdparm -y /dev/disk/by-uuid/7ABB49654B799D40
autoshh - sudo hdparm -y /dev/disk/by-uuid/443AFBAD7FE50945

but this did not seem to work to turn off the disks after log in.

© Ask Ubuntu or respective owner

Related posts about startup

Related posts about disk