New Lun To Rhel
New Lun To Rhel
Home RHEL 6 Tips and Tricks RHEL Disk Management - Tips and Tricks RPM Package Management - Tips and Tricks
Home Home > RHEL Disk Management - Tips and Tricks >
Creating a YUM
Repository
Handy Bash
Adding New SAN to Linux
Commands
posted Dec 19, 2012, 1:22 PM by John Horne
Networking - Tips
and Tricks
RHEL 6 Tips and
Tricks
RHEL Disk
Management - Tips
Scan the SCSI bus for new LUNs
and Tricks
Adding New
SAN to Linux To scan the SCSI bus, the package sg3utils must be installed.
Example
Partition Run command :
Creation
Example Volume yum install sg3_utils
Group and
Logical Volume
Run command :
Extension
Logical Volume
Reduction /usr/bin/rescan-scsi-bus.sh*
LVM Reduction
and This command scans the bus to detect new disk
Considerations
Merging Volume Example Output :
Groups in RHEL
- vgmerge \[root@system\]# /usr/bin/rescan-scsi-bus.sh
Moving a volume
group to another
system Host adapter 0 (ata_piix) found.
Partition
Extension and Host adapter 1 (ata_piix) found.
LVM Extension
of RHEL Guest
Recovering from Host adapter 2 (<NULL>) found.
a Bad Logical
Volume
Reduction! Host adapter 3 (<NULL>) found.
Resizing an
Extended Scanning SCSI subsystem for new devices
Partition - No
LVM in use
RPM Package Scanning host 0 for SCSI target IDs 0 1 2 3 4 5 6 7, all LUNs
Management - Tips
and Tricks
Report Luns command not supported (support mandatory in SPC-3)
Sitemap
Vendor: TEAC
Model: DV-28S-W
Rev: C.2D
Type: CD-ROM
ANSI SCSI revision: 05
https://sites.google.com/site/rhelworldexperience/home/rhel-disk-management---tips-and-tricks/addingnewsantolinux 1/6
04/05/2019 Adding New SAN to Linux - RHEL World Experience
Scanning host 2 for all SCSI target IDs, all LUNs
Vendor: 3PARdata
Model: VV
Rev: 0000
Type: Direct-Access
ANSI SCSI revision: 05
Vendor: 3PARdata
Model: VV*
Rev: 0000
Type: Direct-Access
ANSI SCSI revision: 05
0 device(s) removed.
Notice the vendor so you can define the disk sub system in /etc/multipath.conf
Configure multipath
Run Command :
this will check to make sure the multipath daemon is running in level 3
Example output:
If it is not active in run level 3, activate it with this command then start the daemon
Run Command:
/sbin/multipath -d -ll
This will show that multipath is working and with confirmation that the disk is active down 2 paths using
Lun0. Mpath0 and dm-7 are human readable device names with the size of the thin provisioned volume
Example Output:
https://sites.google.com/site/rhelworldexperience/home/rhel-disk-management---tips-and-tricks/addingnewsantolinux 2/6
04/05/2019 Adding New SAN to Linux - RHEL World Experience
*mpath0* (350002ac1120a0a79) *dm-7* 3PARdata,VV
[*size=1000G*][features=0][hwhandler=0][rw]
_ round-robin 0 [prio=2][active]
_ 3:0:0:*0* sda 8:0 [active][ready]
_ 2:0:0:*0* sdb 8:16 [active][ready]
Run Command:
vi /etc/multipath.conf
Edit multipath.conf file to define the san disk subsystem the server is connected to, in this case the system
is using 3Par. For file size sake, I removed unused sections that where already commented out.
Example:
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*
#device {
# vendor "IBM"
# product "S/390.*"
#}
#}
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*
## Use user friendly names, instead of using WWIDs as names such as mpath or dm-X
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*
##
##
##
##
https://sites.google.com/site/rhelworldexperience/home/rhel-disk-management---tips-and-tricks/addingnewsantolinux 3/6
04/05/2019 Adding New SAN to Linux - RHEL World Experience
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*
*Important note – this last section of the file is derived from an example file called
/usr/share/doc/device-mapper-multipath-0.4.7/multipath.conf.defaults
The “3PARdata” section was copied over to the multipath.conf file . Pay close attention to
the device brackets syntax, making sure they are in place as well.
Using the output from multipath -d --ll, the device to use is /dev/dm-7 in our example
Define the vg using the name in the san request spread sheet
Run command:
This will create the volume group used for the san disk
Example:
Check with the command vgdisplay to see that the correct volume group name and size is defined.
Run command:
lvcreate -L (disk size)G -n (san request name) (san req volume group) /dev/dm-X
Example:
This example defined a 500G volume on a 3Par array serial number 681, device and lun number.
Run command:
/usr/sbin/lvscan
https://sites.google.com/site/rhelworldexperience/home/rhel-disk-management---tips-and-tricks/addingnewsantolinux 4/6
04/05/2019 Adding New SAN to Linux - RHEL World Experience
Example output:
Run Command:
/sbin/mkfs.ext3
Example:
This will create the file systems as ext3 on the device volume defined
Run Command:
/sbin/tune2fs
Example:
tune2fs -m 1 /dev/esolutionsprodvg/3_681_v503r_00_esolutionsprodvol
This will a reserve space on the file system of 1%, otherwise default would be 5%. Some admins use 0
Last stages would be to create the directory you would want to mount the file system with the san defined
logical volume. Update the /etc/fstab file, please add the san disk comments in fstab for future and easier
disk identification.
Example:
Run command:
df -k
https://sites.google.com/site/rhelworldexperience/home/rhel-disk-management---tips-and-tricks/addingnewsantolinux 5/6
04/05/2019 Adding New SAN to Linux - RHEL World Experience
Example output:
[root@system \]# df -k
Comments
Sign in | Recent Site Activity | Report Abuse | Print Page | Powered By Google Sites
https://sites.google.com/site/rhelworldexperience/home/rhel-disk-management---tips-and-tricks/addingnewsantolinux 6/6