I have a DAS w/ 6 750Gb and 6 1Tb discs I am setting up using Linux raid. The controller is a POS so each disc is exported as an R0 single volume.
I used a parted and fdisk script to create 1 max size partition labeled as Linux Raid Autodetect and created the first r6 array w/ mdadm. I normally create and mark partitions as raid or lvm so people know what's going on.
The first md array is obviously too large for fdisk and parted doesn't create lvm partitions does it?
Should I just pvcreate the raw /dev/md0 and not worry about creating an lvm partition on it, or should/(can?) I?
Thanks! jlc
On Tue, Oct 06, 2009 at 05:28:46PM +0000, Joseph L. Casale wrote:
Should I just pvcreate the raw /dev/md0 and not worry about creating an lvm partition on it, or should/(can?) I?
pvcreate is the first step of creating LVM areas. If you're not going to use LVM then you don't need to pvcreate. However I recommend that you _do_.
Typically the steps are: mdadm to create the array (you've already done that) pvcreate the disk (/dev/md0) vgcreate a volume group, with /dev/md0 in it lvcreate the logical volumes inside the volume group
eg pvcreate /dev/md0 vgcreate MyVolumeGroup /dev/md0 lvcreate -L 1T MyVolumeGroup MyLVol1 lvcreate -L 1T MyVolumeGroup MyLVol2 lvcreate -L 1T MyVolumeGroup MyLVol3 would create 3 1Terabyte logical volumes which could be accessed as /dev/MyVolumeGroup/MyLVol1 etc etc. They're what you could run mke2fs on and mount.
(commands off the top of my head, so might be slightly wrong!)
pvcreate is the first step of creating LVM areas. If you're not going to use LVM then you don't need to pvcreate. However I recommend that you _do_.
Yea I guess I was rather vague. I do plan to carve up the md device w/ lvm once it's up. Historically I run pvcreate on lvm partitions for various reasons.
Should I create an pvm partition on the md0 device? I was not even sure I could...
Thanks! jlc
On Tue, Oct 06, 2009 at 05:59:37PM +0000, Joseph L. Casale wrote:
pvcreate is the first step of creating LVM areas. If you're not going to use LVM then you don't need to pvcreate. However I recommend that you _do_.
Yea I guess I was rather vague. I do plan to carve up the md device w/ lvm once it's up. Historically I run pvcreate on lvm partitions for various reasons.
Should I create an pvm partition on the md0 device? I was not even sure I could...
You don't run pvcreate on lvm partitions. You run pvcreate on the block devices that will be added to the volume groups. This puts the required headers on the device so that they can be identified by lvm.
Now these block devices could be a hard disk partition, a complete raw hard disk (/dev/sda, for example)... or a raid metadisk (/dev/md0). Could even be a flash drive if you wanted. Doesn't matter. It's just a block device.
As per my previous email, pvcreate /dev/md0 vgcreate MyVolumeGroup /dev/md0 lvcreate -L 1T MyVolumeGroup MyLVol1 lvcreate -L 1T MyVolumeGroup MyLVol2 lvcreate -L 1T MyVolumeGroup MyLVol3 would create 3 1Terabyte logical volumes which could be accessed as /dev/MyVolumeGroup/MyLVol1 etc etc. They're what you could run mke2fs on and mount.
(commands off the top of my head, so might be slightly wrong!)
You don't run pvcreate on lvm partitions. You run pvcreate on the block devices that will be added to the volume groups.
You sure can run pvcreate on a partition, for example /dev/cciss/c0d0p1 instead of /dev/cciss/c0d0 and the use of it for example, creating a partition of "Type" LVM so that it's obvious what's going on:)
man pvcreate
/snip Each PhysicalVolume can be a disk partition, whole disk, meta device, or loopback file. /snip
jlc
On Tue, Oct 06, 2009 at 07:29:00PM +0000, Joseph L. Casale wrote:
You don't run pvcreate on lvm partitions. You run pvcreate on the block devices that will be added to the volume groups.
You sure can run pvcreate on a partition, for example /dev/cciss/c0d0p1
c0d0p1 is not an LVM partition. It's a disk partition. Be careful of terminology.
The *next paragraph* of the email you replied to said "Now these block devices could be a hard disk partition"
If you look at /dev/cciss/c0d0p1 then you'll see it's a block device. ("ls -l" and you'll see the first character is a "b"). A partition is a specific type of block device.
However, the point of my email is the level that you think of it. If you think in terms of devices then you don't get any confusion (so no questions such as "do I need to partition my md disk for lvm?") because you're thinking in terms of how the technology works. Your "md" raid device, your disk partition, your whole disk... they're all just block devices.
On Tue, Oct 6, 2009 at 3:58 PM, Stephen Harris lists@spuddy.org wrote:
On Tue, Oct 06, 2009 at 07:29:00PM +0000, Joseph L. Casale wrote:
You don't run pvcreate on lvm partitions. You run pvcreate on the block devices that will be added to the volume groups.
You sure can run pvcreate on a partition, for example /dev/cciss/c0d0p1
c0d0p1 is not an LVM partition. It's a disk partition. Be careful of terminology.
Hehe, LVM doesn't have partitions it has logical volumes, so...
The *next paragraph* of the email you replied to said "Now these block devices could be a hard disk partition"
If you look at /dev/cciss/c0d0p1 then you'll see it's a block device. ("ls -l" and you'll see the first character is a "b"). A partition is a specific type of block device.
Yes, a partition is a block device with an offset and size. Joseph knows his stuff he's been on list for a while now just looking for confirmation.
However, the point of my email is the level that you think of it. If you think in terms of devices then you don't get any confusion (so no questions such as "do I need to partition my md disk for lvm?") because you're thinking in terms of how the technology works. Your "md" raid device, your disk partition, your whole disk... they're all just block devices.
Joesph,
You can create PVs out of any block device (even LVs).
You don't need to partition past the raw device storage, even that is optional, but recommended so other OSs know that, yes the space is actually used, if your using a volume manager like LVM. If you need to create a partition on a raw multi-terabyte device, you will need a GPT partition table as MBR stops working at 2TB I believe.
-Ross
Joesph,
You can create PVs out of any block device (even LVs).
You don't need to partition past the raw device storage, even that is optional, but recommended so other OSs know that, yes the space is actually used, if your using a volume manager like LVM. If you need to create a partition on a raw multi-terabyte device, you will need a GPT partition table as MBR stops working at 2TB I believe.
Yea, I just pv'ed the raw MD devices out of haste, I only know how to set partition type in script mode with parted, priceless... No time to test what happens w/ parted and manipulating labels etc on MD devices wrt to what happens under them. Bah:)
Its running! jlc
At Tue, 6 Oct 2009 17:59:37 +0000 CentOS mailing list centos@centos.org wrote:
pvcreate is the first step of creating LVM areas. If you're not going to use LVM then you don't need to pvcreate. However I recommend that you _do_.
Yea I guess I was rather vague. I do plan to carve up the md device w/ lvm once it's up. Historically I run pvcreate on lvm partitions for various reasons.
Should I create an pvm partition on the md0 device? I was not even sure I could...
If you are going to use the whole disk, there is no need to bother with partitions at all. Just pvcreate the whole device.
Thanks! jlc _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Tue, Oct 6, 2009 at 10:59 AM, Joseph L. Casale JCasale-at-activenetwerx.com wrote:
Yea I guess I was rather vague. I do plan to carve up the md device w/ lvm once it's up. Historically I run pvcreate on lvm partitions for various reasons.
Should I create an pvm partition on the md0 device? I was not even sure I could...
I don't usually partition md devices, though I think it's possible. I can't really see why you would want to if you're using LVM. Which you should, since it makes resizing or adding filesystems so much more convenient.
I *do* usually partition the underlying disk devices, mostly just to record what each partition is for should that disk get swapped around. As someone else noted, when using MD and/or LVM it's not technically required. Should you ever accidentally put one of those disks in a Windows host, you'll be glad you had a partition table, though...
Here's the generic-ish process I use: 1) Create the RAID "md" devices (e.g. /dev/md0) 2) pvcreate the whole md device 3) add the physical volume you just created (e.g. /dev/md0) to a volume group (vgcreate or vgextend) 4) extend your logical volume(s) as desired 5) extend the filesystem on each logical volume
-- Steve