madunix1
1 Nickel

Increase size of LUN

SAN: Calriion CX3-10C

How can I increase size of LUN (50GB) attached to Linux Red Hat host (RHEL 5.2) 64bit by adding new created LUN (200GB)?

What steps do we need to take to get the Linux host to see the new space? I am going to present a new LUN from EMC array to the Linux system.

The existing system partion it looks:

# fdisk -l


Disk /dev/sda: 72.7 GB, 72746008576 bytes

255 heads, 63 sectors/track, 8844 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


  Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14        8844    70935007+  8e  Linux LVM


Disk /dev/sdb: 53.6 GB, 53687091200 bytes

64 heads, 32 sectors/track, 51200 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes


  Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       51200    52428784   8e  Linux LVM


Disk /dev/sdc: 53.6 GB, 53687091200 bytes

64 heads, 32 sectors/track, 51200 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes


  Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1       51200    52428784   8e  Linux LVM


Disk /dev/sdd: 53.6 GB, 53687091200 bytes

64 heads, 32 sectors/track, 51200 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes


  Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1       51200    52428784   8e  Linux LVM


Disk /dev/sde: 53.6 GB, 53687091200 bytes

64 heads, 32 sectors/track, 51200 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes


  Device Boot      Start         End      Blocks   Id  System

/dev/sde1               1       51200    52428784   8e  Linux LVM


Disk /dev/emcpowera: 53.6 GB, 53687091200 bytes

64 heads, 32 sectors/track, 51200 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes


        Device Boot      Start         End      Blocks   Id  System

/dev/emcpowera1               1       51200    52428784   8e  Linux LVM

Labels (1)
Tags (2)
0 Kudos
dynamox
6 Gallium

Re: Increase size of LUN

you are not using LVM ?

0 Kudos
madunix1
1 Nickel

Re: Increase size of LUN

imail ~]$ df -kh

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

                       51G   24G   24G  50% /

/dev/sda1              99M   55M   40M  59% /boot

tmpfs                 7.9G     0  7.9G   0% /dev/shm

/dev/mapper/emc5_vg1-emc5_lv1

                       50G   41G  6.7G  86% /opt/zimbra

mail ~]$

I am looking to increase /dev/mapper/emc5_vg1-emc5_lv1

0 Kudos
dynamox
6 Gallium

Re: Increase size of LUN

1. Unmount the file system.

2. Type vgchange -an <volume_group> to make the volume group

unavailable.

where <volume_group> is the volume group name.

3. Type pvresize /dev/emcpowerx to resize the physical volumes.

where x is the name of the target logical unit after the migration.

4. Type vgchange --resizeable y to make the volume group

resizeable if it is not already.

5. Type vgdisplay <volume_group> to verify how many physical

extents are free.

6. Type vgchange -ay <volume_group> to make the volume group

available.

7. Type lvextend -l <phys_ext> /dev/<volume_group>/<log_vol#> to

extend the logical volume.

where:

<phys_ext> is the number of physical extents you want to add

<log_vol#> is the logical volume number

For example, lvextend -l +6343 /dev/vg01/lv01

8. Resize the file system. For example, for ext3 file systems, type:

e2fsck -f /dev/<volume_group>/<log_vol#>

resize2fs -p /dev/<volume_group>/<log_vol#>

dynamox
6 Gallium

Re: Increase size of LUN

those procedures if you extended an existing volume, you just want to add a new LUN to the volume group ?

0 Kudos
madunix1
1 Nickel

Re: Increase size of LUN

Dear,

I was thinking to follow the following procedure:

First creates a new partition using the entire un-partitioned disk space on the unused hard drive on a single partition LUN (/dev/sdc1) and initializes it as a physical volume.
NOTE: Physical volumes can also be created directly on a disk device, such as /dev/sdc, without first creating a partition.

1. Create a new partition, because you want it to occupy the entire disk, you can accept the default start and end cylinders by pressing Enter. Create a lvm partition with fdisk
#fdisk /dev/sdc
n ( new partition )
p ( type primary )
1 ( first partition )
t ( select partition type )
8e ( lvm )
w (write)


Print to make sure the changes are correct
Command (m for help): p
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x58bbc73f
   Device Boot     Start   End      Blocks     Id  System
   /dev/sdc1       1       10240    10485744   83  Linux




To tell the kernel to re-read the partition table, either reboot the system or use the partprobe command:
# partprobe /dev/sdc
If successful, this command will not display any output


2. Initialize the New Device as an LVM Physical Volum, create physical volume from new device
#pvcreate /dev/sdc1

3.Extend the Volume Group Onto the New Physical Volume
#vgextend name_vg /dev/sdc1


4. It is possible to specify a size in K, M, G, or other
units using the -L option. However, in some cases,
rounding might cause this to fail:
Extend the LV (logical volume) to the desired size:
#lvextend -L +2G /dev/name_vg/name_lv

5. After extending the volume group and the logical volume, you can now increase the size of the file system.
In Red Hat Enterprise Linux 5 and later and Red Hat Enterprise 6 and later, this is done for ext3 file systems
using the resize2fs command. This procedure can be performed while the file system is live and
mounted. Resize the filesystem to cover the newly extended LV:
#resize2fs /dev/name_vg/name_lv
newly resized filesystem should now be available.

6.I recommend this step, so check File-System Integrity after the Resize Procedure While not absolutely necessary, it is useful to run a file-system check after resizing. NOTE: This must be done while the file system is unmounted, so downtime might be required to stop any applications from using it.
Once the file system is unmounted, you can check it using e2fsck (-f forces the check):
# e2fsck -f /dev/name_vg/name_lv
e2fsck 1.41.12 (dd-mm-yyyy)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/name_vg/name_lv: xx/xxxxxx files (0.0% non-contiguous),
xxxxxx/xxxxxx blocks


Note: I recommend that all critical data be backed up and verified before making any changes to the underlying storage as an unforeseen problem might occur.

0 Kudos
dynamox
6 Gallium

Re: Increase size of LUN

two things:

1) you are using PowerPath, make sure to use emcpowerX device when you fdisk and when you do vgextend

2) in step 1 you want to create a partition that is aligned, see this document ..page 49.

EMC Host Connectivity Guide for Linux  -- A28

0 Kudos
madunix1
1 Nickel

Re: Increase size of LUN

Ok I will take care of it, but do you agree with the above ... or should I use use your method of increasing.

0 Kudos
dynamox
6 Gallium

Re: Increase size of LUN

if you are presenting a brand new LUN then your steps are correct (plus the two things i mentioned above). If you are creating a metaLUN by combining two LUNs in Navisphere, then you would use the steps i provided in earlier in the thread.  You are using LVM so i think it's a good idea to create a brand new LUN instead of extending an existing one.

0 Kudos
madunix1
1 Nickel

Re: Increase size of LUN

in the next few days I will gonna implement my option and update you.

0 Kudos