LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-22-2011, 08:24 AM   #1
ganaiwali
LQ Newbie
 
Registered: May 2010
Posts: 6

Rep: Reputation: 0
shell script to create multiple LVM's or raw devices for syabse


hey experts ,

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
 
Old 03-22-2011, 08:28 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well i think fdisk can be used as a command line, parted certainly can. Why do you need so many file systems though?
 
Old 03-22-2011, 09:16 AM   #3
ganaiwali
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I understand fdisk and parted can but all manually .. I am looking for a work around on if anyone has an existing shell script or so to do the job .

you need so many file systems i-e raw devices (un-partitioned ) for the best possible performance of db application . Linux general has its own very high OS I/O overhead and to over come that you create raw devices for ghe db app .

more http://infocenter.sybase.com/help/in...x/BEIFFBJD.htm
 
Old 03-23-2011, 03:13 AM   #4
ganaiwali
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Smile

I figured not not create a different volume each time just cus i need so many LVM's however a simple for loop did the trick

for i in 'seq 1 10'; do lvcreate -L 10G -n lvname$i vgname; done

will create LVM's lvname1 - lvname10 on vg vgname
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Script question: create a shell script in kde to log in on a server with ssh c4719929 Linux - Newbie 1 01-31-2011 04:05 AM
Is it possible for a LVM group to span multiple raid devices? mikesjays Linux - Hardware 2 01-28-2009 09:35 AM
How to create chunks (blocks) not raw devices in linux ? ytd Linux - Newbie 15 01-27-2009 08:46 AM
what is the different btw raw devices and block devices yenonn Linux - General 2 02-10-2006 10:34 PM
How to use shell script to get removable devices? slownet Programming 2 03-23-2004 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration