Hi paulb100,
In Ubuntu, execute the following commands (assume you are the default ubuntu user with the prompt:
[email protected]:~$ where the '#' character is the root user's prompt you will see after the sudo command) Note: each line is followed by <Enter> which means press the Enter key on your keyboard except for the <Esc> line which means press the Escape key on your keyboard labeled "Esc" - i.e. it is not followied by <Enter> key press. Also, the 'i' command given below to enter the "insert" mode of the vi editor is not followed by <Enter> as there is no need for it.
[email protected]:~$ sudo -i<Enter>
# cd /etc<Enter>
# cp -p rc.local rc.local.original<Enter>
# vi rc.local<Enter>
:13<Enter>
i
hdparm -B 254 /dev/sda
<Esc>
:wq<Enter>
# shutdown -h now<Enter>
Note: There is no need to press the Enter key, i.e. <Enter>, after the hdparm command has been typed on line 13. Also, I used line 13 which is a blank line in my default /etc/rc.local file just before the exit 0 command in that file. The /etc/rc.local file in your system should be the same.
Here is what happens with each command line above:
sudo -i - will put you into root account
cd /etc - changes the current directory to the /etc directory
cp -p rc.local rc.local.original - saves the original rc.local file to its identical twin file named rc.local.original
vi rc.local - will launch the vi editor to edit the rc.local file in the /etc directory
:13 - will position you to the 13th line in the file, i.e. the line before the exit 0 command in the file
i - will put the vi editor into "insert" mode so that the following line can be inserted DO NOT PRESS ENTER
hdparm -B 254 /dev/sda - type only the characters you see and no others
<Esc> - this means press the Escape character on your keyboard which commands the vi editor to leave the "insert" mode
:wq - writes the rc.local file and quits the vi editor leaving you back at the root account's prompt, i.e. the "#" character
shutdown -h now - reboots your computer immediately
When your system is rebooted, if your hdparm command does what you wanted it to do, then you should be all set.
-- Tom