Link to home
Start Free TrialLog in
Avatar of Ezan Javeed
Ezan JaveedFlag for Australia

asked on

Configuration of lun in 2 partion and mounting to server

Hi Everyone,

I am having issue finding  the luns configuration.
From the output of $df -h

/dev/mapper/olinux008_d1-opt        /opt
/dev/mapper/olinux008_d1-userhome    /userhome

The above are 2 partition made of  of a single lun (storage)
I am really having hard time finding the configuration how this was being done.
I need to replicate same configuration on pre-productin server

Your help much appreciated.

***************
disk Information
***************

/dev/disk/by-label:
total 0
drwxr-xr-x 2 root root 120 Oct 18 20:36 .
drwxr-xr-x 6 root root 120 Oct 18 20:36 ..
lrwxrwxrwx 1 root root  10 Oct 18 20:36 boot -> ../../sda1
lrwxrwxrwx 1 root root  10 Oct 18 20:36 SWAP-sda2 -> ../../sda2
lrwxrwxrwx 1 root root  10 Oct 18 20:36 tmp -> ../../sda5
lrwxrwxrwx 1 root root  10 Oct 18 20:36 var -> ../../sda3

/dev/disk/by-path:
total 0
drwxr-xr-x 2 root root 260 Oct 18 20:36 .
drwxr-xr-x 6 root root 120 Oct 18 20:36 ..
lrwxrwxrwx 1 root root   9 Oct 18 20:36 pci-0000:01:00.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root  10 Oct 18 20:36 pci-0000:01:00.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Oct 18 20:36 pci-0000:01:00.0-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root  10 Oct 18 20:36 pci-0000:01:00.0-scsi-0:0:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root  10 Oct 18 20:36 pci-0000:01:00.0-scsi-0:0:0:0-part4 -> ../../sda4
lrwxrwxrwx 1 root root  10 Oct 18 20:36 pci-0000:01:00.0-scsi-0:0:0:0-part5 -> ../../sda5
lrwxrwxrwx 1 root root  10 Oct 18 20:36 pci-0000:01:00.0-scsi-0:0:0:0-part6 -> ../../sda6
lrwxrwxrwx 1 root root   9 Oct 18 20:36 pci-0000:09:00.0-fc-0x50060e8005bc2825:0x0000000000000000 -> ../../sdb
lrwxrwxrwx 1 root root  10 Oct 18 20:36 pci-0000:09:00.0-fc-0x50060e8005bc2825:0x0000000000000000-part1 -> ../../sdb1
lrwxrwxrwx 1 root root   9 Oct 18 20:36 pci-0000:0f:00.0-fc-0x50060e8005bc2835:0x0000000000000000 -> ../../sdc
lrwxrwxrwx 1 root root  10 Oct 18 20:36 pci-0000:0f:00.0-fc-0x50060e8005bc2835:0x0000000000000000-part1 -> ../../sdc1

/dev/disk/by-uuid:
total 0
drwxr-xr-x 2 root root 120 Oct 18 20:36 .
drwxr-xr-x 6 root root 120 Oct 18 20:36 ..
lrwxrwxrwx 1 root root  10 Oct 18 20:36 714ce609-1249-4b7a-8788-5e6666b812ea -> ../../sda3
lrwxrwxrwx 1 root root  10 Oct 18 20:36 806854e9-ef3f-4ee3-9026-d814901b16fa -> ../../sda5
lrwxrwxrwx 1 root root  10 Oct 18 20:36 80fba7fa-7cad-44aa-bf22-cb1e54360973 -> ../../sda1
lrwxrwxrwx 1 root root  10 Oct 18 20:36 e424d45e-4db5-40a0-b35c-6ad6264c755a -> ../../sda6

/dev/mapper:
total 0
drwxr-xr-x  2 root root     140 Oct 18 20:36 .
drwxr-xr-x 13 root root    3980 Mar 21 05:49 ..
crw-------  1 root root  10, 63 Oct 18 20:36 control
brw-rw----  1 root disk 253,  0 Oct 18 20:36 mpath1
brw-rw----  1 root disk 253,  1 Oct 18 20:36 mpath1p1
brw-rw----  1 root disk 253,  3 Oct 18 20:36 olinux008_d1-opt
brw-rw----  1 root disk 253,  2 Oct 18 20:36 olinux008_d1-userhome

/dev/mpath:
total 0
drwxr-xr-x  2 root root   80 Oct 18 20:36 .
drwxr-xr-x 13 root root 3980 Mar 21 05:49 ..
lrwxrwxrwx  1 root root    7 Oct 18 20:36 360060e8005bc28000000bc2800002712 -> ../dm-0
lrwxrwxrwx  1 root root    7 Oct 18 20:36 360060e8005bc28000000bc2800002712p1 -> ../dm-1

/dev/rchmms008_d1:
total 0
drwx------  2 root root   80 Nov 22 02:51 .
drwxr-xr-x 13 root root 3980 Mar 21 05:49 ..
lrwxrwxrwx  1 root root   28 Nov 22 02:51 opt -> /dev/mapper/olinux008_d1-opt
lrwxrwxrwx  1 root root   33 Oct 18 20:36 userhome -> /dev/mapper/olinux008_d1-userhome


Thanks
Javeed A
Avatar of upanwar
upanwar
Flag of India image

Could you please show us the out put of:

#pvscan

# pvdisplay -v

# vgdisplay -v

# lvdisplay -v
Avatar of Ezan Javeed

ASKER

#######-----
#pvscan
# pvdisplay -v
# vgdisplay -v
# lvdisplay -v
# pvscan

-----########

  PV /dev/dm-1   VG olinux008_d1   lvm2 [100.00 GB / 0    free]
  Total: 1 [100.00 GB] / in use: 1 [100.00 GB] / in no VG: 0 [0   ]
[root@olinux008 ~]# pvdisplay -v
    Scanning for physical volume names
  --- Physical volume ---
  PV Name               /dev/dm-1
  VG Name               olinux008_d1
  PV Size               100.00 GB / not usable 2.66 MB
  Allocatable           yes (but full)
  PE Size (KByte)       4096
  Total PE              25599
  Free PE               0
  Allocated PE          25599
  PV UUID               ny4fxx-NfrE-WbSS-3dGo-MkEQ-kAzM-rufQkQ

[root@olinux008 ~]# vgdisplay -v
    Finding all volume groups
    Finding volume group "olinux008_d1"
  --- Volume group ---
  VG Name               olinux008_d1
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               100.00 GB
  PE Size               4.00 MB
  Total PE              25599
  Alloc PE / Size       25599 / 100.00 GB
  Free  PE / Size       0 / 0
  VG UUID               bcZWKg-9r8z-McQ0-R1bO-I2k2-Xc4S-kOSGSa

  --- Logical volume ---
  LV Name                /dev/olinux008_d1/userhome
  VG Name                olinux008_d1
  LV UUID                7Mjl8c-2c3d-jkkk-THOw-11oV-oN7s-LkWn6v
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                20.00 GB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Logical volume ---
  LV Name                /dev/olinux008_d1/opt
  VG Name                olinux008_d1
  LV UUID                lcvuCF-QIqV-lKwA-2Kjo-PA0L-VsTj-hAvuYK
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                80.00 GB
  Current LE             20479
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:3

  --- Physical volumes ---
  PV Name               /dev/dm-1
  PV UUID               ny4fxx-NfrE-WbSS-3dGo-MkEQ-kAzM-rufQkQ
  PV Status             allocatable
  Total PE / Free PE    25599 / 0

[root@olinux008 ~]# lvdisplay -v
    Finding all logical volumes
  --- Logical volume ---
  LV Name                /dev/olinux008_d1/userhome
  VG Name                olinux008_d1
  LV UUID                7Mjl8c-2c3d-jkkk-THOw-11oV-oN7s-LkWn6v
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                20.00 GB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Logical volume ---
  LV Name                /dev/olinux008_d1/opt
  VG Name                olinux008_d1
  LV UUID                lcvuCF-QIqV-lKwA-2Kjo-PA0L-VsTj-hAvuYK
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                80.00 GB
  Current LE             20479
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:3

[root@olinux008 ~]#
Do you need thr step by step command to how to create the same filesystem layout in the another box or a overview would be enough?

Upanwar

Step by step is much appreciated


an overview on how the command need to be run and what they doing..

This will be great help for me


Thanks
Javeed A
Alright, First ask your storage team to present a 100 GB LUN to your box. Once they confirm then scan the new presented LUN to the box. Once the new LUN is available, a dm device will be created.

Run the below given commands to achieve your goal.

# pvreate /dev/dm-x

# vgcreate olinux008_d1 /dev/dm-x

# lvcreate -l 5120 -n userhome olinux008_d1

# lvcreate -l 20479 -n opt olinux008_d1


These steps will ctrate the same size of LVM as you require. After that you need to create the file system on that newly created LVs. If you require any help in that as well, please send me output of below given command.

# df -Th

Also update which linux distro you are using.
Thanks upanwar

I am trying to understand what i am doing.. I have gone through some notes now it make sense but have few questions

Q1- How do you check the lun is showing to OS after Storage team assign the lun to the server

Q2-Need clarification on this
#pvcreate /dev/dm-x  <--- what this command doing

#vgcreate olinux008_d1 /dev/dm-x  <-------here we creating Volume group

#lvcreate -l 5120 -n userhome olinux008_d1 <---- here its creating lv of vg of 20GB

#lvcreate -l 20479 -n opt olinux008_d1  <------ here its creating lv of vg of 80GB

Q3after the above command.how do i create file system and mounting procedure

thanks
Javeed A
Here internet is not working so once it will fix. I will get back to you.
Till the time could you please show us output of.

# df -Th
[jabdul@olinux008 ~]$ df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda6     ext3     20G  1.9G   17G  10% /
/dev/sda5     ext3     20G  173M   19G   1% /tmp
/dev/sda3     ext3     20G  3.9G   15G  21% /var
/dev/sda1     ext3    190M   12M  169M   7% /boot
tmpfs        tmpfs     24G     0   24G   0% /dev/shm
/dev/mapper/olinux008_d1-opt
              ext3     79G   63G   13G  84% /opt
/dev/mapper/olinux008_d1-userhome
              ext3     20G  7.6G   12G  41% /userhome

its a oracle Enterprise Linux server
Could you please tell me the make of the HBA so that we can tell you the way to scan the newly presented LUNs.

or If your box is not a production box then you can just reboot your system, LUNs will be available in your system after reboot.

Please update so that we can proceed further.
Qlogic is connected

QLogic HBA-Snapshot Utility.
QLogic HBA Host7 Information
WWPN: 0xxxxxxxxxxxxxxxxxxx1
WWNN: 0xxxxxxxxxxxxxxxxxxx11
Driver Version: 8.02.00.06.05.03-k
Model: QEM3472
Firmware Version: 4.04.05 [IP] [Multi-ID] [84XX]
Link State: Link Up - F_Port
Device Information
Device : 0
Vendor: HITACHI
Model: OPEN-V
WWPN: 0xxxxxxxxxxxxxxxxx1
Port ID: 0x141a00
Number of LUNs: 1

QLogic HBA Host8 Information
WWPN: 0xxxxxxxxxxxxxxxxxx2
WWNN: 0xxxxxxxxxxxxxxxxxx22
Driver Version: 8.02.00.06.05.03-k
Model: QEM3472
Firmware Version: 4.04.05 [IP] [Multi-ID] [84XX]
Link State: Link Down

QLogic HBA Host9 Information
WWPN: 0xxxxxxxxxxxxxxxxxx3
WWNN: 0xxxxxxxxxxxxxxxxxx33
Driver Version: 8.02.00.06.05.03-k
Model: QEM3472
Firmware Version: 4.04.05 [IP] [Multi-ID] [84XX]
Link State: Link Up - F_Port
Device Information
Device : 0
Vendor: HITACHI
Model: OPEN-V
WWPN: 0xxxxxxxxxxxxxxxxxx333
Port ID: 0x011900
Number of LUNs: 1

QLogic HBA Host10 Information
WWPN: 0xxxxxxxxxxxxxxxxxx4
WWNN: 0xxxxxxxxxxxxxxxxxx44
Driver Version: 8.02.00.06.05.03-k
Model: QEM3472
Firmware Version: 4.04.05 [IP] [Multi-ID] [84XX]
Link State: Link Down
For Your Clarification:

Q2-Need clarification on this
#pvcreate /dev/dm-x  <--- what this command doing

This command will create Physical Volume for the newly available LUNs. When we need to configure LVM filesystem then first we need to create PV the VG and then we can create LV.

#vgcreate olinux008_d1 /dev/dm-x  <-------here we creating Volume group
Yes, You are right.

#lvcreate -l 5120 -n userhome olinux008_d1 <---- here its creating lv of vg of 20GB
Correct

#lvcreate -l 20479 -n opt olinux008_d1  <------ here its creating lv of vg of 80GB
Correct

Q3after the above command.how do i create file system and mounting procedure
Since you are using the ext3 filesystem so you need to create the same in this box as well. For that follow the below given steps.

#mkfs.ext3 /dev/olinux008_d1/opt

#mkfs.ext3 /dev/olinux008_d1/userhome

Now filesystem has been created and your LVs are ready to mount.

Since /opt is always there in linux box so we need to create  /userhome mount point only. follow the command for the same.

# mkdir  /userhome

Now follow the steps to mount the new LVs.

mount -t ext3 /dev/olinux008_d1/userhome /userhome

mount -t ext3 /dev/olinux008_d1/opt /opt

To make available these filesystem after reboot as well make the entry in fstab file for the same.

Hope you have everything with you. :)
It seems that LUNs are available in your box so Could you please show me the listing of /dev/mpath and /dev/disk/by-path.

# ls -lart /dev/mpath/

# ls -lart /dev/disk/by-path/

Show me output of fdisk -l.

# fdisk -l
/dev/mpath
ls
360060e8005bc2800xxxxxxxxxx12  360060e8005bc2800xxxxxxxxxxx12p1   <------what is these?

/dev/disk/by-path

*********
# cd /dev/disk/by-path
# ls
pci-0000:01:00.0-scsi-0:0:0:0
pci-0000:01:00.0-scsi-0:0:0:0-part1
pci-0000:01:00.0-scsi-0:0:0:0-part2
pci-0000:01:00.0-scsi-0:0:0:0-part3
pci-0000:01:00.0-scsi-0:0:0:0-part4
pci-0000:01:00.0-scsi-0:0:0:0-part5
pci-0000:01:00.0-scsi-0:0:0:0-part6
pci-0000:09:00.0-fc-0x50060e8005bc2825:0x0000000000000000
pci-0000:09:00.0-fc-0x50060e8005bc2825:0x0000000000000000-part1
pci-0000:0f:00.0-fc-0x50060e8005bc2835:0x0000000000000000
pci-0000:0f:00.0-fc-0x50060e8005bc2835:0x0000000000000000-part1

I really want to learn how to read this  and i have no idea what this information is

************
# ls -lart /dev/mpath/

ls -lart /dev/mpath/
total 0
lrwxrwxrwx  1 root root    7 Oct 18 20:36 360060e8005bc28000000bc2800002712p1 -> ../dm-1
lrwxrwxrwx  1 root root    7 Oct 18 20:36 360060e8005bc28000000bc2800002712 -> ../dm-0
drwxr-xr-x  2 root root   80 Oct 18 20:36 .
drwxr-xr-x 13 root root 3980 Mar 25 09:12 ..

ls -lart /dev/disk/by-path/
lrwxrwxrwx  1 root root    7 Oct 18 20:36 360060e8005bc28000000bc2800002712p1 -> ../dm-1
lrwxrwxrwx  1 root root    7 Oct 18 20:36 360060e8005bc28000000bc2800002712 -> ../dm-0
drwxr-xr-x  2 root root   80 Oct 18 20:36 .
drwxr-xr-x 13 root root 3980 Mar 25 09:12 ..


 fdisk -l

Disk /dev/sda: 146.6 GB, 146685296640 bytes
255 heads, 63 sectors/track, 17833 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26        9946    79690432+  82  Linux swap / Solaris
/dev/sda3            9947       12557    20972857+  83  Linux
/dev/sda4           12558       17833    42379470    5  Extended
/dev/sda5           12558       15168    20972826   83  Linux
/dev/sda6           15169       17833    21406581   83  Linux

Disk /dev/sdb: 107.3 GB, 107374510080 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       13054   104856223+  8e  Linux LVM

Disk /dev/sdc: 107.3 GB, 107374510080 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       13054   104856223+  8e  Linux LVM

Disk /dev/dm-0: 107.3 GB, 107374510080 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System
/dev/dm-0p1               1       13054   104856223+  8e  Linux LVM

Disk /dev/dm-1: 107.3 GB, 107372772864 bytes
255 heads, 63 sectors/track, 13053 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table



Anwar,
I really need to understand these command output. I appreciate if you explain as you did from start.

Much appreciated mate

Thanks
Javeed A
I need all the requested info from your new box where you want to create the same layout. It seems that you have given the info from old box.

Because date in listing shows that these were created on 7 Oct and If the LUNs are scanned in this month (today or yesterday) then it should show the month as March not the Oct.
dev/mpath
ls
360060e8005bc2800xxxxxxxxxx12  360060e8005bc2800xxxxxxxxxxx12p1   <------what is these?

This is the UUID of disk.
Yes these information is from old box..
I haven't contacted the storage team yet to provide me with  the lun for new box, as i didn't know the size of the luns and how the lun is configured in old box

from your response i have got an understanding  of how this lun is configured ,i can ask the storage team to provide me the lun that will be on monday.

I have few more question from the old box.

from fdisk output
sda  <------- This seems to be internal disk of 146.6 GB

sda1- /boot
sda2- <-----------------not sure what this is mounted to
sda3 - /var
sda4 -<----------------not sure what this is mounted to
sda5 -/tmp
sda6 -/
tmpfs -/dev/shm <--- no idea what this is

sdb     <---------------------------Need explanation what these and how they configured
sdb1  <-----------------------------Need explanation what these and how they configured

sdc    <------------------------------Need explanation what these and how they configured
sdc1  <------------------------------Need explanation what these and how they configured

/dev/dm-0 <--- 107.3GB----- Need explanation what these and what dm-o is configured
/dev/dm-1 <--- 107.3GB-----Need explanation what these and what dm-1 is configure

Thanks
Javeed A
I am going out for some work, I will get back to you after sometime. :)

BTW my name is UMESH PANWAR
Sorry about that .. i predicted upanwar as Utterpradesh answer LOL

thanks umesh..no worries its 9pm here i will in office till 11pm
No problem buddy.
Many people predict this. :)

Now I am back and will send you needed info very soon.
ASKER CERTIFIED SOLUTION
Avatar of upanwar
upanwar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will update on this shortly
good work