- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Some help on lvol creation
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
Forums
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
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
11-16-2004 03:29 AM
11-16-2004 03:29 AM
I have a VG of 200GB, I want to create 50lvols and do a newfs on it.
What method would be best to do it. What type of script shall I use noting that I have naming convention as lvol_000, lvol_001...
Please let me know your suggestions.
Thanks
Prashant
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 03:36 AM
11-16-2004 03:36 AM
Re: Some help on lvol creation
for i in "lvol_000 lvol_001 . . ."
do
lvcreate
newfs
done
would be the simplest
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 03:36 AM
11-16-2004 03:36 AM
Re: Some help on lvol creation
Answer:
lvcreate -C n -n lvol_000 /dev/vg01
I chose the volume group at random.
You just need to put the lvol_000 in a variable and increment your script as you go.
while read -r lvolname
do
# increment variable here
# lvcreate statement here
lvcreate -C n -n $lvolname /dev/vg01
done < file_list_of_lvol
file_list_of_lvol
flat file list 1 lvol per line.
Or you can built the variable name by incrementing a numberic variable in your control loop.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 03:38 AM
11-16-2004 03:38 AM
Re: Some help on lvol creation
Is there something particular (mirroring ? stripping ?)
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 03:45 AM
11-16-2004 03:45 AM
Re: Some help on lvol creation
Please reply
Thanks
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 03:45 AM
11-16-2004 03:45 AM
Re: Some help on lvol creation
Thanks
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 03:46 AM
11-16-2004 03:46 AM
Solution#!/usr/bin/sh
i=0
while [[ ${i} -lt 50 ]]
do
## Set LV name
if [[ ${i} -lt 10 ]] ; then
LV=lvol_00${i}
else
LV=lvol_0${i}
fi
## Create LV (specify your VG name here)
lvcreate -L 4 -n ${LV} vg02
## newfs with the rlvol name
newfs -F vxfs -o largefiles /dev/vg02/r${LV}
((i=$i+1))
done
Hopefully everything in the script makes sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 03:48 AM
11-16-2004 03:48 AM
Re: Some help on lvol creation
you can try this,
#!/usr/bin/sh
typeset -Z3 COUNT=0
while [[ ${COUNT} -lt 050 ]]
do
echo "$COUNT"
lvcreate -n lvol_$COUNT /dev/vg_name
lvextend -L size_in_mb /dev/vg_name/lvol_$COUNT
newfs -F vxfs -o largefiles /dev/vg_name/rlvol_$COUNT
(( COUNT +=1 ))
done
This will create lv's lvol_000 to lvol_049 (50 lvs)
Use your own command between echo "$COUNT" and (( COUNT +=1 ))
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 04:25 AM
11-16-2004 04:25 AM
Re: Some help on lvol creation
You would be much better served by leaving as much space in the VG unallocated so that LVOL's and filesystems can be expanded as needed. If this is a test then perhaps your allocation makes sense; if you are trying to limit resources to users or groups then quotas make more sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 05:11 AM
11-16-2004 05:11 AM
Re: Some help on lvol creation
This is not a test. I am in a environment where in a group i need to allocate different FS for development purpose.
Sanjay typeset -Z3 count=0, this is not working, it throws errors. And moreover it increaments till 39 only. I have tried changing it to 50 instead of 050, which works fine.
Thanks
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 05:28 AM
11-16-2004 05:28 AM
Re: Some help on lvol creation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2004 05:48 AM
11-16-2004 05:48 AM
Re: Some help on lvol creation
1) What is the setup of this 200 GB disk presented to your machine?
Most disk arrays default to Raid 5 and its probaly striped over a lot of disks. This won't provide awesome performance but it will work for most applications other than intense database oltp.
2) Do you need raw disk space or cooked with a filesystem? That doesn't affect the lvcreate commands.
If you as is recommended now have the striping handled at the hardware level, then Patrick's script is all you need to quickly create 50 logical volumes.
If you need to handle performance on a software level then its back to the drawing board.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com