Create volume using LVM over 2 physical disks

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Create volume using LVM over 2 physical disks
# 8  
Old 11-07-2012
No help, just amusing. The "dumb message of the day" award goes to fdisk

Code:
Command (m for help): t
Partition number (1-5): 5
Partition 5 does not exist yet!

Command (m for help): t
Partition number (1-5): 4
Hex code (type L to list codes): 8e
You cannot change a partition into an extended one or vice versa
Delete it first.

I'm not experiencing the problems you are with pvcreate. Can you remove the PV and rescan it and start from scratch? (unless, of course, someone has a better idea, or, of course, sdb1 is actually being used!).

... I tried creating an extended partition to see if that caused a problem, then got that silly 'error'. It's of no consequence to your issue, just amusing.
# 9  
Old 11-09-2012
Regarding the pvcreate error: do you know if your lvm.conf has been manually modified? If you do any multipathing chances are that it has been (otherwise you'd constantly be getting duplicate PV errors in /var/log/messages). You may check /etc/lvm/lvm.conf and see if you have a filter set up.
# 10  
Old 11-09-2012
I think I messed up by deleting the physical volumes.
I was getting errors
Code:
# vgscan -v
    Wiping cache of LVM-capable devices
    Wiping internal VG cache
  Reading all physical volumes.  This may take a while...
    Finding all volume groups
    Finding volume group "VolGroup00"
  Couldn't find device with uuid 'UPkdKc-Ki6u-5GUf-BY8u-WABy-ssZ6-lkPjJl'.
  Couldn't find device with uuid 'bJaD2H-hx8h-dmD5-AgAk-RvHD-utl0-Gc9ooK'.
  Couldn't find device with uuid 'eh2fqQ-RjQZ-eLOc-jVnL-oSd3-j8o2-JBEQny'.
    There are 3 physical volumes missing.
  Found volume group "VolGroup00" using metadata type lvm2

So removed these devices using: vgreduce --removemissing
And doing a reconfigure.

Now if I need to start and have 2 Logical Volumes on /sdb
thats /dev/sdb1 and /dev/sdb2. What steps are needed.

Code:
fdisk /dev/sdb
pvcreate /dev/sdb1
pvcreate /dev/sdb2  --- not sure if we need this

vgextend VolGroup00 /dev/sdb1
vgextend VolGroup00 /dev/sdb2

lvcreate -L 60G -n LogVolU02 VolGroup00
lvcreate -l 100%FREE -n LogVolU01 VolGroup00


Would this be correct?

Last edited by Scott; 11-09-2012 at 12:30 PM.. Reason: Code tags, please...
# 11  
Old 11-09-2012
Yes, that looks about right.

But I still don't see the point of both partitioning with fdisk and then again with logical volumes. You'd be as well just using fdisk to specify ext3, or whichever FS type you want, then creating a filesystem without LVM, since it would be just as easy to create three primary fdisk partitions for your filesystems, or easier, actually, than creating two and then using LVM to carve it up further. And given that sdb1 and sdb2 are on the same physical disk - and I noticed that sdc seems to have been quietly dropped(!), you're not really gaining anything in terms of performance or reliability with the hybrid fdisk / LVM approach.
# 12  
Old 11-09-2012
sdc I dropped as it is a different disk and will be an entirely used for sdc1.

I am not sure how to partition /sdb into 2
If it can be done without fdisk. Can you please guide as to what steps are needed. THe reason I have been using fdisk in beginning is I saw it online.

How To Setup Logical Volume Manager (LVM) Step By Step | RouteMyBrain
# 13  
Old 11-09-2012
In the article, he is using fdisk to partition the disk to use partition type "8e" - Linux LVM.

If you allocate all space on sdb to a single primary partition (like you had before), you can then use LVM to create your volume group, and lvcreate to create the sizes of logical volumes you need.

I've never used fdisk to do this. Normally, just presenting the disk to the system and using LVM commands to create PV's, VG's and LV's is enough.
# 14  
Old 11-09-2012
So, I just added a new disk to my VM (BTW, you didn't say if you have a physical server or a virtual one):
Code:
[root@RH631d ~]# lvmdiskscan
  /dev/ramdisk       [       16.00 MB] 
  /dev/myvg01/mylv01 [       10.00 GB] 
  /dev/ram           [       16.00 MB] 
  /dev/sda1          [       47.03 MB] 
  /dev/myvg01/mylv02 [       10.00 GB] 
  /dev/ram2          [       16.00 MB] 
  /dev/root          [        3.90 GB] 
  /dev/ram3          [       16.00 MB] 
  /dev/sda3          [        1.97 GB] 
  /dev/ram4          [       16.00 MB] 
  /dev/ram5          [       16.00 MB] 
  /dev/sda5          [       14.08 GB] 
  /dev/ram6          [       16.00 MB] 
  /dev/ram7          [       16.00 MB] 
  /dev/ram8          [       16.00 MB] 
  /dev/ram9          [       16.00 MB] 
  /dev/ram10         [       16.00 MB] 
  /dev/ram11         [       16.00 MB] 
  /dev/ram12         [       16.00 MB] 
  /dev/ram13         [       16.00 MB] 
  /dev/ram14         [       16.00 MB] 
  /dev/ram15         [       16.00 MB] 
  /dev/sdb           [       50.00 GB] LVM physical volume
  /dev/sdc           [       50.00 GB] LVM physical volume
  /dev/sdd1          [        2.30 GB] LVM physical volume
  /dev/sdd2          [        1.53 GB] LVM physical volume
  /dev/sdd3          [      784.42 MB] LVM physical volume
  /dev/sde           [       20.00 GB] 
  4 disks
  19 partitions
  2 LVM physical volume whole disks
  3 LVM physical volumes

[root@RH631d ~]# pvcreate /dev/sde
  Physical volume "/dev/sde" successfully created

[root@RH631d ~]# vgcreate VolumeGroup00 /dev/sde
  Volume group "VolumeGroup00" successfully created

[root@RH631d ~]# lvcreate -L5G -n LogicalVolume01 VolumeGroup00
  Logical volume "LogicalVolume01" created

[root@RH631d ~]# lvcreate -L7G -n LogicalVolume02 VolumeGroup00
  Logical volume "LogicalVolume02" created

[root@RH631d ~]# lvcreate -l100%FREE -n LogicalVolume03 VolumeGroup00
  Logical volume "LogicalVolume03" created

[root@RH631d ~]# lvs
  LV              VG            Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  LogicalVolume01 VolumeGroup00 -wi-a-  5.00G                                      
  LogicalVolume02 VolumeGroup00 -wi-a-  7.00G                                      
  LogicalVolume03 VolumeGroup00 -wi-a-  8.00G

No need to fdisk. No need for fancy partitioning. I can now create my filesystems using these three LV's and I don't have to worry about it.

If, later on, I want to extend these filesystems, I can add a new disk, extend the VG, extend the LV, then easily extend the FS. It's hard to do that if you have partitioned everything, absolutely, with fdisk (although I suppose you could still extend the VGs with new disks, despite the strange fdisk partitioning).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Physical Volume Create Conundrum

I want to start by saying I already resolved my issue but I want to understand why I am seeing what I am seeing. I have a server with a RAID controller two 500GB drives and six 600GB drives. The two 500GB drives are mirrored and have the OS installed on them. The six 600GB they wanted set as... (4 Replies)
Discussion started by: scotbuff
4 Replies

2. AIX

Position of the logical volume on the physical volume

Hello everyone, I just read that while creating a logical volume(LV) we can choose the region of the physical volume (PV) in which the LV should be created. When I say region I mean: outer edge - outer middle - center - inner middle and inner edge. Can anyone help me understand the utility... (11 Replies)
Discussion started by: adilyos
11 Replies

3. UNIX for Dummies Questions & Answers

Confusion Regarding Physical Volume,Volume Group,Logical Volume,Physical partition

Hi, I am new to unix. I am working on Red Hat Linux and side by side on AIX also. After reading the concepts of Storage, I am now really confused regarding the terminologies 1)Physical Volume 2)Volume Group 3)Logical Volume 4)Physical Partition Please help me to understand these concepts. (6 Replies)
Discussion started by: kashifsd17
6 Replies

4. AIX

How to determine the physical volume fo the disks

This is the report I got running the comand rptconf, but I would like to know what is the capacity of the disks installed into our server power 6 with AIX System Model: IBM,7778-23X Machine Serial Number: 1066D5A Processor Type: PowerPC_POWER6 Processor Implementation Mode: POWER 6... (6 Replies)
Discussion started by: cucosss
6 Replies

5. Linux

LVM (volume manager) and virtual disks

:eek: Hi guys, I'm pulling my hair out over this one. I am trying to set up a virtual server environment. ( I am using VirtualBox, but I think this is irrelevant to this problem.) I have downloaded a pre-packaged Linux virtual disk, with which I have successfully started a virtual instance of a... (4 Replies)
Discussion started by: otheus
4 Replies

6. AIX

Basic Filesystem / Physical Volume / Logical Volume Check

Hi! Can anyone help me on how I can do a basic check on the Unix filesystems / physical volumes and logical volumes? What items should I check, like where do I look at in smit? Or are there commands that I should execute? I need to do this as I was informed by IBM that there seems to be... (1 Reply)
Discussion started by: chipahoys
1 Replies

7. UNIX for Advanced & Expert Users

LVM - Extending Logical Volume within Volume Group

Hello, I have logical volume group of 50GB, in which I have 2 logical volumes, LogVol01 and LogVol02, both are of 10GB. If I extend LogVol01 further by 10GB, then it keeps the extended copy after logical volume 2. I want to know where it keeps this information Regards Himanshu (3 Replies)
Discussion started by: ghimanshu
3 Replies

8. HP-UX

How Can I Create A Volume Group With Two Hard Disks On Hp-ux C-3750

Hello All, I Am A New Member To This Group. I Want To Know How Can We Create Single Volume Group Using 2 Hard Disks. As We Require More Data To Be Stored We Need To Add A Hard Disk,but I Have A Doubt Whether We Can Increase The Size Of A Logical Volume Mounted On A Volume Group By Adding A... (5 Replies)
Discussion started by: bala_mes
5 Replies

9. UNIX for Dummies Questions & Answers

Physical volume- no free physical partitions

I was in smit, checking on disc space, etc. and it appears that one of our physical volumes that is part of a large volume group, has no free physical partitions. The server is running AIX 5.1. What would be the advisable step to take in this instance? (9 Replies)
Discussion started by: markper
9 Replies

10. UNIX for Dummies Questions & Answers

physical volume and physical disk.

Hello, I need explanations about physical disks and physical volumes. What is the difference between these 2 things? In fact, i am trying to understand what the AIX lspv2command does. Thank you in advance. (2 Replies)
Discussion started by: VeroL
2 Replies
Login or Register to Ask a Question