Operating System - Linux
1753726 Members
4647 Online
108799 Solutions
New Discussion юеВ

shell script to create multiple LVM's or raw devices for syabse

 
ganaiwali
Advisor

shell script to create multiple LVM's or raw devices for syabse

I have Disk /dev/cciss/c0d1: 599.9 GB, unallocated on CentOS release 5.4 .

I need to create about 30-40 LVM's worth 500GB as raw devices for sybase . is there a way to script it or anyone already has it ?

the problem is that each time we need to do fdisk /dev/cciss/c0d1 and enter the partition no to create a new one .. how to overcome that problem and automate it in a script ?

thx,
tariq
2 REPLIES 2
TwoProc
Honored Contributor

Re: shell script to create multiple LVM's or raw devices for syabse

I've read that there exists a program called "cfdisk" which takes partition numbers, etc. from the command line.

I see it here:

http://www.gnu.org/software/fdisk/

Introduction

GNU fdisk provides alternatives to the following programs:

* util-linux fdisk (compatible clone lfdisk, extended clone gfdisk)
* util-linux cfdisk
We are the people our parents warned us about --Jimmy Buffett
Reiner  Rottmann
Frequent Advisor

Re: shell script to create multiple LVM's or raw devices for syabse

Some time ago I wrote a little Python script to create lvms from saved layouts. You may also alter that layout and mass create your volumes with it.

http://www.mindtwist.de/main/linux/3-linux-tipps/47-how-to-quickly-restore-lvm2-volumes-from-saved-layout.html