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

前端之家收集整理的这篇文章主要介绍了linux – scsi和/ dev / disk / by-id下相同硬盘的ata条目前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用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?

解决方法

你可以使用其中之一.

显示的大部分内容取决于您的控制器和磁盘.我使用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驱动器.

原文链接:https://www.f2er.com/linux/401523.html

猜你在找的Linux相关文章