1

I got a Linux server recently with a 3ware RAID. It has several volumes (/c4/u*/v*) that are seen by the OS as devices (/dev/sd*) I can roughly relate those units with the devices because of their size and some other characteristics. Is there a easier and clear way of relating the RAID devices with the OS devices?

Dave M
  • 4,514
  • 22
  • 31
  • 30
nsn
  • 501
  • 3
  • 12
  • I think an explanation for the downvote would be apropriate – nsn Apr 02 '15 at 13:56
  • I haven't found a way to do this when I was using 3ware controller. Be careful with the identifier you use int /etc/fstab, prefer UUID when you use 3ware controller because sometimes units are not related to the same device name (/dev/sd*) accross reboot. – kranteg Apr 25 '15 at 13:42
  • @kranteg thanks. You shoulld maybe post that as an answer – nsn Apr 26 '15 at 08:23
  • It seems that Unit u0 == sda and u1 == sdb and so on. But take this with a grain of salt. Since this may not be accurate if you change disks and/or raid arrays. –  Sep 25 '15 at 10:02

3 Answers3

1

You should be able to retrieve detailed information from:

sudo /sbin/hdparm -I /dev/sda

smartctl is also 3ware aware.

smartctl -a -d 3ware,0 /dev/tw0

The above will check disk health and info for 3Ware port 0 that's behind the presented RAID drive /dev/tw0. It might also be /dev/sd* or /dev/twe*.

If you have tw_cli installed, you can do tw_cli info for a list of controllers, then for example tw_cli info c0 to see controller 0. This will include the serial number of member drives.

Hyppy
  • 15,608
  • 1
  • 38
  • 59
1

No easy way to do this kind of task. Use unit size if you want to detect on which device your unit have been mounted.

Be careful with the identifier you use in /etc/fstab, prefer UUID when you use 3ware controller because sometimes units are not related to the same device name (/dev/sd*) accross reboots.

kranteg
  • 222
  • 2
  • 11
0

For those still working with 3ware controllers...

The critical bit of information can be found in the kernel logs (dmesg, kern.log) when the unit is detected by the 3ware controller. The driver lists a bunch of information including the device file (sd*) prefixed by the 3ware "address" of controller/unit/volume.

[421283.930216] sd 4:0:0:0: [sdd] 11718705152 512-byte logical blocks: (6.00 TB/5.46 TiB)

with

sdd <controller>:<something>:<unit>:<volume>

sd 4:0:0:0 means controller 4, (something 0), unit 0, volume 0. Now you know sdd corresponds to /c4/u0/v0

Example 1

Inserting a 2-drive RAID-0 unit "u0" to the system, with just a default volume:

[421283.905120] 3w-9xxx: scsi4: AEN: INFO (0x04:0x001F): Unit operational:unit=0.
[421283.928456] scsi 4:0:0:0: Direct-Access     AMCC     9650SE-16M DISK  4.10 PQ: 0 ANSI: 5
[421283.929494] sd 4:0:0:0: Attached scsi generic sg2 type 0
[421283.930216] sd 4:0:0:0: [sdd] 11718705152 512-byte logical blocks: (6.00 TB/5.46 TiB)
[421283.930489] sd 4:0:0:0: [sdd] Write Protect is off
[421283.930492] sd 4:0:0:0: [sdd] Mode Sense: 23 00 10 00
[421283.931153] sd 4:0:0:0: [sdd] Write cache: enabled, read cache: enabled, supports DPO and FUA
[421283.981408] sd 4:0:0:0: [sdd] Attached SCSI disk

With 4:0:0:0 we see that sdd is volume 0 from unit 0 from controller 4

Details from tw_cli:

# tw_cli /c4/u0 show

Unit     UnitType  Status         %RCmpl  %V/I/M  Port  Stripe  Size(GB)
------------------------------------------------------------------------
u0       RAID-0    OK             -       -       -     256K    5587.91
u0-0     DISK      OK             -       -       p0    -       2793.96
u0-1     DISK      OK             -       -       p1    -       2793.96
u0/v0    Volume    -              -       -       -     -       5587.91

Example 2

Inserting a 4-drive RAID-5 unit "u1" to the system with three volumes:

[424082.166392] 3w-9xxx: scsi4: AEN: INFO (0x04:0x001F): Unit operational:unit=1.
[424082.190561] scsi 4:0:1:0: Direct-Access     AMCC     9650SE-16M DISK  4.10 PQ: 0 ANSI: 5
[424082.191543] sd 4:0:1:0: Attached scsi generic sg3 type 0
[424082.191741] sd 4:0:1:0: [sde] 125829120 512-byte logical blocks: (64.4 GB/60.0 GiB)
[424082.191931] sd 4:0:1:0: [sde] Write Protect is off
[424082.191934] sd 4:0:1:0: [sde] Mode Sense: 23 00 10 00
[424082.192315] scsi 4:0:1:1: Direct-Access     AMCC     9650SE-16M DISK  4.10 PQ: 0 ANSI: 5
[424082.192488] sd 4:0:1:0: [sde] Write cache: enabled, read cache: enabled, supports DPO and FUA
[424082.193270] sd 4:0:1:1: Attached scsi generic sg5 type 0
[424082.194076] sd 4:0:1:1: [sdf] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB)
[424082.194176] scsi 4:0:1:2: Direct-Access     AMCC     9650SE-16M DISK  4.10 PQ: 0 ANSI: 5
[424082.194361] sd 4:0:1:1: [sdf] Write Protect is off
[424082.194363] sd 4:0:1:1: [sdf] Mode Sense: 23 00 10 00
[424082.195063] sd 4:0:1:1: [sdf] Write cache: enabled, read cache: enabled, supports DPO and FUA
[424082.196046] sd 4:0:1:2: Attached scsi generic sg6 type 0
[424082.196624] sd 4:0:1:2: [sdg] 15355076608 512-byte logical blocks: (7.86 TB/7.15 TiB)
[424082.197631] sd 4:0:1:2: [sdg] Write Protect is off
[424082.197637] sd 4:0:1:2: [sdg] Mode Sense: 23 00 10 00
[424082.198060] sd 4:0:1:2: [sdg] Write cache: enabled, read cache: enabled, supports DPO and FUA
[424082.250513] sd 4:0:1:2: [sdg] Attached SCSI disk
[424082.250777] sd 4:0:1:1: [sdf] Attached SCSI disk
[424082.272385] sd 4:0:1:0: [sde] Attached SCSI disk

We see:

  • sd 4:0:1:0: sde is /c4/u1/v0 (64GB)
  • sd 4:0:1:1: sdf is /c4/u1/v1 (1.06TB)
  • sd 4:0:1:2: sdg is /c4/u1/v2 (7.86TB)

Details from tw_cli:

# tw_cli /c4/u1 show

Unit     UnitType  Status         %RCmpl  %V/I/M  Port  Stripe  Size(GB)
------------------------------------------------------------------------
u1       RAID-5    OK             -       -       -     256K    8381.87
u1-0     DISK      OK             -       -       p2    -       2793.96
u1-1     DISK      OK             -       -       p3    -       2793.96
u1-2     DISK      OK             -       -       p4    -       2793.96
u1-3     DISK      OK             -       -       p6    -       2793.96
u1/v0    Volume    -              -       -       -     -       60
u1/v1    Volume    -              -       -       -     -       1000
u1/v2    Volume    -              -       -       -     -       7321.87
vmallet
  • 101
  • 2