Build a home server - part 3
Aah! Saturday morning and everyone are asleep. A perfect time to spoil a perfect morning with doing the boring stuff. It is time to enumarate the hard disks and set up monitoring. Bad times will arrive. Disks are going bad at some point. It is important that you know which disk to replace.
- Shutdown the server and remove the SATA cables attached to the data disks.
- Power up and log on to the server as root. List the devices. You will get an out similar to this:
root@ohlala:~# ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Apr 28 05:51 pci-0000:00:1f.2-scsi-5:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 9 Apr 28 05:51 pci-0000:01:00.0-scsi-0:0:0:0 -> ../../sdb
root@ohlala:~# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 9 Apr 28 05:51 ata-INTEL_SSDSC2CW060A3_CVCV1534059E060AGN -> ../../sdb
lrwxrwxrwx 1 root root 9 Apr 28 05:51 ata-TEAM_XS1_SSD_TEAM-2SA110214008 -> ../../sda
root@ohlala:~#
- Mark. Power off. Attach a another SATA cable. Boot. List. Repeat.
- And no. This is not fun!
A listing with one of the data disks attached:
root@ohlala:~# ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Apr 28 06:39 pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 9 Apr 28 06:39 pci-0000:00:1f.2-scsi-5:0:0:0 -> ../../sdb
lrwxrwxrwx 1 root root 9 Apr 28 06:39 pci-0000:01:00.0-scsi-0:0:0:0 -> ../../sdc
root@ohlala:~# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 9 Apr 28 06:39 ata-INTEL_SSDSC2CW060A3_CVCV1534059E060AGN -> ../../sdc
lrwxrwxrwx 1 root root 9 Apr 28 06:39 ata-ST2000DL003-9VT166_5YD7JNXT -> ../../sda
lrwxrwxrwx 1 root root 9 Apr 28 06:39 ata-TEAM_XS1_SSD_TEAM-2SA110214008 -> ../../sdb
lrwxrwxrwx 1 root root 9 Apr 28 06:39 md-name-ohlala:0 -> ../../md0
root@ohlala:~#
Note the highlighted parts and how the paths have changed after a new disk has been attached. This is important to know and remember: the path /dev/sdX will change.
Update OS
apt-get update && apt-get upgrade
Part 4 - Configure basic monitoring.