Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Using parted command to create LVM partitions Post 302935017 by John K on Thursday 12th of February 2015 11:17:12 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
LVSCAN(8)                                                     System Manager's Manual                                                    LVSCAN(8)

NAME
lvscan - scan (all disks) for Logical Volumes SYNOPSIS
lvscan [-a|--all] [-b|--blockdevice] [-d|--debug] [-h|--help] [--ignorelockingfailure] [-P|--partial] [-v|--verbose] DESCRIPTION
lvscan scans all known volume groups or all supported LVM block devices in the system for defined Logical Volumes. The output consists of one line for each Logical Volume indicating whether or not it is active, a snapshot or origin, the size of the device and its allocation policy. Use lvs(8) or lvdisplay(8) to obtain more-comprehensive information about the Logical Volumes. OPTIONS
See lvm for common options. --all Include information in the output about internal Logical Volumes that are components of normally-accessible Logical Volumes, such as mirrors, but which are not independently accessible (e.g. not mountable). For example, after creating a mirror using 'lvcreate -m1 --mirrorlog disk', this option will reveal three internal Logical Volumes, with suffixes mimage_0, mimage_1, and mlog. -b, --blockdevice This option is now ignored. Instead, use lvs(8) or lvdisplay(8) to obtain the device number. SEE ALSO
lvm(8), lvcreate(8), lvdisplay(8) lvs(8) Sistina Software UK LVM TOOLS 2.02.95(2) (2012-03-06) LVSCAN(8)
All times are GMT -4. The time now is 03:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy