SATA disk order on boot...
Posted: August 28th, 2011, 4:50 pm
More fun with Ubuntu and disk drives... Here is something I noticed after adding all the disks.
My motherboard has 5 SATA ports. Ports 1 to 4 are grouped together on the back panel, and port 5 sits by itself inside the motherboard.
I plugged the system disk (SSD) in port 5 and the Samsung spindles in ports 1 to 4.
What happens now is this (as I understand it, at least) :
When the server powers up (cold boot), the SSD comes online immediately, while the regular drives take some time spinning up and initializing.
The result is :
/dev/sda : SSD (port 5)
/dev/sdb : Disk1 (port 1)
/dev/sdc : Disk2 (port 2)
/dev/sdd : Disk3 (port 3)
/dev/sde : Disk4 (port 4)
But if I just reboot the server while everything is running, SATA port numbers get precedence :
/dev/sda : Disk1 (port 1)
/dev/sdb : Disk2 (port 2)
/dev/sdc : Disk3 (port 3)
/dev/sdd : Disk4 (port 4)
/dev/sde : SSD (port 5)
More scary stuff, although again everything works fine in both cases, thanks to the magic of partition IDs
(which is why I resent Webmin making it difficult :-)
However, commands that use device names directly (like your temperature and spindown scripts) will not work consistently depending on how the machine was booted, which could be a problem (you don't want to spin down your system drive :-).
Fortunately, things like hdparm and smartctl will happily accept names like /dev/disk/by-label/DRU1 instead of /dev/sda, which is a lot more dependable.
(for smartctl you need to add '-d ata' to the command line)
This is one place where file system labels come in real handy : in $MyList you put a list of labels instead of drive letters.
As a bonus the output is more explicit.
My motherboard has 5 SATA ports. Ports 1 to 4 are grouped together on the back panel, and port 5 sits by itself inside the motherboard.
I plugged the system disk (SSD) in port 5 and the Samsung spindles in ports 1 to 4.
What happens now is this (as I understand it, at least) :
When the server powers up (cold boot), the SSD comes online immediately, while the regular drives take some time spinning up and initializing.
The result is :
/dev/sda : SSD (port 5)
/dev/sdb : Disk1 (port 1)
/dev/sdc : Disk2 (port 2)
/dev/sdd : Disk3 (port 3)
/dev/sde : Disk4 (port 4)
But if I just reboot the server while everything is running, SATA port numbers get precedence :
/dev/sda : Disk1 (port 1)
/dev/sdb : Disk2 (port 2)
/dev/sdc : Disk3 (port 3)
/dev/sdd : Disk4 (port 4)
/dev/sde : SSD (port 5)
More scary stuff, although again everything works fine in both cases, thanks to the magic of partition IDs
(which is why I resent Webmin making it difficult :-)
However, commands that use device names directly (like your temperature and spindown scripts) will not work consistently depending on how the machine was booted, which could be a problem (you don't want to spin down your system drive :-).
Fortunately, things like hdparm and smartctl will happily accept names like /dev/disk/by-label/DRU1 instead of /dev/sda, which is a lot more dependable.
(for smartctl you need to add '-d ata' to the command line)
This is one place where file system labels come in real handy : in $MyList you put a list of labels instead of drive letters.
As a bonus the output is more explicit.