5

I have created a partition with 36TB (/dev/sdb1) in rhel 6.6. Now I want use this for LVM.

  • What is recommended size for Physical Extents, Volume Extents and Logical Extents?
  • How important PE, VE and LE size to define while creating?

I want to create LV size of 10TB, 10TB, 6TB. I am using for file sharing through NFS and samba. Performance should be good. Please guide me for this...

1
  • The answers to your questions are available in plenty of the docs available. Did you try googling? Commented May 15, 2015 at 4:19

1 Answer 1

11

First off, you're confused about what some of those are. You can set the physical extent size with a fair bit of flexibility (vgcreate -s <size-of-PE>). But it doesn't matter, you should just go with the default. To quote the manpage:

The default is 4 MiB.… [H]aving a large number of extents will slow down the tools but have no impact on I/O performance to the logical volume.

When they say "no impact on I/O performance", they mean that literally. LVM is a wrapper around device-mapper and the LVM tools do not expose the physical extent size to device-mapper. The actual kernel code doing the I/O is unaware of the extent size. So it doesn't matter, unless you need to run lvcreate (etc.) all the time as part of your workload.

(Note it can influence data alignment; see below.)

The size in logical extents (set with lvcreate -l «number-of-extents») is just a way to specify the size of the logical volume. LV size = physical extent size * number of extents. Generally though you'd use -L «size» because that does the math for you, and let's you specify human-friendly sizes like 10T

I'm not sure what you mean by "volume extents", unless you mean the same as the above. Or maybe you mean the length of a physical volume in extents, but that'd also just be another way to specify the size.

What you should care about

At 36TB, your sdb is very unlikely to be a plain old disk. You should find out its alignment requirements and make sure you get everything aligned correctly. This is easiest if data_alignment_offset_detection (see man 5 lvm.conf) works in your setup—then the LVM tools will handle this all for you. Allocation (of a logical volume) is done in entire physical extent chunks, so you probably want the PE size to be a multiple of your alignment size. But at 4MiB, it probably already is. Misalignment will kill I/O performance, especially of writes.

You should also ensure that you're using an appropriate RAID level for your workload. Consider also battery-backed cache.

4
  • Hi, We are using Hardware RAID 6 and I am planing to create 9TB x 4 partitions. /dev/sdb1/2/3/4 and create lvm with striping and I also use 64MB PE for better performance. Is this fine ? Commented May 15, 2015 at 8:26
  • @sagar I'm not sure why you'd slice the disk into multiple pieces inside the kernel (by partitioning) only to put it back together inside the kernel (via LVM). Just do the straightforward thing—one large partition, put a PV on it, slice it with LVM. Commented May 15, 2015 at 21:27
  • Hi derobert, what is the Max size we can create lv In lvm2 for default PE 4 MB Commented May 16, 2015 at 22:19
  • @sagar LVM2 metadata is text-based; it doesn't have fixed-width binary numbers. The limits come from the kernel's ability to parse the numbers. On a 64-bit kernel, the limit is in the multiple-exabyte range. Commented May 16, 2015 at 23:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.