Thursday, 8 July 2010

Mapping /dev/sg to scsi disks

This is another thing that has been making life difficult, particularly when configuring scsi passthru devices under vmware.

Just say you have a device /dev/sdd that you want to pass through to a guest machine. When you configure it under vmware you can't use the normal nomenclature (ie /dev/sdd), you must pass through the "sg" device (ie /dev/sg3)

The trouble is, sometimes it is hard to figure out which sg device is which.

The answer is to use the "sg_map" command.

sudo apt-get install sg3-utils

brettg@jupiter:~# sudo sg_map
/dev/sg0 /dev/sda
/dev/sg1 /dev/sdb
/dev/sg2 /dev/sdc
/dev/sg3 /dev/sdd
/dev/sg4 /dev/sde
/dev/sg5 /dev/sdf
/dev/sg6 /dev/sdg
/dev/sg7 /dev/sdh


Easy peasy!

1 comment:

Anonymous said...

Or install lscsi...

then:

#lscsci -g