Using parted command to create LVM partitions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Using parted command to create LVM partitions
# 1  
Old 02-12-2015
Using parted command to create LVM partitions

Oracle Linux 6.6

To create Physical Volumes for Volume groups (LVM) , the disk need to be partitioned to LVM type ie. 'Linux LVM' type . In fdisk , this can done by choosing 8e when prompted for partition type.

Since it is easy to script (non-interactive), I use parted command rather than fdisk to create partitions


For creating standard partitions, I use the below 2 non-interactive steps in our scripts

Step1. Creating the partition table for the device
Code:
parted -s  /dev/sda  mklabel msdos

For gpt, I use
Code:
parted -s  /dev/sda  mklabel gpt

Step2. create a primary partition that starts after 1mb (to ensure proper alignement)

parted -s /dev/sda unit mib mkpart primary 1 100%



From the below link , I gathered that partition can be set to LVM type interactively using set [partition number] lvm on
But, how can I incorporate this into step2 (non-interactive) shown above ?
How to create LVM Partition in Linux
# 2  
Old 02-15-2015
i'm using file as backend not the actual device, more of a fdisk user here, but from the manual..
Code:
parted -s /filestore unit mib mkpart primary 1 100% \
set 1 lvm on

Hope that helps
Regards
Peasant
This User Gave Thanks to Peasant For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to create LVM snapshots?

Please suggest me how do I create LVM snapshots in linux. Best regards, Vishal (5 Replies)
Discussion started by: admin_db
5 Replies

2. Solaris

Create new partitions

Hello, Can someone tell me why should i do to resolve this problem? I cant creat the news partitions!! # /etc/init.d/volmgt start volume management starting. # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0d0 <DEFAULT cyl 1955 alt 2 hd 255 sec 63> ... (5 Replies)
Discussion started by: herbich1985
5 Replies

3. Filesystems, Disks and Memory

Partition management: lvm? fdisk? parted? (on RAID)

Hello, I have a RHEL system with two 500GB hard drives in RAID 1 (I think hardware, but not 100% certain - any way to tell?). It looks like it was just set up in default configuration with a small boot partition and one huge partition for the rest, which composes a LVM volume. I want... (1 Reply)
Discussion started by: builder88
1 Replies

4. HP-UX

How to reduce LVM to create another LVM

Hi, I'm new to HP-UX. I have LVM on /var with 92Gig. I would like to reduce it to create another LVM for Oracle client with 800 meg or so. How to do it. I'm running 11.iv3 Thanks (4 Replies)
Discussion started by: lamoul
4 Replies

5. Red Hat

create /var lvm during install

Hi All, How do I create /var as LVM type during install? I want my new OS to have /var as LVM so that I could extend it on the fly. Thanks for any comment you may add. (2 Replies)
Discussion started by: itik
2 Replies

6. Solaris

How to create more partitions in x86 Solaris?

Friends, I have an 80 GB IDE hard disk on which I installed Solaris 10, the layout being Total size of the partition being 30 GB c0d0s0 = / directory = 15 GB c0d0s1 = swap file system = 1 GB c0d0s7 = /export/home directory = 1GB c0d0s8= boot c0d0s9 = alternates ... (3 Replies)
Discussion started by: saagar
3 Replies

7. SCO

create disk partitions in sco

i have one 9 gb hdd having root 2 gb fs now i want to create additional 1gb fs in remaining space unix partation created in entired 9gb thanx (1 Reply)
Discussion started by: sudhir69
1 Replies

8. Solaris

How to create new partitions in solaris,from the raw disk?

Hi all, I would like to know how to make new partitions.... I currently have allocated 60G for various slices (I have totally used 4 out of 7 available slices... I am running only solaris on my box. My plan is to have entire disk dedicated to solaris and run other OS from within... (19 Replies)
Discussion started by: wrapster
19 Replies

9. UNIX for Advanced & Expert Users

Is there a tutorial on how to create RAID 1 on top of lvm?

Hi, there are tons of RAID1 tutorials, but none of them deal with lvm. The problem is that I want to expand my current lvm partition over RAID1 rather than creating a new lvm partition after RAID1 is created. My master harddrive has lvm partition. I'm wondering how to create a RAID1 image of... (1 Reply)
Discussion started by: onthetopo
1 Replies

10. Filesystems, Disks and Memory

Problem setting up raw partitions on SUSE v8.0 using LVM on Oracle 8.1.7.URGENT!!!!!!

Hi all! Working on Oracle v8.1.7.0.0 with OS  as Suse v8.0 Linux. I had created LVM,linked raw devices to LVM as below: # for binding raw devices raw /dev/raw/raw1 /dev/oracle/sam_raw_system_251m raw /dev/raw/raw2 /dev/oracle/sam_raw_users_26m raw /dev/raw/raw3... (2 Replies)
Discussion started by: Amitstora
2 Replies
Login or Register to Ask a Question