How to scan Lun on VMware running Redhat Linux Guest OS

In this tutorial, I will show how to scan LUNs from Redhat Linux Vmware Guest OS (this example is from RHEL3). After you map the LUNs for the virtual machine, you should make them visible to the operating system.

The following commands help to scan and identify the disks / LUNs mapped with RHEL3.

1) Show available additional LUNS

The following command will display the available LONS that are already visible to the operating system.

# Cat / proc / scsi / sg / devices host channel ID lun type open qdepth busy online 0 0 0 0 0 5 28 0 1 0 0 1 0 0 1 28 0 1 0 0 2 0 0 1 28 0 1

# Cat / proc / scsi / scsi connected device: host: scsi0 channel: 00 ID: 00 Lun: 00 vendor: VMware model: virtual disk revision: 1.0 type: Direct-Access ANSI SCSI revision: 02 host: scsi0 Channel: 00 ID: 01 Lun: 00 Vendor: VMware Model: Virtual Disk Revision: 1.0 Type: Direct-Access ANSI SCSI Version: 02 Host: scsi0 Channel: 00 ID: 02 Lun: 00 Vendor: VMware Model: Virtual Disk Revision: 1.0 Type: Direct-Access ANSI SCSI Version: 02

2) Scan the scsi device

This will scan scsi for mapped LUNs

#echo “scsi add-single-device 0 0 3 0”> / proc / scsi / scsi

# echo "scsi add-single-device 0 0 3 0" >/proc/scsi/scsi

where,

-“0 0 3 0” = “” host, channel, ID, LUN “

You can now see that the new LUN has been added to the file or operating system.

# Cat / proc / scsi / scsi connected device: host: scsi0 channel: 00 ID: 00 Lun: 00 vendor: VMware model: virtual disk revision: 1.0 type: Direct-Access ANSI SCSI revision: 02 host: scsi0 Channel: 00 ID: 01 Lun: 00 Vendor: VMware Model: Virtual Disk Revision: 1.0 Type: Direct-Access ANSI SCSI Version: 02 Host: scsi0 Channel: 00 ID: 02 Lun: 00 Vendor: VMware Model: Virtual Disk Revision: 1.0 Type: Direct-Access ANSI SCSI Revision: 02 Host: scsi0 Channel: 00 Id: 03 lun: 00 Vendor: VMware Model: Virtual Disk Revision: 1.0 Type: Direct-Access ANSI SCSI Revision: 02

You can also use the fdisk command to find the disk native url and disk details.

#Fdisk -l 2> / dev / null | egrep “^ disk” | egrep -v’dm-‘disk / dev / sda: 12.5 GB, 12582912000 bytes disk / dev / sdb: 37.7 GB, 37487736000 bytes disk / dev / sdc: 38.6 GB, 38654705664 bytes disk / dev / sdd: 53.6 GB, 53687091200 bytes

Also read:

  • How to scan / detect new LUNs on Linux
Sidebar