- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script for VG's and LV's and FS creations.
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
тАО10-01-2008 03:12 PM
тАО10-01-2008 03:12 PM
Script for VG's and LV's and FS creations.
Thanks to all in advance.
I know how to create VG's, LV's, and FS from command like but I am looking for a script the dose that. Does anyone one has that out there that will be super and save me some typing and it will be easy to create VG's and LV's when you have 50+ luns.
I have the comma line in place but having difficulty putting in script format. Appreciate your help.
> pvcreate /dev/rdsk/cxtxd0
> mkdir XYZ
> find out the next GROUP #
> mknod /dev/vgxx/group c 64 0x010000
> vgcreate -e XX -p XX -s XX /dev/vgXX "Disk path"
> lvcreate -L XGB -n lvol1 VGname
> newfs -F vxfs -o largefiles dev/vgXX/rlvolX
Thanks to all in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 03:40 PM
тАО10-01-2008 03:40 PM
Re: Script for VG's and LV's and FS creations.
To a large extent you have the guts of your script as outlined. It's just a matter of defining and using variables, as for example:
# vgcrete -e ${MAXPE} -p ${MAXPV} -s ${PESIZE} /dev/vg${VGNBR} ${PVPATH}
For the 'mknod' major numbers, remember that the values are in hexadecimal. Hence a volume group with a major number of "0x100000" is decimal sixteen (16). An easy way to convert your decimal values to hexadecimal ones is to use 'printf':
# printf "%02x\n" 16
10
If you are running 11.23 or less, remember that your kernel's maxvgs' parameter sets the ceiling for the largest major number for volume groups, so you may need to adjust this first before you run your script. Too, a 'maxvgs' value of <10> [decimal] is zero-relative, so with vg00 only, one slot is taken.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 04:13 PM
тАО10-01-2008 04:13 PM
Re: Script for VG's and LV's and FS creations.
Thanks for the quick reply. I do have the idea about some "for do loops" but having trouble putting all this together.
For example I do "FOR LOOP" like this.
I have all this BITS and pices and now I need to put it together with some intelligence. Way too many FOR LOOPS...
LOL
If someone has one already out their then will defiantly save me some time.
Appreciate your help.
=====================================
> for hw in $(ioscan -fun -C disk | grep -i emc | awk '{print $3}')
do
ioscan -fun -H ${hw} | grep dsk | awk '{print $1}'
done | sort > Disk.list
> set -A disks $(cat disk.list)
> for disk in ${disks[*]}
do
pvcreate /dev/rdsk/${disk##*/}
done
===================================
Thanks in advance...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 06:26 PM
тАО10-01-2008 06:26 PM
Re: Script for VG's and LV's and FS creations.
When I do this and it takes the first disk only. Not all the disk in working file. Any idea why?
for disk in ${disks[*]}
do
vgcreate /dev/vgXX /dev/dsk/${disk##*/}
done
Thanks for the help in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 06:56 PM
тАО10-01-2008 06:56 PM
Re: Script for VG's and LV's and FS creations.
You have: Disk.list
Then: set -A disks $(cat disk.list)
You should also toss that evil cat:
set -A disks $(< Disk.list)
Check with: echo ${disks[*]}
- Tags:
- evil cat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2008 09:48 AM
тАО10-02-2008 09:48 AM