this post was submitted on 28 Nov 2023
1 points (100.0% liked)

Selfhosted

40329 readers
419 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I noticed that Linux server distros are using LVM as default. What is so good about LVM, and when should I use it? Is there a GUI for managing LVM volumes like GParted, or is it just through the terminal? How is it different from RAID in using multiple drives for one volume?

top 4 comments
sorted by: hot top controversial new old
[–] toma@lemmy.omat.nl 1 points 1 year ago

LVM is just a way more flexible partition table. It gives you the possibility to grow partitions at a later date. You probably not think you can do that with MBR or GPT too. Well yes, but only when the spare room is adjacent to the partition you want to grow. With LVM you can grow partitions even if the free space is somewhere else on the disk.

So you can grow any disk ‘partition’ at any time as long as you have some free space in the group.

Another advantage is that you can encrypt logical volumes easily. Usually that’s supported when you install the OS.

You can also stack LVM on top of a software RAID, so you can create a mdadm from a disk partition of several disks and create a VG on that with LVs to spilt it into pieces.

I usually use LVM on every server. There is no need not to and gives you options for the future.

[–] phanto@lemmy.ca 1 points 1 year ago

LVM is a bit more complicated than just using a normal partition, but it does add a lot of functionality. If you need to make an LVM volume bigger, you can just add another disk to the volume. You can also do RAID like stuff with it. Live resizing of volumes is doable too.

I think some LVM stuff can be done in Disks, but I generally just use the command line. Smarter people, are there graphical LVM utilities I don't know about?

[–] poVoq@slrpnk.net -1 points 1 year ago* (last edited 1 year ago) (1 children)

Slightly off tangent, but if you are thinking you might need LVM features (other than disk encryption) then it is worth looking into filesystems that have most of the functionality built in, like btrfs or OpenZFS.

[–] rentar42@kbin.social 1 points 1 year ago

I'm torn a bit, because architecturally/conceptually the split that LVM does is the correct way: have a generic layer that can bundle multiple block devices to look like one and let any old filesystem work on top of that. It's neat, it's clean, it's unix-y.

But then I see what ZFS (and btrfs, but I don't use that personally) do while "breaking" that neat separation and it's truly impressive. Sometimes tight integration between layers has serious advantages too and neat abstraction layers don't work quite as well.