System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to view the expanded LUN on Suse OS on VM

SOLVED
Go to solution
Venkatesan_5
Frequent Advisor

How to view the expanded LUN on Suse OS on VM

Hi,

Stroage team has expanded a EVA LUN from 3GB to 4GB size.

VMware team has rescanned the HBA's on all ESX hosts.

On VMguest we have Suse 10.2 loaded and I am sure If I reboot the server the newly expanded size would be visible in fdisk.

I am trying to avoid the reboot. Is there any way?

I have tried the following:

echo "- - -" >/sys/class/scsi_host/host0/scan
echo "- - -" >/sys/class/scsi_host/host1/scan

#!/bin/bash
for HOST in `ls /sys/class/scsi_host`; do echo '- - -' > /sys/class/scsi_host/$HOST/scan; done
CPATH=`pwd`
cd /dev
for DEVICE in `ls sd[a-z]`; do echo '1' > /sys/block/$DEVICE/device/rescan; done
cd $CPATH


Please help me !!.

Thanks in Advance.
Venkat.
4 REPLIES
Gerardo Arceri
Trusted Contributor
Solution

Re: How to view the expanded LUN on Suse OS on VM

This should work:

Check current size by:
Linux: ~# blockdev --getsz /dev/sdX
Will display 3GB
Recognize new size of each path (sd device) by:
Linux: ~# blockdev --rereadpt /dev/sdX
And check whether new size is got
Linux: ~# blockdev --getsz /dev/sdX
Will display 4GB

Let me know if it works, and don't forget to assign points.!
Jan Soska
Honored Contributor

Re: How to view the expanded LUN on Suse OS on VM

Hello,
here is our step-by-step howto (working with EVA's, generaly with everything)

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
Venkatesan_5
Frequent Advisor

Re: How to view the expanded LUN on Suse OS on VM

Fantastic,

Thanks for the information Gerardo. I tested and it worked fine as expected.

I have assigned the points as well.
Venkatesan_5
Frequent Advisor

Re: How to view the expanded LUN on Suse OS on VM

Here is what I have performed.

1. Storage team expands the LUN
2. Did evainfo -a to verify the expanded size
3. blockdev --getsz /dev/sdc
4. blockdev --rereadpt /dev/sdc
5. blockdev --getsz /dev/sdc
6. fdisk -l shows up newly expanded size

Thanks and regards,
Venkatesan.