/ dev / disk / by-id下同一硬盘的scsi和ata条目


8

我正在尝试使用4个裸驱动器设置ZFS池,这些驱动器已通过SATA热插拔背板连接到Ubuntu系统。

这些是日立SATA驱动器。列出的内容时/dev/disk/by-id,每个驱动器都有两个条目:

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

我知道这些是相同的驱动器,因为我记下了序列号,并且该系统中的所有其他驱动器都是Seagate或WD。例如,第一个的序列号是YNG0ZJ7C。

为什么每个驱动器都有两个条目?更重要的是,当我创建ZFS池时,应该使用哪个池;在scsi-一个或ata-一个?


1
请注意,同时显示ata- *和scsi- *的SATA驱动器取决于发行版。例如,Ubuntu 12.04兼有两者。我刚刚检查了我的一台服务器,而Ubuntu 14.04没有scsi- 。因此,最好使用ata-我还没有找到任何好的文章详细说明为什么/何时使用ata- *和scsi- *。

Answers:


10

您可以使用。

显示的大部分内容取决于您的控制器和磁盘。我使用SAS控制器和SAS磁盘(在某些情况下使用SATA SSD),但是您可以随意使用所需的任何内容来标识zpool驱动器。您看到ata和SCSI的原因是这里的Linux中的SCSI仿真层。只要确保您不要使用/ dev / sda,/ dev / sdb等基本的/ dev条目即可(除非它是虚拟机,并且您可以控制设备订购)。

如您所见,我使用SCSI ATA条目来提高可读性,因为该池由一组SAS磁盘和SATA SSD组成:

[root@Davalan /dev/disk/by-id]# zpool status
  pool: vol1
 state: ONLINE
  scan: scrub repaired 0 in 1h44m with 0 errors on Sat Jul  6 13:12:06 2013
config:

        NAME                               STATE     READ WRITE CKSUM
        vol1                               ONLINE       0     0     0
          mirror-0                         ONLINE       0     0     0
            scsi-35000c5003af99fa7         ONLINE       0     0     0
            scsi-35000cca0153ec2d0         ONLINE       0     0     0
          mirror-1                         ONLINE       0     0     0
            scsi-35000cca01540e340         ONLINE       0     0     0
            scsi-35000cca01540e298         ONLINE       0     0     0
        cache
          ata-STEC_M8IOPS-50_STM000136649  ONLINE       0     0     0

errors: No known data errors

对于控制器上的裸驱动器,您可以选择使用显示的内容。有些人喜欢仅使用WWN的方法,但是我对此并不满意。我喜欢磁盘的描述。这些在功能上都是等效的,但是...请注意符号链接的目标。

[root@Davalan /dev/disk]# ls -1 
by-id
by-path
by-uuid

就我而言,我有以下几点:

[root@Davalan /dev/disk/by-id]# ll
total 0
lrwxrwxrwx 1 root root  9 May 27 15:25 ata-STEC_M8IOPS-50_STM000136649 -> ../../sdc
lrwxrwxrwx 1 root root 10 May 27 15:25 ata-STEC_M8IOPS-50_STM000136649-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 May 27 15:25 ata-STEC_M8IOPS-50_STM000136649-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 May 27 15:25 scsi-35000c5003af99fa7 -> ../../sdd
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-35000c5003af99fa7-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-35000c5003af99fa7-part9 -> ../../sdd9
lrwxrwxrwx 1 root root  9 May 27 15:25 scsi-35000cca0153ec2d0 -> ../../sdb
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-35000cca0153ec2d0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-35000cca0153ec2d0-part9 -> ../../sdb9
lrwxrwxrwx 1 root root  9 May 27 15:25 scsi-35000cca01540e298 -> ../../sdf
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-35000cca01540e298-part1 -> ../../sdf1
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-35000cca01540e298-part9 -> ../../sdf9
lrwxrwxrwx 1 root root  9 May 27 15:25 scsi-35000cca01540e340 -> ../../sde
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-35000cca01540e340-part1 -> ../../sde1
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-35000cca01540e340-part9 -> ../../sde9
lrwxrwxrwx 1 root root  9 May 27 15:25 scsi-SATA_STEC_M8IOPS-50_STM000136649 -> ../../sdc
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-SATA_STEC_M8IOPS-50_STM000136649-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 May 27 15:25 scsi-SATA_STEC_M8IOPS-50_STM000136649-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 May 27 15:25 wwn-0x5000a720300411f7 -> ../../sdc
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000a720300411f7-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000a720300411f7-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 May 27 15:25 wwn-0x5000c5003af99fa7 -> ../../sdd
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000c5003af99fa7-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000c5003af99fa7-part9 -> ../../sdd9
lrwxrwxrwx 1 root root  9 May 27 15:25 wwn-0x5000cca0153ec2d0 -> ../../sdb
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000cca0153ec2d0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000cca0153ec2d0-part9 -> ../../sdb9
lrwxrwxrwx 1 root root  9 May 27 15:25 wwn-0x5000cca01540e298 -> ../../sdf
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000cca01540e298-part1 -> ../../sdf1
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000cca01540e298-part9 -> ../../sdf9
lrwxrwxrwx 1 root root  9 May 27 15:25 wwn-0x5000cca01540e340 -> ../../sde
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000cca01540e340-part1 -> ../../sde1
lrwxrwxrwx 1 root root 10 May 27 15:25 wwn-0x5000cca01540e340-part9 -> ../../sde9

有很多选择,但是您可能应该只使用ata-Hitachi *条目,因为它具有足够的描述性,并且您正在使用SATA驱动器。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.