0% found this document useful (0 votes)
39 views6 pages

New Lun To Rhel

The document describes how to add a new SAN (storage area network) disk to a Linux system using multipath. It involves installing the sg3_utils package, running rescan-scsi-bus.sh to detect new disks, checking that multipathd is configured to start automatically, starting the multipathd daemon, and editing /etc/multipath.conf to define the SAN disk subsystem. Running multipath commands verifies that the new disk is active with multipath I/O across multiple paths.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views6 pages

New Lun To Rhel

The document describes how to add a new SAN (storage area network) disk to a Linux system using multipath. It involves installing the sg3_utils package, running rescan-scsi-bus.sh to detect new disks, checking that multipathd is configured to start automatically, starting the multipathd daemon, and editing /etc/multipath.conf to define the SAN disk subsystem. Running multipath commands verifies that the new disk is active with multipath I/O across multiple paths.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

04/05/2019 Adding New SAN to Linux - RHEL World Experience

RHEL WORLD EXPERIENCE Search this site

Home RHEL 6 Tips and Tricks RHEL Disk Management - Tips and Tricks RPM Package Management - Tips and Tricks

Red Hat Documentation Red Hat Knowledge Base Sitemap

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&nbsp; SCSI target IDs&nbsp; 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

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&nbsp; 0 for&nbsp; SCSI target IDs&nbsp; 0 1 2 3 4 5 6 7, all LUNs

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&nbsp; all SCSI target IDs, all LUNs

Scanning for device 2 0 0 0 ...

OLD: Host: scsi2 Channel: 00 Id: 00 Lun: 00

Vendor: 3PARdata
Model: VV
Rev: 0000

Type: Direct-Access
ANSI SCSI revision: 05

Scanning host 3 for&nbsp; all SCSI target IDs, all LUNs

Scanning for device 3 0 0 0 ...

OLD: Host: scsi3 Channel: 00 Id: 00 Lun: 00

Vendor: 3PARdata
Model: VV*
Rev: 0000

Type: Direct-Access
ANSI SCSI revision: 05

0 new device(s) found.

0 device(s) removed.

Notice the vendor so you can define the disk sub system in /etc/multipath.conf

Configure multipath

Run Command :

/sbin/chkconfig --list | grep multipathd

this will check to make sure the multipath daemon is running in level 3

Example output:

[root@system \]# /sbin/chkconfig --list | grep multipathd

multipathd 0:off 1:off 2:off *3:on* 4:off 5:off 6:off

If it is not active in run level 3, activate it with this command then start the daemon

[root@system \]# /sbin/chkconfig --level 3 multipathd on

Make sure that the service is actually running

[root@system \]# service multipathd start

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:

[root@system \]# /sbin/multipath -d -ll

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.

“ %%%%%%%%%%%%%%%% “ - denotes sections that may need to be changed!

Example:

[root@system \]# vi /etc/multipath.conf


# This is a basic configuration file with some examples, for device mapper
# multipath.
# For a complete list of the default configuration values, see
# /usr/share/doc/device-mapper-multipath-0.4.7/multipath.conf.defaults
# For a list of configuration options with descriptions, see
# /usr/share/doc/device-mapper-multipath-0.4.7/multipath.conf.annotated

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*

*Comment out section below to disable blacklisting (ignore) everything*

#* Blacklist all devices by default. Remove this to enable multipathing


# on the default devices.
#blacklist { \devnode "*" #}

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*

## By default, devices with vendor = "IBM" and product = "S/390.*" are


## blacklisted. To enable mulitpathing on these devies, uncomment the
## following lines.
#blacklist_exceptions {

#device {
# vendor "IBM"
# product "S/390.*"
#}

#}

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*

## Use user friendly names, instead of using WWIDs as names such as mpath or dm-X

defaults { user_friendly_names yes }

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*

##

##

##

##

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

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*

Added section below

################### SAN DISK DEVICE SETTINGS 01/11/11 ##############################

device { vendor "3PARdata"


product "VV"
getuid_callout "/sbin/scsi_id \-g \-u \-s /block/%n"
features "0"
hardware_handler "0"
path_grouping_policy multibus
rr_weight uniform
rr_min_io 1000
path_checker readsector0
}

*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.

Defining san disk in LVM to the OS

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

[root@system \]# /sbin/multipath -d -ll

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:

vgcreate (san request vg name) /dev/dm-x

This will create the volume group used for the san disk

Example:

[root@system \]# vgcreate esolutionsprodvg /dev/dm-7

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:

lvcreate -L 500G -n 3_681_v503r_00_esolutionsprodvol esolutionsprodvg /dev/dm-7

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:

[root@system \]# lvscan


ACTIVE '/dev/esolutionsprodvg/3_681_v503r_00_esolutionsprodvol' [500.00 GB] inherit
ACTIVE '/dev/rootvg/rootvol' [7.81 GB] inherit
ACTIVE '/dev/rootvg/patvol' [1.94 GB] inherit
ACTIVE '/dev/rootvg/tmpvol' [1.44 GB] inherit
ACTIVE '/dev/rootvg/dstvol' [5.34 GB] inherit
ACTIVE '/dev/rootvg/appsvol' [1.94 GB] inherit
ACTIVE '/dev/rootvg/cvvol' [1.94 GB] inherit
ACTIVE '/dev/rootvg/swap' [1.44 GB] inherit

This shows our logical volume we created and the size.

Creating and Defining file the systems and attributes

Run Command:

/sbin/mkfs.ext3

Example:

[root@system \]# mkfs.ext3 /dev/esolutionsprodvg/3_681_v503r_00_esolutionsprodvol

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:

[root@system \]# cat /etc/fstab

/dev/rootvg/rootvol / ext3 defaults 1 1


/dev/rootvg/patvol /var/patrol ext3 defaults 1 2
/dev/rootvg/tmpvol /tmp ext3 defaults 1 2
/dev/rootvg/dstvol /dst ext3 defaults 1 2
/dev/rootvg/appsvol /apps ext3 defaults 1 2
/dev/rootvg/cvvol /apps/cv ext3 defaults 1 2

LABEL=/boot /boot ext3 defaults 1 2


tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0

/dev/rootvg/swap swap swap defaults 0 0

# 3Par San Disk Frame 681


/dev/esolutionsprodvg/3_681_v503r_00_esolutionsprodvol /dst/informa/prod ext3
defaults 1 2

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

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/mapper/rootvg-rootvol 7935392 1700788 5825004 23% /


/dev/mapper/rootvg-patvol 1967952 35784 1830588 2% /var/patrol
/dev/mapper/rootvg-tmpvol 1460048 35032 1349652 3% /tmp
/dev/mapper/rootvg-dstvol 5427652 144564 5002924 3% /dst
/dev/mapper/rootvg-appsvol 1967952 35792 1830580 2% /apps
/dev/mapper/rootvg-cvvol 1967952 35784 1830588 2% /apps/cv
/dev/cciss/c0d0p1 248895 19759 216286 9% /boot
tmpfs 66043400 0 66043400 0% /dev/shm
/dev/mapper/esolutionsprodvg-3_681_v503r_00_esolutionsprodvol 6061624 202656 510616088
1% /dst/informa/prod

Comments

You do not have permission to add 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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy