Where it is necessary to have more speed and greater storage capacity, the HDP board has a SATA interface allowing you to attach a SATA hard disk drive (HDD). This article covers the basics for getting up and running with a SATA HDD.
The SATA and CAN connector interfaces are in close proximity of one another on the HDP board. This makes the direct fitting of a 2.5" HDD to the SATA connector impossible since it is too wide to be accommodated. We therefore advise that you purchase a SATA extension cable for connecting your HDD to the HDP board. The cable must have both SATA power and data and also be a Male to Female, often referred to as a SATA 15+7 combined cable (see image below).
In addition to the extension cable, you'll also need a SATA HDD. We have been using the Samsung ST500LM019 which has 500GB capacity (see image below).
SATA HDD Identification
During the boot-up process the kernel will check for any attached devices on the SATA interface. Below is an example of the detection for the Samsung ST500LM019 HDD whose model is declared as "SAMSUNG HM500JJ"
The HDD will be assigned a device as
X will normally be 'a' i.e.,
/dev/sda. You can double check this by running the command
cat /sys/class/block/sda/device/model which should produce the output
SAMSUNG HM500JJ in this example.
Disk formatting for file system only
A single primary partition can be created, if you are just interested in storing files on the hard disk drive, using the
fdisk utility. Running
fdisk /dev/sda will open up an interactive console application. Enter 'n' to create a new partition and then 'p' for primary partition. Choose the default partition type 83 (Linux) and choose the default start sector and default size (whole disk). Once this has been completed, enter 'w' to write the partition table to disk and then 'q' to exit the application.
You should now find a new device file exists called
/dev/sda1, which is the primary partition for your disk
/dev/sda. You can confirm this also by entering the command
fdisk -l /dev/sda and you should see the output:
Next you need to make an
ext3 file system for this primary partition before Linux is able to mount the drive and read or write files. You can do this by entering the command
mkfs.ext3 /dev/sda1. This will take a few minutes to complete (depending on the disk size).
Finally, you can mount the disk partition using the
mount command or create a new entry for it under
/etc/fstab. However, normally, the disk partition is auto-mounted under
/media/sda1 following boot-up.
Basic benchmarking test
We can use the
dd command to run some very basic benchmarking test check the disk read and write speed. Firstly to run a write speed check, we will create a 1000MB file as follows:
date; dd if=/dev/zero of=/media/sda1/zero.dat bs=1M count=1000; date
Note that we have wrapped the
date command around the disk write operation, which will create a new file called
zero.dat containing all zeros. Observe the elapsed time of the test by comparing the first date with the second date and compute the bandwidth using the formula
speed(MB/s) = 1000 / elapsed_time_seconds.
Repeat the above but this time performing a read of the file we just created:
date; dd if=/media/sda1/zero.dat of=/dev/null bs=1M count=1000; date
Disk formatting for boot and file system
To be written.