I am trying to set up a ZFS pool using 4 bare drives which I have attached to my Ubuntu system via a SATA hot swap backplane.
These are Hitachi SATA drives. When I list the contents of /dev/disk/by-id
, I see two entries for each drive:
root@scorpius:/dev/disk/by-id# ls | grep Hitachi
ata-Hitachi_HDS5C3030ALA630_MJ1323YNG0ZJ7C
ata-Hitachi_HDS5C3030ALA630_MJ1323YNG1064C
ata-Hitachi_HDS5C3030ALA630_MJ1323YNG190AC
ata-Hitachi_HDS5C3030ALA630_MJ1323YNG1DGPC
scsi-SATA_Hitachi_HDS5C30_MJ1323YNG0ZJ7C
scsi-SATA_Hitachi_HDS5C30_MJ1323YNG1064C
scsi-SATA_Hitachi_HDS5C30_MJ1323YNG190AC
scsi-SATA_Hitachi_HDS5C30_MJ1323YNG1DGPC
I know these are the same drives because I wrote down the serial numbers, and all the other drives in this system are either Seagate or WD. The serial number for the first one, for example, is YNG0ZJ7C.
Why are there two entries here for each drive? More to the point, when I create my ZFS pool which one should I use; the scsi-
one or the ata-
one?
Best Answer
You can use either.
Much of what's displayed depends on your controller and disks. I use SAS controllers and SAS disks (with SATA SSDs, in some cases), but you're free to use whatever you wish for your zpool drive identification. The reason you see ata and SCSI is the SCSI emulation layer in Linux here. Just make sure you DON'T use basic /dev entries like /dev/sda, /dev/sdb, etc. (unless it's a virtual machine and you can control device ordering).
As you can see, I use the SCSI and ATA entries for readability, as the pool is comprised of a group of SAS disks and a SATA SSD:
For bare drives on a controller, you have the option of using whatever shows up. Some like the WWN-only approach, but I'm not sold on it. I like a description of the disk. These are all functionally equivalent, though... Note the destinations of the symbolic links.
In my case, I have the following:
Lots of options, but you should probably just uses the ata-Hitachi* entries because it's descriptive enough and you're using SATA drives.