HPE EVA Storage

How to extend a SAN Vdisk presented to a Red Hat 5 server?

 
SOLVED
Go to solution
Neil W. Garside
Occasional Contributor

How to extend a SAN Vdisk presented to a Red Hat 5 server?

Hi,

I have a 5GB SAN Vdisk presented to a Red Hat (RHEL 5.4) server with an Emulex HBA. The Vdisk appears as device /dev/sda on the server. I've created a partition /dev/sda1 and mounted this to mountpoint /u02. For various reason I am *not* using LVM.

I now need to increase the size of the Vdisk to 8GB. In Command View EVA I've increased the disk's size from 5 to 8GB. How do I get the server to recognise the additional space?

I've tried rebooting the server but the size remains at 5GB. "fdisk -l /dev/sda" reports the device as 8GB but the partition remains as 5GB:

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
[root@ikuklodb1 ~]# fdisk -l /dev/sda

Disk /dev/sda: 8589 MB, 8589934592 bytes
166 heads, 62 sectors/track, 1630 cylinders
Units = cylinders of 10292 * 512 = 5269504 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 1018 5238597 83 Linux
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

...and "df" still reports the disk as only 5GB:

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Filesystem Size Used Avail Use% Mounted on
<..snip..>
/dev/sda1 5.0G 2.6G 2.2G 54% /u02
<..snip..>
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

How do I get the server to recognise the additional space?

The SAN is an hp EVA-8100 and the server is an hp DL580 G5.

Many thanks,

/Neil

6 REPLIES 6
BrianDoyle
Trusted Contributor

Re: How to extend a SAN Vdisk presented to a Red Hat 5 server?

Hi Neil,

Firstly you probably need to post this in the Linux section instead of Storage.
But know that changing the Vdisk size in CommandView EVA doesn't change what the OS sees in terms of disk size.

Redhat isnt my flavour so i'm not aware of other options (other than LVM which you've ruled out).
Uwe Zessin
Honored Contributor
Solution

Re: How to extend a SAN Vdisk presented to a Red Hat 5 server?

I can't test it right now, but I think the steps are:

Start by unmounting the file system.
# umount /u02

Now, you need to expand the partition to make room for the file system. That could be done with "fdisk" - delete the old partition and create a larger one. This will not affect the file system, but it is a good idea to run a full backup anyway and/or take a vdisk snapshot if the EVA has a BC license.

Next, run a file system check:
# e2fsck -f /dev/sda1

Now you can grow the file system:
# resize2fs /dev/sda1

Mount the filesystem again and check the free space:
# mount /dev/sda1 /u02
.
Neil W. Garside
Occasional Contributor

Re: How to extend a SAN Vdisk presented to a Red Hat 5 server?

Thanks Uwe...it was the removing of the existing partition and recreating a larger one that was puzzling me...I thought I would lose the file system's data, but I worked through your suggested commands on a test device and it worked just fine. Thanks! I've awarded full points.

Do you (or anyone reading) know if it's possible to get the server/OS to recognise the new additional space *without* rebooting the server?

Kind regards,

/Neil


Uwe Zessin
Honored Contributor

Re: How to extend a SAN Vdisk presented to a Red Hat 5 server?

Ah, Linux has not been very good in this area. Maybe the following link helps a bit, but it sounds like one might better keep rebooting the system:
https://bugzilla.redhat.com/show_bug.cgi?id=467201
.
Jan Soska
Honored Contributor

Re: How to extend a SAN Vdisk presented to a Red Hat 5 server?

Hello Neil,
here is our way to online resizing linux filesystems...
(working with EVA's, generaly with everything, LVM is welcomed)

1. add space on storage (in EVA - CommandView, local - HP ACU)

2. rescan partitions (need kernel 2.6+)
echo 1 > /sys/bus/scsi/devices/0\:0\:0\:0/rescan
(more on Linux Journal : http://www.linuxjournal.com/article/7321 )

3. create new partition with fdisk
Fdisk /dev/sda (n,t,w)

4. tell kernel to recognize new partition !!:
partprobe

5. Create volume:
pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created

6. Extend group:
vgextend VolGroup00 /dev/sda3
Volume group "VolGroup00" successfully extended

7. check if done ok:
pvscan

8. extend LVM partition (here +30GB)
lvextend -L +30G /dev/VolGroup00/LogVol00

9. resize filesystem: resize2fs /dev/mapper/VolGroup00-LogVol00

10. done - online resize of filesystem.

I hope this HELPS

JAN
Neil W. Garside
Occasional Contributor

Re: How to extend a SAN Vdisk presented to a Red Hat 5 server?

Hi Jan,

Thanks for replying with those steps. I did mention that I'm not using LVM, so the pv*, vg* and lv* commands you mention are unfortunately not available to me in this instance. But thanks for replying.

Kind regards,

/Neil