You are not logged in.

#1 2022-03-13 10:50:57

justdanyul
Member
Registered: 2011-09-29
Posts: 137

lvmcache and partitions

I got a little home server which provides network attached storage to other clients on the network. Now, I'm planning an upgrading the network to 10GBE and the disks in the server, running in RAID-5, maxes ~200MB/s reads,  which of-course, wont saturate the new network.

So, I'm looking to, using lvmcache, improve the performance of raid. But, before taking on the project and making investments in SSDs, I want to confirm something (as i never done this before)

I only got one NVMe port on the motherboard, I'm assuming if I get a big NVMe, say 2TB, and I can partition it, and have a small system partition (which i dont want to be on LVM) and a partition for the lvmcache? Or, does the whole drive need to be under LVM control (sorry if this is a stupid question, I know very little (assume nothing) about LVM)

Offline

#2 2022-03-13 11:12:24

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 714

Re: lvmcache and partitions

Yes, a LVM physical volume can be a single partition on a multi-partition disk. It can also be the whole disk, a LUKS device or some other type of block device. See LVM#LVM building blocks.

Offline

#3 2022-03-13 12:37:27

Wild Penguin
Member
Registered: 2015-03-19
Posts: 398

Re: lvmcache and partitions

I have exactly the kind of setup you are planning to do and it works without problems. So just confirming what nl6720 says.

In general, Linux doesn't care if you have partitions or not - a whole disk is a block device in exactly similar way than a partition. So partition is never strictly needed or enforced by the Linux Kernel - I've made ext4 filesystems directly on a disk before. What will require partitions is the boot chain - at least the UEFI implementation of your hardware. Once Linux Kernel takes over, it doesn't care.

So in my setup, I actually have only two partitions - the I) EFI partition and II) the rest of the disk with the EFI partition. The "rest" partition is an LVM PV (while the EFI partition obviously isn't; UEFI would not understand PVs).

Other PVs are whole disks (so no more partitions besides the two I've mentioned). I have the fast SSDs in the same VG as the PVs I want to cache, and the ones I don't want to cache, are in other VGs.

EDIT: Of course some other OSes might require partitions and not understand a FS on a whole disk; if you want to stay future-compatible (in terms your setup changing / moving disk(s) to another computer), better make one partition on every disk. In addition to other OSes more likely understanding those disks, it will be much easier to split partitions and resize filesystems.

Last edited by Wild Penguin (2022-03-13 12:44:16)

Offline

Board footer

Powered by FluxBB