Operating System - HP-UX
1830636 Members
2665 Online
110015 Solutions
New Discussion

Re: format a new harddisk and expand a existend lvol on this hd

 
Erich_1
Advisor

format a new harddisk and expand a existend lvol on this hd

hi masters,

how are the commandos (syntax) to format a new HD (73 GB) and expand an existend lvol on this new Harddisk. My existend lvol is on vg00 - must the new HD be in vg01 ?
6 REPLIES 6
Marco Santerre
Honored Contributor

Re: format a new harddisk and expand a existend lvol on this hd

Well I will assume that you are using LVM on your box.

Therefore, all you'll need to do is :

pvcreate /dev/rdsk/newdisk
vgextend vg00 /dev/dsk/newdisk
lvextend -L newsize /dev/vg00/lvol# /dev/dsk/newdisk
fsadm -F vxfs -b newsize /mountpoint {if you have Online JFS}

Cooperation is doing with a smile what you have to do anyhow.
Mark Grant
Honored Contributor

Re: format a new harddisk and expand a existend lvol on this hd

You probably don't need to format it but if you did, you'd use "mediainit"

If your logical volume is in vg00, the new disk must also be in vg00. So first use "pvcreate /dev/rdsk/" Then "vgextend vg00 /dev/dsk/". You can then do "lvextend -L XXX /dev/vg00/lvol" where XXX is the size in megabytes.

Two things to bear in mind. One is the mirroring aspect of things, if you are extending a lgocial volume, presumably you want this mirrored and if you don't already have the space on another disk in the volume group, you are not going to be able to mirror it anywhere except on teh same disk (which is a bit pointless).

Secondly, if the volume group was no created with the correct combination of PE size and/or maximum number of PE's on a disk, you are going to waste a lot of disk space as the system will not be able to use all the space on the disk. The solution to this problem, in vg00, is, a re-install of the OS via Ignite.
Never preceed any demonstration with anything more predictive than "watch this"
Erich_1
Advisor

Re: format a new harddisk and expand a existend lvol on this hd

What name ist meaning with newdisk
pvcreate /dev/rdsk/"newdisk"

is this the name who is display with:
vgdisplay -v -> /dev/dsk/xxxxxx
SS_6
Valued Contributor

Re: format a new harddisk and expand a existend lvol on this hd

You need not to format the disk. Do the following.
#pvcreate /dev/rdsk/cxtxdx (or use pvcreate -f)
To add disk in volume group.
#vgextend /dev/vgxx /dev/dsk/cxtxdx /dev/dsk/cxtxdx (second device is alternate link, if you have)
#vgdisplay -v vgxx (Check for new disk addition)
For example you want to extend file system to new size of 3GB and you have online JFS.
#lvextend -L 3000 /dev/dsk/lvolxxx
#fsadm -b 3000M /mountpoint
To check
#bdf /mountpoint
By providing solutions I am helping myself
Mark Grant
Honored Contributor

Re: format a new harddisk and expand a existend lvol on this hd

No,

When you add the disk, you should be able to see the new disk with "ioscan -fnC disk" and it will have a device name /dev/dsk/xxxxxx. This is the name you use to refer to that disk in all the other commands.
Never preceed any demonstration with anything more predictive than "watch this"
Ron Thompson
Advisor

Re: format a new harddisk and expand a existend lvol on this hd

As others have replied, you do not have to format with HP/UX. You can do something similar though if you wish. Use the HP/UX commands others have given you, but before you do the "pvcreate", issue the command:

mediainit -v /dev/rdsk/c#t#d#

Then issue the other HP/UX commands as others have stated. This does a function similar to a DOS format.