Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

12379

March 1st, 2012 23:00

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

1 Rookie

 • 

20.4K Posts

March 10th, 2012 16:00

madunix wrote:

So do you think I should do the resize2fs again?

you can try, create a snapshot or clone of the two LUNs so you can quickly recover in case something goes wrong.

1 Rookie

 • 

20.4K Posts

March 2nd, 2012 05:00

you are not using LVM ?

16 Posts

March 2nd, 2012 09:00

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

1 Rookie

 • 

20.4K Posts

March 2nd, 2012 21:00

1. Unmount the file system.

2. Type vgchange -an to make the volume group

unavailable.

where 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 to verify how many physical

extents are free.

6. Type vgchange -ay to make the volume group

available.

7. Type lvextend -l /dev/ / to

extend the logical volume.

where:

is the number of physical extents you want to add

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/ /

resize2fs -p /dev/ /

1 Rookie

 • 

20.4K Posts

March 2nd, 2012 21:00

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

16 Posts

March 3rd, 2012 05:00

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.

1 Rookie

 • 

20.4K Posts

March 3rd, 2012 06:00

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

16 Posts

March 3rd, 2012 06:00

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

1 Rookie

 • 

20.4K Posts

March 3rd, 2012 07:00

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.

16 Posts

March 3rd, 2012 10:00

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

16 Posts

March 8th, 2012 08:00

I have done the above commands (my options) I was able to increase the LUN, using the the following

1- #fdisk /dev/emcpowerb

n ( new partition )

p ( type primary )

1 ( first partition )

t ( select partition type )

8e ( lvm )

w (write)

2- #partprobe /dev/emcpowerb

3- #pvcreate /dev/emcpowerb1

4- #vgextend emc5_vg1 /dev/emcpowerb1

5- #lvextend -L +299G /dev/emc5_vg1/emc5_lv1

6- #resize2fs /dev/emc5_vg1/emc5_lv1

During the procedure of number 6, the system went in loop, i was able to login but anot able to get inside that directory the system was busy increasing the LUN afte a while of 15min, the file system  was increasing but to that point and stopped ... I did all the above online and without mounting the filesystem /opt/zimbra.

After the reboot, system came back online with the following size

[root@imail ~]# df -kh

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

                       51G   25G   24G  52% /

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

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

/dev/mapper/emc5_vg1-emc5_lv1

                      289G   40G  235G  15% /opt/zimbra

I was able to increase the /opt/zimbra from 50G  to 289G.

Do you think should I redo the command no. 6 to take all volume (i.e. 350G) online?

System is up and running without problem.


1 Rookie

 • 

20.4K Posts

March 8th, 2012 10:00

how big was the new LUN that you added ?  Did you do the alignment i mentioned earlier ( you can not change alignment after the fact) ?

16 Posts

March 8th, 2012 12:00

The old LUN   50G,  I added 300GB,  Total should be now 350

Aliggnment, how can I check this?

1 Rookie

 • 

20.4K Posts

March 8th, 2012 12:00

fdisk -lu /dev/emcpowerX

it should list 128 under Start, if you have it in the volume group already ..there is nothing you can do at this point.

1 Rookie

 • 

20.4K Posts

March 8th, 2012 13:00

i am not sure what happened to another 50G , it's not because of alignment. Can you post output from vgdisplay

No Events found!

Top