1753518 Members
5202 Online
108795 Solutions
New Discussion юеВ

Re: lvextend syntax

 
Dead UserID_12
New Member

lvextend syntax

Hello,
I need to increase the space available to a file system, my /opt filesystem, and have a question about the lvextend systax.

I think I need to give lv the path to the physical volume because I need to be sure that lv does not use certain disks that contain raw data. My assumption is that lv will use the first available disk space it finds where it finds no file system or volume group and if it does that it would destroy all of the data on those raw disks used by a database application.

So, please take a look at what I believe is the correct syntax:

# lvextend -L 1000 /dev/vg00/lvol5 /dev/dsk/c7t12d0

Thanks in advance.
4 REPLIES 4
Sanjay_6
Honored Contributor

Re: lvextend syntax

Hi,

If the space on the disk is being used by another lv, it won't be destroyed.

However the command syntax that you have mentioned would extend the lv /dev/vg00/lvol5 on the disk /dev/dsk/c7t12d0.

If the disk /dev/dsk/c7t12d0 doesn't have free space for this filesystem to get extended, it will error out.

say the current size of /dev/vg00/lvol5 is 512MB and you want to increase it to 1000MB. the disk /dev/dsk/c7t12d0 must have 476MB free, else the command would error out. If there is that much space on the disk, the filesystem will get extended on that disk.

Hope this helps.

Regds
A. Clay Stephenson
Acclaimed Contributor

Re: lvextend syntax

You don't have to worry about lvextend clobbering disks. A disk can only be used for LVOL PE's iff (if and only if) it has first been added to a volume group via vgcreate or vgextend and these commands must have been preceded by pvcreate. LVM knows nothing about filesystems so the presence of a filesystem is no protection. If an LVOL is used as a raw device, it too is "safe" from incursion by other LVM commands. You really only have to be careful when running the pvcreate command that you don't clobber raw disks or disks used for swap.

If it ain't broke, I can fix that.
Dead UserID_12
New Member

Re: lvextend syntax

Great, that's what I thought.

Thanks much!
Gordon Bonnar
New Member

Re: lvextend syntax

That syntax is correct to extend lvol5 onto /dev/dsk/c7t12d0. The disk needs enough room for the extended volume if not you will receive an error.

You can list multiple PVs as destinations for an lvextend by listing the drives. This would help if your volume needs to be larger than anyone drive.