Operating System - HP-UX
1753511 Members
5243 Online
108795 Solutions
New Discussion юеВ

Adding a disk to a volume group

 
SOLVED
Go to solution
David Owens_1
Advisor

Adding a disk to a volume group

I am adding a disk to a volume group and would like to make sure I am doing it correctly. If anyone has any additional sugeestions I would appreciate it.

I have a volume group called vg02. When running a "strings" command for the /etc/lvmtab file I get the folloing output for the vg02 volume group.

/dev/vg02
/dev/dsk/c2t0d0
/dev/dsk/c2t1d0

I have added the new disk to the system and the device file name is /dev/rdsk/c2t2d0. I intend to run the following.

# pvcreate -f /dev/rdsk/c2t2d0
# vgextend /dev/vg02 /dev/dsk/c2t2d0

Do I need to unmount the logical volumes for this VG before proceeding?

I am also assuming that after exting the volume group I can extend to logical volumes in this group.


Thanks in advance,
David Owens
Ingersoll-Rand
4 REPLIES 4
melvyn burnard
Honored Contributor
Solution

Re: Adding a disk to a volume group

you have the steps correct, should be no problem extending hte lvols
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Sridhar Bhaskarla
Honored Contributor

Re: Adding a disk to a volume group

Hi,

Only one caveat is that c2t2d0 should not be of bigger size than the other two disks unless you created the volume group initially with a non-default max physical extents attribute. Your vgextend will give you an error anyway if that is the case.

Just to be on safer side to make sure this disk is already not used, do

strings /etc/lvmtab |grep c2t2d0

Your process is precisely correct along with your assumption unless you created striped volumes on two disks which I think is a rare possibility.

You do not need to unmount logical volumes.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Helen French
Honored Contributor

Re: Adding a disk to a volume group

The steps you have is correct. Once you extended the VG, you can find out the free space on VG with vgdisplay -v and then extend the LVs as you need.

If you are adding a large capacity of disk and if the VG was created without considering future updates (options of vgcreate), then you will get only the same amount of disk space as of the others.
Life is a promise, fulfill it!
Sergejs Svitnevs
Honored Contributor

Re: Adding a disk to a volume group

After extending a volume group to include the drive, you can make "lvcreate" or "lvextend" to build filesystems.

lvextend(1M)

Increase the size of a file system existing on a logical volume.

First, increase the size of the logical volume.
lvextend -L YYY /dev/vg02/lvolX

Unmount the file system.
umount /dev/vg02/lvolX

Extend the file system to occupy the entire (larger) logical volume.

extendfs /dev/vg02/rlvolX
Remount the file system.

mount /dev/vg02/lvolX /mnt

Only in order to remove a volume group, the file systems must be unmounted.

Regards,
Sergejs