ascii image


0010101000011111101001101010000010011000
1110101110110101011011111010010010001011
0001011100011101111001010011010010111110
0000010111101001100000110011101100001000
0011000000111010001111111000100110000001
1010110110000000000001011001000110001010
0101100010101100000100000010100100010101
0001011001011101100011000101110111101110
0110010100110100111101110100110011111101
0010111100110011010010110010101111011011
0100000000001001001011000010110100101001
1101000111100000110111011100110111000010
1111110001111111101101001010000111101100
0010110000100000111011000000101100010110
0101111000011100111010000000011111101111
0010010011110010011101001000110101000101
0000000001000100001111111100111010001111

Thursday, 3 April 2014

Mapping ATA device numbers to hard drive device names on Ubuntu


A nice little one liner:

# ls -l /sys/block/sd* | sed 's/.*\(sd.*\) -.*\(host.*\)\/t.*/\2 => \1/'
host0 => sda
host1 => sdb
host6 => sdc
host7 => sdd
host8 => sde
host9 => sdf

therefore

host0 => ata0 => sda


Which is the same with this: 

The first number in the [] brackets shows the ata number


# lsscsi --long
[0:0:0:0]    disk    ATA      WDC WD40EZRX-00S 80.0  /dev/sda
  state=running queue_depth=31 scsi_level=6 type=0 device_blocked=0 timeout=30
[1:0:0:0]    disk    ATA      WDC WD40EZRX-00S 80.0  /dev/sdb
  state=running queue_depth=31 scsi_level=6 type=0 device_blocked=0 timeout=30
[6:0:0:0]    disk    ATA      WDC WD20EZRX-00D 80.0  /dev/sdc
  state=running queue_depth=1 scsi_level=6 type=0 device_blocked=0 timeout=30
[7:0:0:0]    disk    ATA      WDC WD20EZRX-00D 80.0  /dev/sdd
  state=running queue_depth=1 scsi_level=6 type=0 device_blocked=0 timeout=30
[8:0:0:0]    disk    ATA      SAMSUNG HD103UJ  1AA0  /dev/sde
  state=running queue_depth=1 scsi_level=6 type=0 device_blocked=0 timeout=30
[9:0:0:0]    disk    ATA      SAMSUNG HD103UJ  1AA0  /dev/sdf
  state=running queue_depth=1 scsi_level=6 type=0 device_blocked=0 timeout=30

No comments:

Post a comment