Вы находитесь на странице: 1из 6

Discover LUNS using HDLM & Create VG using ... http://digiturf.net/blog/discover-luns-using-hdlm-c...

digiturf.net
myspace for everything i learn and share

HOME *NIX & OTHER LIT & HOBBY VIEW FINDER MY-WIKI CONTACT US

Discover LUNS using HDLM & Create VG


using LVM2 in Linux.
*** This is a step by step procedure to discover the LUNS in Linux
which are allocated from storage end and then create a Volume group
with those LUNS using Linux LVM2 ***

Discovering the LUNS using HDLM in Linux :

* * Once you get the confirmation from storage that LUN’s are
allocated to the server required, follow this procedure. Storage will
provide you with LUN ID’s allocated to the server.

1. echo “- – -” > /sys/class/scsi_host/host*/scan    – Do this for “host0


– 15”.
2. dlmcfgmgr -r                                      – Re-configure / rescan the
HDLM.

* * After executing the 2nd step, you will receive message from HDLM

1 de 6 05/10/17 14:41
Discover LUNS using HDLM & Create VG using ... http://digiturf.net/blog/discover-luns-using-hdlm-c...

stating that, there is a change in configuration, which indicates that


LUN’s are identified in server.

# /opt/DynamicLinkManager/bin/dlnkmgr view -path   –   Will show


new LUN’s discovered. Compare them with LUN ID’s storage team has
provided earlier.

* * Then take the device files of those new LUN’s. Ex: /dev/sddlmaX
* * Here the LUN’s i’ve got are as follows. Total 5 LUN’s, each 100 GB.

/dev/sddlmag
/dev/sddlmah
/dev/sddlmai
/dev/sddlmaj
/dev/sddlmak

Creating Volume group using Linux LVM2 :

* * First create PV (Physical Volume) for each device as follows.

# lvm pvcreate /dev/sddlmag


Physical volume “/dev/sddlmag” successfully created

# lvm pvcreate /dev/sddlmah


Physical volume “/dev/sddlmah” successfully created

# lvm pvcreate /dev/sddlmai


Physical volume “/dev/sddlmai” successfully created

# lvm pvcreate /dev/sddlmaj


Physical volume “/dev/sddlmaj” successfully created

# lvm pvcreate /dev/sddlmak


Physical volume “/dev/sddlmak” successfully created

# lvm vgcreate data2vg /dev/sddlmag   –  Created VG with name


“data2vg” adding disk /dev/sddlmag to it and then add remaining four
Lun’s into VG “data2vg” with following command.
# vgextend data2vg /dev/sddlmai
# vgextend data2vg /dev/sddlmaj
# vgextend data2vg /dev/sddlmak

# pvs                                 – Shows Physical Volume info.


PV          VG     Fmt  Attr  PSize     PFree
/dev/sddlmaa datavg  lvm2 a-   100.00G      0
/dev/sddlmab datavg  lvm2 a-   100.00G      0
/dev/sddlmac datavg  lvm2 a-   100.00G      0

2 de 6 05/10/17 14:41
Discover LUNS using HDLM & Create VG using ... http://digiturf.net/blog/discover-luns-using-hdlm-c...

/dev/sddlmad datavg  lvm2 a-   100.00G      0


/dev/sddlmae datavg  lvm2 a-   100.00G      0
/dev/sddlmaf prodvg  lvm2 a-    50.00G      0
/dev/sddlmag data2vg lvm2 a-   100.00G 100.00G
/dev/sddlmah data2vg lvm2 a-   100.00G 100.00G
/dev/sddlmai data2vg lvm2 a-   100.00G 100.00G
/dev/sddlmaj data2vg lvm2 a-   100.00G 100.00G
/dev/sddlmak data2vg lvm2 a-   100.00G 100.00G

* * “data2vg” has 5 PV’s each 100GB as said earlier. #lvs is not


complete unless we create logical volume for this VG. Hence it looks
as follows.

# lvs
LV        VG     Attr      LSize   Origin Snap%  Move Log Copy%  Convert
datalv datavg -wi-ao 499.98G
prodlv prodvg -wi-ao  50.00G

* * #vgs is complete as volume group is created and looks fine from


below output.

# vgs
VG         #PV #LV #SN Attr   VSize   VFree
data2vg   5   0   0 wz–n- 499.98G 499.98G
datavg    5   1   0 wz–n- 499.98G      0
prodvg    1   1   0 wz–n-  50.00G      0

* * To create LV, we need to know the No.of PE’s (Physical Extent) for
that particular Volume Group created.We can get that Number by 
#vgdisplay data2vg

# vgdisplay data2vg
— Volume group —
VG Name               data2vg
System ID
Format                lvm2
Metadata Areas        5
Metadata Sequence No  5
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                0
Open LV               0
Max PV                0
Cur PV                5

3 de 6 05/10/17 14:41
Discover LUNS using HDLM & Create VG using ... http://digiturf.net/blog/discover-luns-using-hdlm-c...

Act PV                5
VG Size               499.98 GB
PE Size               4.00 MB
Total PE              127995
Alloc PE / Size       0 / 0
Free  PE / Size       127995 / 499.98 GB
VG UUID               9tBXcp-rLL0-ZWLD-8eMi-70N0-RTuU-Z75XgD

* * Now to create the LV by executing the following command :

# lvm lvcreate -l 127995 -n data2lv data2vg


Logical volume “data2lv” created

* * Create the file system in newly created LV.

# mkfs -t ext3 /dev/data2vg/data2lv


mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
65536000 inodes, 131066880 blocks
6553344 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
4000 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616,
78675968,
102400000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

* * Now create the directory and give it appropriate permissions


required and mount the VG / File system that is created.

# mkdir /oradata
# chown oracle:dba /oradata

4 de 6 05/10/17 14:41
Discover LUNS using HDLM & Create VG using ... http://digiturf.net/blog/discover-luns-using-hdlm-c...

# chmod 777 /oradata

# mount /dev/data2vg/data2lv  /oradata

# df -Th  /oradata
/dev/mapper/data2vg-data2lv     ext3    493G  198M  467G   1%
/oradata

* * Make a following entry in /etc/fstab , so it is mounted at boot time.


/dev/data2vg/data2lv   /data2                  ext3    defaults        1 2

Share this:

  

Related

Finding the UID Replace a failing Remove network


of LUN in Linux. / failed HBA on bonding in Linux.
July 27, 2014 AIX Server.
April 28, 2014

By rajeshdeva | May 10, 2011 | UNIX & OTHER | 1 Comment |

Disabling BBU Req & Enabling WriteBack on LSI RAID Cards →

One thought on “Discover LUNS using


HDLM & Create VG using LVM2 in
Linux.”
1. Anonymous
September 22, 2011 at 06:46

You did not mention what you did in /etc/lvm/lvm.conf

5 de 6 05/10/17 14:41
Discover LUNS using HDLM & Create VG using ... http://digiturf.net/blog/discover-luns-using-hdlm-c...

Reply ↓

Leave a Reply

Copyright © 2017 digiturf.net | Theme by: Theme Horse | Powered by:


WordPress

6 de 6 05/10/17 14:41