How to scan for newly added disks/luns?
- rescan-scsi-bus.sh [Redhat Genuine utility]
- if hp tools are installed then use command hp_rescan -h for scanning new lun
#rescan-scsi-bus.sh
Host adapter 0 (ata_piix) found.
Host adapter 1 (ata_piix) found.
Host adapter 2 (lpfc) found.
Host adapter 3 (lpfc) found.
Scanning SCSI subsystem for new devices
Scanning host 0 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning for device 0 0 0 0 ...
OLD: Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: TEAC Model: DV-28S-W Rev: C.2D
Type: CD-ROM ANSI SCSI revision: 05
Scanning host 1 channels 0 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Scanning host 2 for all SCSI target IDs, all LUNs
Scanning for device 2 0 0 0 ...
OLD: Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: OPEN-V Rev: 6006
Type: Direct-Access ANSI SCSI revision: 03
Scanning for device 2 0 1 0 ...
OLD: Host: scsi2 Channel: 00 Id: 01 Lun: 00
Vendor: HP Model: OPEN-V Rev: 6006
Type: Direct-Access ANSI SCSI revision: 03
Scanning for device 2 0 2 0 ...
OLD: Host: scsi2 Channel: 00 Id: 02 Lun: 00
Vendor: HP Model: OPEN-V Rev: 6006
Type: Direct-Access ANSI SCSI revision: 03
Scanning host 3 for all SCSI target IDs, all LUNs
Scanning for device 3 0 0 0 ...
OLD: Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: OPEN-V Rev: 6006
Type: Direct-Access ANSI SCSI revision: 03
Scanning for device 3 0 1 0 ...
OLD: Host: scsi3 Channel: 00 Id: 01 Lun: 00
Vendor: HP Model: OPEN-V Rev: 6006
Type: Direct-Access ANSI SCSI revision: 03
Scanning for device 3 0 2 0 ...
OLD: Host: scsi3 Channel: 00 Id: 02 Lun: 00
Vendor: HP Model: OPEN-V Rev: 6006
Type: Direct-Access ANSI SCSI revision: 03
0 new device(s) found.-----------------------------------> Newly added devices
0 device(s) removed.-------------------------------> newly removed devices.
#
List all supported fibre channel HBAs
#hp_rescan -l
QLogic adapters:
QLogic adapters:
Emulex adapters:
/sys/class/scsi_host/3
/sys/class/scsi_host/2
/sys/class/scsi_host/2
Brocade adapters:
#
#hp_rescan -a -----> will show what are the host adapters are used for the disks, here host0 & host1
Rescanning /sys/class/scsi_host/host0
Rescanning /sys/class/scsi_host/host1
#
Rescanning /sys/class/scsi_host/host0
Rescanning /sys/class/scsi_host/host1
#
# adapter_info -l
sda 3,0,0,0 HP OPEN-V 6008
sdb 3,0,1,0 HP OPEN-V 6008
sdc 3,0,2,0 HP OPEN-V 6008
sdd 2,0,0,0 HP OPEN-V 6008
sde 2,0,1,0 HP OPEN-V 6008
sdf 2,0,2,0 HP OPEN-V 6008
sg1 3,0,0,0 HP OPEN-V 6008
sg2 3,0,1,0 HP OPEN-V 6008
sg3 3,0,2,0 HP OPEN-V 6008
sg4 2,0,0,0 HP OPEN-V 6008
sg5 2,0,1,0 HP OPEN-V 6008
sg6 2,0,2,0 HP OPEN-V 6008
#
sda 3,0,0,0 HP OPEN-V 6008
sdb 3,0,1,0 HP OPEN-V 6008
sdc 3,0,2,0 HP OPEN-V 6008
sdd 2,0,0,0 HP OPEN-V 6008
sde 2,0,1,0 HP OPEN-V 6008
sdf 2,0,2,0 HP OPEN-V 6008
sg1 3,0,0,0 HP OPEN-V 6008
sg2 3,0,1,0 HP OPEN-V 6008
sg3 3,0,2,0 HP OPEN-V 6008
sg4 2,0,0,0 HP OPEN-V 6008
sg5 2,0,1,0 HP OPEN-V 6008
sg6 2,0,2,0 HP OPEN-V 6008
#
Execute the below command to get the DM disks:
multipath -ll
mpath0 (360060e800571e700000071e700006021) dm-10 HP,OPEN-V
[size=102G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=2][active]
\_ 3:0:3:0 sdi 8:128 [active][ready]
\_ 2:0:3:0 sdk 8:160 [active][ready]
[size=102G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=2][active]
\_ 3:0:3:0 sdi 8:128 [active][ready]
\_ 2:0:3:0 sdk 8:160 [active][ready]
-------> here the sdi & sdk are the alternate paths which forms the "mpath0"
Allocate the total disk space to Primary partation 1
#fdisk /dev/mapper/mpath0
select n() to create the new partation
Select Primary partation
select 1
Enter to take the default(total space allocation)
select w(write) to save the created partation
select n() to create the new partation
Select Primary partation
select 1
Enter to take the default(total space allocation)
select w(write) to save the created partation
Scan the newly added device and update the modified permission to Kernel
#partprobe
use the kpartx utility creates the device maps from partition tables
#kpartx -a /dev/mapper/mpath0
create the physical volume with lable information
#pvcreate /dev/mapper/mpath0p1
Extend the VG
#lvextend -L +100g /dev/mapper/vg-u01
Extending logical volume u03 to 200.00 GB
Logical volume u01 successfully resized
#
Extending logical volume u03 to 200.00 GB
Logical volume u01 successfully resized
#
resize the file system
# resize2fs /dev/mapper/vg-u01
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/vg-u01 is mounted on /u01; on-line resizing required
Performing an on-line resize of /dev/mapper/vg-u01 to 52428800 (4k) blocks.
The filesystem on /dev/mapper/vg-u01 is now 52428800 blocks long.
#
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/vg-u01 is mounted on /u01; on-line resizing required
Performing an on-line resize of /dev/mapper/vg-u01 to 52428800 (4k) blocks.
The filesystem on /dev/mapper/vg-u01 is now 52428800 blocks long.
#