- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need help getting PV ID on files in /dev/rdsk/
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
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
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
07-17-2014 12:28 AM
07-17-2014 12:28 AM
Need Help on sed
Hi Experts
Thanks in Advance.
The below command Prints as below
# ll /dev/rdsk | awk '{print $10}' | sed s/dsk/rdsk/g
c0t0d0
c2t0d0
c2t1d0
c7t0d1
c7t0d2
c7t0d3
c7t0d4
c7t0d5
c8t0d1
c8t0d2
c8t0d3
c8t0d4
c8t0d5
My requrement is it shoud print /dev/rdsk/c2t767 like all the files under /dev/dsk dir
And print the PV id for this device files using the below script
xd -j8200 -N16 -tx /dev/rdsk/c17t1d6 /dev/rdsk/c13t1d6 /dev/rdsk/c19t1d6 /dev/rdsk/c15t1d6
Please help
Ajin.S
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2014 12:36 AM - edited 07-17-2014 12:37 AM
07-17-2014 12:36 AM - edited 07-17-2014 12:37 AM
Re: Need help getting PV ID on files in /dev/rdsk/
>My requirement is it should print /dev/rdsk/c2t767 like all the files under /dev/dsk dir
Then use a better command:
ls /dev/rdsk/*
>And print the PV id for this device files using the below script
for disk in $(ls /dev/rdsk/*); do
echo "Doing $disk: ============="
xd -j8200 -N16 -tx $disk
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2014 12:53 AM
07-17-2014 12:53 AM
Re: Need help getting PV ID on files in /dev/rdsk/
Hi Dennis
Thank you verymuch for quick reply.
In th below output its possible to filter specific disk details based on date which it created.
And also in our setup we are using One PV having 3 alternate liks having same PVID ,
In this senario Shall I get the device files using same PVID
Your help is welcome.
# cd /dev/rdsk
# ll
total 0
crw-r----- 1 bin sys 188 0x000000 Jun 25 2012 c0t0d0
crw-r----- 1 bin sys 188 0x020000 Nov 13 2012 c2t0d0
crw-r----- 1 bin sys 188 0x021000 Nov 13 2012 c2t1d0
crw-r----- 1 bin sys 188 0x070100 Nov 13 2012 c7t0d1
crw-r----- 1 bin sys 188 0x070200 Nov 1 2012 c7t0d2
crw-r----- 1 bin sys 188 0x070300 Nov 1 2012 c7t0d3
crw-r----- 1 bin sys 188 0x070400 Nov 1 2012 c7t0d4
crw-r----- 1 bin sys 188 0x070500 Nov 1 2012 c7t0d5
crw-r----- 1 bin sys 188 0x080100 Nov 1 2012 c8t0d1
crw-r----- 1 bin sys 188 0x080200 Nov 1 2012 c8t0d2
crw-r----- 1 bin sys 188 0x080300 Nov 1 2012 c8t0d3
crw-r----- 1 bin sys 188 0x080400 Nov 1 2012 c8t0d4
crw-r----- 1 bin sys 188 0x080500 Nov 1 2012 c8t0d5
Ajin.S
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2014 01:16 AM - edited 07-17-2014 01:18 AM
07-17-2014 01:16 AM - edited 07-17-2014 01:18 AM
Re: Need help getting PV ID on files in /dev/rdsk/
>it's possible to filter specific disk details based on date which it created.
Yes, you can get that with:
ll /dev/rdsk/*
Or use: find /dev/rdsk -mtime -N
Or use: find /dev/rdsk -newer reference-file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2014 01:27 AM
07-17-2014 01:27 AM
Re: Need help getting PV ID on files in /dev/rdsk/
Hi Dennis
Thank you
The below is the output
From this output using script its possible to remove the enrties which is having the PVID 0
# ./pvid.sh
Doing /dev/rdsk/c0t0d0: =============
xd: Error reading file /dev/rdsk/c0t0d0
Doing /dev/rdsk/c2t0d0: =============
0000000 e08388d5 4fe7ccfe e08388d5 4fe7ccfe
0000010
Doing /dev/rdsk/c2t1d0: =============
0000000 e08388d5 507fad07 e08388d5 4fe7ccfe
0000010
Doing /dev/rdsk/c7t0d1: =============
0000000 e08388d5 50a20b14 e08388d6 50a20db2
0000010
Doing /dev/rdsk/c7t0d2: =============
0000000 0 0 0 0
0000010
Doing /dev/rdsk/c7t0d3: =============
0000000 0 0 0 0
0000010
Doing /dev/rdsk/c7t0d4: =============
0000000 0 0 0 0
0000010
Doing /dev/rdsk/c7t0d5: =============
0000000 0 0 0 0
0000010
Doing /dev/rdsk/c8t0d1: =============
0000000 e08388d5 50a20b14 e08388d6 50a20db2
0000010
Doing /dev/rdsk/c8t0d2: =============
0000000 0 0 0 0
0000010
Doing /dev/rdsk/c8t0d3: =============
0000000 0 0 0 0
0000010
Doing /dev/rdsk/c8t0d4: =============
0000000 0 0 0 0
0000010
Doing /dev/rdsk/c8t0d5: =============
0000000 0 0 0 0
0000010
Ajin.S
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2014 06:38 AM
07-17-2014 06:38 AM
Re: Need help getting PV ID on files in /dev/rdsk/
>it's possible to remove the enrties which is having the PVID 0?
Just pipe to grep:
grep -v -e "^00000010" -e " 0 0 0 0"
(Assuming I counted the spaces correctly.)