- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script to discover unused disks?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-12-2009 06:51 AM
тАО03-12-2009 06:51 AM
I need a script which will correlate disks to VGs and also list unused disks.
I know I can do some commands like ls /dev/dsk/* but I need a script which will understand alternate links.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-12-2009 06:57 AM
тАО03-12-2009 06:57 AM
SolutionFirst, define "unused". If we are talking about LVM disks, then if you do a 'vgexport' the LVM headers are still on the physical disk and can be read, but that doesn't define "unused".
If you have any raw disk devices then the only sure way to identify them is to _document_ the devices somewhere.
As for alternate links, these are only paths that lead to the _same_ physical volume. Hence interrogating the LVM PVID and/or LVM VGID in the case of LVM disks, yields the same ID.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-12-2009 07:03 AM
тАО03-12-2009 07:03 AM
Re: Script to discover unused disks?
If you have Base VxVM installed on your machine, You can also use the following command:
# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c3t3d0 auto:cdsdisk - - online <-- Initialized by VXVM but unused
c3t8d0 auto:LVM - - LVM <----- Initialized and in use by LVM
c5t0d0 auto:none - - online invalid <--- Free disk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2009 12:08 AM
тАО03-13-2009 12:08 AM
Re: Script to discover unused disks?
maybe you find this one useful.
Regards,
Bernhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2009 03:33 AM
тАО03-13-2009 03:33 AM
Re: Script to discover unused disks?
Please assign some points who give there valuable time for your problem.
http://forums13.itrc.hp.com/service/forums/helptips.do?#33
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2009 03:43 AM
тАО03-13-2009 03:43 AM
Re: Script to discover unused disks?
What you can see from a server perspective may very likely not tell you about unused disk if you have SAN attached storage. There could be disk on your array that has not been mapped and/or masked. So sitting at the command line running a script that is geared to LVM or VxVM commands will only reflect the disk that the server has masked.
You may need to check both views. What the server(s) can see using LVM/VxVM scripts - and - if there is any disk available on an array.
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2009 06:21 AM
тАО03-13-2009 06:21 AM
Re: Script to discover unused disks?
in /tmp you will see a
and
the only thing you have to watch out for is the command devices. Though they show in the unused file, they XP uses them.
Hope this helps!
Darren
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2009 11:31 AM
тАО04-13-2009 11:31 AM
Re: Script to discover unused disks?
If you have a HA Tools instaled in your serveur,
You can use this:
for i in `ioscan -kfnCdisk|grep dev|awk '{print $2}'`
do
Jrdvgid $i
done
If the disk is not used you have this message in the output
/dev/rdsk/c15t0d0 VGID= No LVM information
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 04:31 AM
тАО04-16-2009 04:31 AM
Re: Script to discover unused disks?
If you want I can attach two little scripts for this task.
The first one is my stake at what you needed, but I never got around to make it work flawless, it actually has little bugs :(
- It understands about alternate paths for disks that are used in a VG, but wont figure out alternates for unused disks.
For me it doesnt matter too much.
- to deal with exported VG's it also scans over /etc/lvmconf/ backup files, but this will override previously detected active VG membership. With a level head you'll probably fix that in seconds. :)
The second one is able to scan VGID and PVID of a disk, I at times use it to make 100% sure a given disk is not in use by any system in our landscape.
If someone feels like it I'd happily discuss rewriting parts of these scripts, by myself I just never got it right :)
Of course, these come without any promises, merely something for you to start from.
#1 http://rabf.net/p/vgsl9b76.html
#2 http://rafb.net/p/9ZBCwI59.html
Best wishes,
Florian