- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: LVM 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
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
08-24-2007 09:18 PM
08-24-2007 09:18 PM
Siddhartha
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2007 09:30 PM
08-24-2007 09:30 PM
Re: LVM Script
Could you attach the script?
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2007 09:39 PM
08-24-2007 09:39 PM
Re: LVM Script
I am pasting here. lvcreate is not taking the variable after -L $DISKSZ.
With thanks
Siddhartha
#!/usr/bin/sh
echo "Author - Siddhartha Sinha,"
echo " Here is the list of disks you have here!!"
ioscan -funCdisk|grep -i dsk |awk '{print $1}'|sort|tee total_disks
echo " This the disks used by different Volume Groups"
vgdisplay -v|grep -i dsk|awk '{print $3}'|sort|tee used_disks
echo "Now you are going to create a Volume Group named vg-test"
echo "Keep patience, it may take longer time depending on the amount"
echo "of the Disks you have in this System"
vgchange -a n /dev/vg-test
vgexport /dev/vg-test
comm -23 total_disks used_disks|sed -e s/dsk/rdsk/g|while read DISK
do
dd if=/dev/zero of=$DISK bs=4096 count=1000
pvcreate -f $DISK
done
rm -r /dev/vg-test
mkdir /dev/vg-test
mknod /dev/vg-test/group c 64 0x080000
comm -23 total_disks used_disks|sort|sed -e 's/^/vgextend \/dev\/vg\-test /' -e '1s/vgextend/vgcreate \-s 64 \-p 32 /'| tee free_disks
chmod +x free_disks
./free_disks
PE_SZ=`vgdisplay /dev/vg-test|egrep -i 'PE Size'|awk '{print $4}'`
TOT_PE=`vgdisplay /dev/vg-test|egrep -i 'Total PE'|awk '{print $3}'`
DISKSZ=`expr $PE_SZ \* $TOT_PE`
lvcreate -L $DISKSZ -l lv-test /dev/vg-test
newfs -F vxfs -o largefiles /dev/vg-test/rlv-test
mkdir /test
mount /dev/vg-test/lv-test /test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2007 10:00 PM
08-24-2007 10:00 PM
Re: LVM Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2007 10:00 PM