Adding Extra Disks

Go to solution
Michael Smith_12
Occasional Contributor

Adding Extra Disks

Dear All,

I am playing around with an old UNIX workstation running HPUX v 10. I am only just starting to learn HPUX so please bear with me.

I have started by installing the OS onto one disk. I have since added two more 2Gb drives and I can see them in the disk mangement (SAM)

/dev/dsk/c0t4d0 (Disk 1 with O/S)
/dev/dsk/c0t5d0 (Disk 2)
/dev/dsk/c0t6d0 (Disk 3)

I am wondering if I can increase some of the logical volumes on Disk 1 by using the space on Disk 2 and 3.

Can this be achieved? If so, how do I go about it?

Any advise would be appreciated.

Thanking you in advance

Sunil Sharma_1
Honored Contributor

Re: Adding Extra Disks


Yes you can increase some volumes using new disks but not all.
You can not increase /stand swap and / volumes other you can invrease.

steps are follows. boot workstation in single user mode.

#pvcreate /dev/dsk/c0t5d0
#pvcreate /dev/dsk/c0t6d0
#vgextend /dev/vg00 /dev/dsk/c0t5d0 /dev/dsk/c0t6d0
Now suppose you want to increase size of lvol4 (generally /home) to 2 GB
#lvextend -L 2048 /dev/vg00/lvol4
#extendfs /dev/vg00/rlvol4

Hope this will help

*** Dream as if you'll live forever. Live as if you'll die today ***
Michael Tully
Honored Contributor

Re: Adding Extra Disks

You can use SAM to do this as well.

WIthout me going through a great spiel on how it's done, have a look at this document:

and have a look at chapter 6
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor

Re: Adding Extra Disks

Hi Mike,

Using command line is preferred but you can also use SAM. SInce there is nothing to be written about how to use SAM (as it is self-explanatory), I will give you command line syntax.

1. Ensure that the disks are not already part of a VG

strings /etc/lvmtab |grep c0t5d0

Make sure nothing returns

2. Create PV on the disk

pvcreate /dev/rdsk/c0t5d0

If the previous PV structures were not deleted on it, you will get a message (this is already part of a VG or something). Then use -f option. BUt make sure step 1 before doing so.

pvcreate -f /dev/rdsk/c0t5d0

3. Expand the current VG.

vgextend vg0x /dev/dsk/c0t5d0

Now the space of c0t5d0 is available to vg0x. You can extend any of the logical volumes in vg0x upto the free size available in vg0x.

To find out the free space in vg0x. Do

vgdisplay vg0x |grep -i "free pe"
vgdisplay vg0x |grep -i "extent size"

Multiply the above to get the size in MB.

4. Choose a logical volume say /dev/vg0x/lvol1. You will need to unmount it if it is not mounted. If it is used by an application, then you will need to bring down the application.

fuser -cu /dev/vg0x/lvol1

will display all the processes that are accessing this filesystem. Stop them and unmount the logical volume

umount /dev/vg0x/lvol1

5. Extend the logical volume and the filesystem on it.

lvextend -L /dev/vg0x/lvol1
extendfs -F vxfs /dev/vg0x/rlvol1 (if it is a hfs filesystem do -F hfs)

new_size_in_mb is the total new size not the incremental.

6. Mount the filesystem back.

mount /dev/vg0x/lvol1

7. Check the space

bdf /dev/vg0x/lvol1

If you have OnlineJFS (swlist -l product |grep -i onlinejfs) installed, you can skip steps 4,5 and 6 with the folowing step.

4b. Find the mount point

bdf /dev/vg0x/lvol1

lvextend -L /dev/vg0x/lvol1
fsadm -b m /mount_point

(ex., fsadm -b 2048m /apps1)

Look at the following document on concepts of LVM.


You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: Adding Extra Disks

Hi Mike,

IF this VG is root VG (vg00), then you may not be able to increase most of the logical volumes online without OnlineJFS. Some of them (/usr,/var,/tmp/,/opt) are to be done in single user mode using /sbin commands. Some of them (/stand, primary swap and root) can never (well, there are few ways but I don't suggest) be done without re-installing it with make_tape_recovery tape.

You may be disappointed if you fail, but you are doomed if you don't try
Michael Smith_12
Occasional Contributor

Re: Adding Extra Disks

Thanks for all the quick responses.

I've Sunil's and it did what I wanted. I'll have a look at the other responses soon when I play around with the 3rd HDD.

Again thanks for the help