- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- volume group creation script
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
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
тАО07-24-2000 04:29 PM
тАО07-24-2000 04:29 PM
volume group creation script
I am looking for a script which creates the volume group. Did anyone have such script like this.
I am running out of ideas for creating group file for a new volume group where it has to select next available minor number..
thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-24-2000 11:46 PM
тАО07-24-2000 11:46 PM
Re: volume group creation script
at the attachment a quick and dirty script for determining the next free minor number for creating a vg.
You have to modify it for your purposes.
Regards
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2000 01:32 AM
тАО07-26-2000 01:32 AM
Re: volume group creation script
It is pretty straight forward can be done from command line also. for help do a man 1M mknod.
1. mkdir /dev/vgname (e.x vg02)
2. mknod /dev/vgname c 64 0x010000
minor number starts with 0x000000 for vg01, 0x010000 for vg01, 0x020000 for vg02 and so on....
Vincente.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2000 02:59 AM
тАО07-26-2000 02:59 AM
Re: volume group creation script
2. mknod /dev/vgname/group c 64 0x010000
also do a "man lvm" for lvm advance options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2000 10:26 PM
тАО07-26-2000 10:26 PM
Re: volume group creation script
U can use the following little command to find out the next available vg-id , provided you have used a sequential allocation .i.e., u have not missed any numbers in between.
Try this out...
ll -R | grep group | awk '{print $6}' | sed 's/....$//' | cut -c3- | sort -nr |
head -1
Run this command while in /dev directory to find out the last used vg-id. Increment one and then use it for the group file.
Hope this helps.
Regards,
Sundar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2000 01:12 AM
тАО07-27-2000 01:12 AM
Re: volume group creation script
#!/usr/bin/ksh
ll $(find /dev -name group ) |awk ' { if ( $5 == 64 ) {
printf("%s\n",toupper(substr($6,3,2)));
}
}' | while read num junk
do
echo "ibase=16;$num/1" | bc
done | sort -n | awk ' BEGIN { x=-1; }
{ x++;
if ( x != $1 ) {
x--;
exit;
}
} END {
printf("%x\n",++x);}'
hope all the slashs and such come out ok.
you might want to do a more defined search
then files named group in the //dev directory
with a major number of 64, but that is up to you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2000 01:51 AM
тАО07-27-2000 01:51 AM
Re: volume group creation script
so a little better might be:
minor_num=$( find /dev -name group |while read line junk
do
ll -d $line
done |awk ' { if ( $5 == 64 ) {
printf("%s\n",toupper(substr($6,3,2)));
}
}' | while read num junk
do
echo "ibase=16;$num/1" | bc
done | sort -n | awk ' BEGIN { x=-1; }
{ x++;
if ( x != $1 ) {
x--;
exit;
}
} END {
printf("0x%02x0000n",++x);}' )
print $minor_num