Operating System - HP-UX
1835224 Members
2745 Online
110078 Solutions
New Discussion

Re: How to determine what disks are not assigned to any volume group

 
SOLVED
Go to solution
Becke
Super Advisor

How to determine what disks are not assigned to any volume group

Hi Guys,

would anyone be able to tell me what is the command to find out what disks are not assigned to any of the volume groups in the system and are available.

And what is the command to add a disk and extend the root volume group. I'm learning hp at the moment and my expertise is in AIX.

Please advise,

Cheers,
Raf
10 REPLIES 10
Steven E. Protter
Exalted Contributor
Solution

Re: How to determine what disks are not assigned to any volume group

Part 1.

Two commands and eyballs.

strings /etc/lvmtab

# lists the contents of a volume group.

ioscan -fnC disk

Any disk listed on the ioscan and not the strins command is not assigned.

There are other ways of figuring it out as well. sam can be helpful.

Lts say we identified a disk /dev/dsk/c2t2d0 that is not in a volume group and you want to extend vg02 ti include it.

vgextend /dev/vg02 /dev/dsk/c2t2d0

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
Sudeesh
Respected Contributor

Re: How to determine what disks are not assigned to any volume group

Hello,

ioscan -fnC disk -> will give you all the disks configured in the system.

strings /etc/lvmtab -> will give all the disks added to vg.

Match these out puts and you can identify the disks that are not configured into any of the vg.

You can add a disk to root vg (vg00) with the normal vgextend command.

vgextend /dev/vg00 /dev/dsk/cxtydz

But if you are planning to extend /,swap or /stand logical volumes inside root vg... it is not possible even with Online JFS because these lvols have contigious allocation policy.

Hope this helps

Sudeesh
The most predictable thing in life is its unpredictability
Naveej.K.A
Honored Contributor

Re: How to determine what disks are not assigned to any volume group

Hi,

Before adding any disk to a volume group, you have to make the disk usable by LVM.

pvcreate -f /dev/rdsk/c2t2d0 # -f for forceful creation and don't forget to use the raw device file to initialize the disk for LVM

Regards,
--Naveej
practice makes a man perfect!!!
Bharat Katkar
Honored Contributor

Re: How to determine what disks are not assigned to any volume group

Hi Raf,
Just to summarize the steps...

1. # strings /etc/lvmtab
Note the Output
2. # ioscan -fnC disk
Note the Output and select all those disks which were not in the output of #1
3. # pvcreate -f
This will create a PV
4. # vgextend vg00

Thereafter you can use lvcreate or lvextend to create new LV's or extend existing LV.
If you are creating new LV then use:
# newfs -F vxfs
and if you have extended LV and want to increase filesystem size then:
# extendfs -F vxfs
That's all.
Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Bill Hassell
Honored Contributor

Re: How to determine what disks are not assigned to any volume group

The very easiest way is to ask SAM. Run sam and select Disks and File Systems, then select Volume Groups. Now select Actions -> Create, then choose a dummy name for a new volume group and then Select Disk. SAM will find all disks that do not belong to volume groups defined on this system. You can then cancel out if you wish.


Bill Hassell, sysadmin
Stuart Abramson
Trusted Contributor

Re: How to determine what disks are not assigned to any volume group

All these answers are right. I don't use SAM because on a system with a lot of disks SAM can take forever to respond (it just seems like forever compared to using commands). I wrote a script to do this for me, which I would attach but I don't have it handy. It uses "inq" which is an EMC command.
Saravanan_15
Advisor

Re: How to determine what disks are not assigned to any volume group

Dear Farhan,
You can use the following simple script to find out which are disks not assigned to any VG,

#ioscan -kfnC disk|grep dsk|awk '{print $1}' > /tmp/dsk1
#strings /etc/lvmtab|grep dsk > /tmp/dsk2
#diff /tmp/dsk1 /tmp/dsk2|grep dsk|awk '{print $2}'

good luck...

Regards,
Saravanan M
Stephen Keane
Honored Contributor

Re: How to determine what disks are not assigned to any volume group

Slight caveat, iocsan -Cdisk etc will also list CD-ROM/CD re-writer devices.
Becke
Super Advisor

Re: How to determine what disks are not assigned to any volume group


Thanks for everyone's response and help, i was away off sick and will try soon, this info would be enough to find out the disks.

Cheers,
Raf
Geoff Wild
Honored Contributor

Re: How to determine what disks are not assigned to any volume group

Also - look at the pvdisplay command....

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.