cancel
Showing results for 
Search instead for 
Did you mean: 

LVM for VDISK

 
SOLVED
Go to solution
Maaz
Valued Contributor

LVM for VDISK

Using HP EVA System Management Server, we can enlarge an already existing/presented Virtual Disk/SAN Disk.

Now should I need to use the LVM to manage the Storage/VDISKS ?

I mean should I create traditional partitions or should I use LVM(Logical Volumes) ?

I dont think that I need to use the LVM for the VDISK, because I can resize them(VDISK) on the fly(without repartitioning/formating) ?

am I right
10 REPLIES
Steven E. Protter
Exalted Contributor

Re: LVM for VDISK

Shalom,

Once presented to the system by the EVA, LVM is the best tool for managing disks the system sees.

I recommend you using LVM. It provides the most storage flexibility in these environments.

Resizing on the fly is possible using resize2fs on RHEL 5.x and ext2online for RHEL 4 and earlier releases.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Maaz
Valued Contributor

Re: LVM for VDISK

Hi SEP

>Once presented to the system by the EVA, LVM is the best tool for managing >disks the system sees.

How and why ? what benefits one can get by managing the VDISKs using LVM ?

>...It provides the most storage flexibility in these environments.
Please give examples
Ivan Ferreira
Honored Contributor
Solution

Re: LVM for VDISK

>>> Using HP EVA System Management Server, we can enlarge an already existing/presented Virtual Disk/SAN Disk.

Yes, but on systems with LVM this is not normally done. It's probably better to create a new vdisk and attach it to the existing volume group using vgextend.

If you extend the vdisk, you must "fdisk" again your partition, if you do it correctly, you won't lose any data. Then, you have to use the pvresize command.

>> Now should I need to use the LVM to manage the Storage/VDISKS ?

Probably yes.


>> Please give examples

Extend the volume group and logical volumes with vgextend/lvextend to multiple disks.

Create snapshots with lvcreate -s.

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Heironimus
Honored Contributor

Re: LVM for VDISK

If you resize a vdisk you present to a Linux server the next question you'll be posting is "how do I make my server see the new size". I think current Linux systems usually require a reboot to recognize a change in the size of a disk device. Tools that read directly from the disk will see the new geometry, but the kernel may not be able to see it.

Once you get the system to fully recognize the new size, you'll need to repartition. When I say "repartition" I actually mean "delete the partition with all your precious data on it and create a new one with the same starting cylinder". It's reasonably safe, but a little scary and there is some risk involved. Or you can create a new partition, but then you'll never be able to expand the existing partition.

Just use LVM. It will make life easier. There's a good reason that most major server platforms have some form of advanced disk management.
Court Campbell
Honored Contributor

Re: LVM for VDISK

LVM provides more flexibility. LVM allows you to grow volume groups dynamically, provides mirroring, raid, etc. Since you seem unfamiliar with lvm, I would start here:

http://www.redhat.com/magazine/009jul05/features/lvm2/
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Maaz
Valued Contributor

Re: LVM for VDISK

Nice help Every one. Its clear now, I'll always use LVM from now ;).

Ivan Ferreira wrote:
"If you extend the vdisk, you must "fdisk" again your partition, if you do it correctly, you won't lose any data".

Heironimus wrote:
"Once you get the system to fully recognize the new size, you'll need to repartition."

Sorry Ivan Ferreira and Heironimus, I dont agree on this point with both of you. what I experience is that after extending the vdisk, a reboot is required(to recognize the new/incremented size on OS/LINUX) and file system resize(resize_reiserfs or ext2online etc) utility is reqiured only, and I think that there is NO "fdisk" and/or "repartition" required.

Heironimus wrote:
"I think current Linux systems usually require a reboot to recognize a change in the size of a disk device."

Great, I am convinced, because if I use LVM, and if I need more space, I will create a new vdisk and add that vdisk/lun to volume group, and then increment the size of the logical volume(and nothing requires reboot). Nice point.

Thanks once again
Regards
Maaz
Maaz
Valued Contributor

Re: LVM for VDISK

Ivan Ferreira wrote"
"Yes, but on systems with LVM this is not normally done. It's probably better to create a new vdisk and attach it to the existing volume group using vgextend."

Millions of Thanks for sharing this tip(way of work). Nice and excellent information. ;).
Heironimus
Honored Contributor

Re: LVM for VDISK

You don't have to (actually you absolutely must not) repartition if you use the whole-disk device for your data and don't put a partition table on it at all. It's really not a recommended practice, but it should work fine.

By the way, somewhere I have an old HP whitepaper on expanding storage on the SmartArray controller in a Proliant. Windows can recognize an expanded disk without a reboot, but they still recommended using dynamic disk (the Windows equivalent of LVM) and adding the space as a new LUN instead of growing the existing LUN. Just another point in favor of LVM and similar tools....
Court Campbell
Honored Contributor

Re: LVM for VDISK

Maaz,

I can't say that I agree with you on the need to reboot after resizing a vdisk. You should only need to rescan the device. Ex.

echo 1 > /sys/bus/scsi/drivers/sd/3\:0\:0\:1/rescan
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Maaz
Valued Contributor

Re: LVM for VDISK

Thanks Heironimus for the feedbacks/reply.
and Court Campbell, thanks for sharing Linux-way of recognizing(refreshing/rescanning) a LUN.

if PSP is installed on Linux, then there is a utility/command "hp_rescan -a" that rescan all new or existing LUNS, and I found that the increment in size is never reported by hp_rescan to the LINUX(SUSE), unless I reboot.
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1221767

I cant confirm that
echo 1 > /sys/bus/scsi/drivers/sd/3\:0\:0\:1/rescan
can do without reboot, but as soon as I got the the chance I'll post my comments(and assign points ;) ).

Regards
Maaz