You are not logged in.

#1 2017-01-04 23:54:03

geekosupremo
Member
Registered: 2016-04-27
Posts: 168

LVM question - of LVs and File systems [Resolved]

What I (believe to) understand:

  1. LVM is a means of organizing multiple disks or physical Volumes (PV) into a single volume group (VG) -- I'm sure there are deeper things that can be done but these deductions are based on my use case

  2. A VG contains 1 or more Logical Volumes (LV) which are 'soft' partitions, by which I mean they can be manipulated w/o involving a partitioning tool eg. gparted

  3. *nix uses a file system w/in a partition (literal or soft) to maintain integrity and such of the files it contains

Question:

I've been going over the LVM guides and documentation. While concept is fairly straight forward, espcially after a few attempts at setup, there is one thing that I'm a little unclear on.

When setting up PVs & LVs do I need assign a file system to them?

If yes, should I assign a file system before the creation of the LV or after?

TL; DR Solution

  • Yes, LVs need a file system

  • said file system, can be assigned after lvcreate all the desired LVs. (This seems to be a common practice)

Last edited by geekosupremo (2017-01-06 00:57:33)

Offline

#2 2017-01-05 01:46:43

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,288

Re: LVM question - of LVs and File systems [Resolved]

Yes, you need to assign a file system so you can mount the logical volume. Create the filesystem after creating the volume, then you can mount it.

LVM Debian Wiki\

I like to use this one too - some more detail in it:

LVM Arch Wiki


You must unlearn what you have learned.
    -- yoda

Online

#3 2017-01-05 08:43:13

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: LVM question - of LVs and File systems [Resolved]

geekosupremo wrote:

When setting up PVs & LVs do I need assign a file system to them?

No, but then you wouldn't be able to use it ... you can think of them as unformated new disk (and/or partition). (BTW, there is no sense in assigning file system to PVs and VGs, only to LVs, AFAIK.)

For example, it is completely normal to create LV (without formatting it). Then you can simply 'dd' certain image directly to this LV, as you would - for example - to USB. (That's how I restore backup of certain LV.)

OTOH, to use it for your files, you have to format it somehow (as PackRat said). For example, I ahve had for some time dedicated LV formated as xfs (advertised as good for huge files), for my VBox virtual disks.

geekosupremo wrote:

If yes, should I assign a file system before the creation of the LV or after?

After (if needed).

Another nicely written guide, newbie-friendly, highly recommended: The monumental #! LVM guide

Last edited by iMBeCil (2017-01-05 08:47:01)


Postpone all your duties; if you die, you won't have to do them ..

Offline

#4 2017-01-05 16:27:33

geekosupremo
Member
Registered: 2016-04-27
Posts: 168

Re: LVM question - of LVs and File systems [Resolved]

You lot are great!

Thank you for confirming what is true and directing me where I need to go further. Much appreciated!

Offline

#5 2017-01-05 17:18:51

cloverskull
Member
Registered: 2015-10-01
Posts: 323

Re: LVM question - of LVs and File systems [Resolved]

I think of LVM like a means to add a layer of abstraction between you and a physical disk. You create a VG, populate it with LV(s), and then conduct business with the LV(s) as though working with a traditional disk, i.e. /dev/sdaX.

Offline

#6 2017-01-05 17:36:05

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,288

Re: LVM question - of LVs and File systems [Resolved]

For example, it is completely normal to create LV (without formatting it). Then you can simply 'dd' certain image directly to this LV, as you would - for example - to USB. (That's how I restore backup of certain LV.)

that's clever, thanks for pointing it out.

@geekosupremo - please edit your first post and mark the thread as solved.


You must unlearn what you have learned.
    -- yoda

Online

#7 2017-01-05 18:11:43

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: LVM question - of LVs and File systems [Resolved]

cloverskull wrote:

I think of LVM like a means to add a layer of abstraction between you and a physical disk.

Actually, it even more than this: you can combine arbitrary physical disks and/or partitions as a single VG (volume group).

For example, effectively one can group disk sda, partition (of disk dvb) dvb1, and usb stick sdc, as a single VG, and then in this VG define LV partitions /, /home, /swap, /usr .... LVM abstraction will take care of mapping of your LV partitions to physical devices in this single VG (hence the term 'physical volume'=PV in LVM parlance). Not that I would recommend making VG with usb stick wink

They say that the zfs is even more powerfull ...


Postpone all your duties; if you die, you won't have to do them ..

Offline

#8 2017-01-05 22:31:12

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LVM question - of LVs and File systems [Resolved]

iMBeCil wrote:

They say that the zfs is even more powerfull ...

Zfs is quite tricky to use in Debian because the kernel module must be built by the user, just like fglrx, and cannot be supplied in the (official) installation medium.

Btrfs offers most of the features of zfs and can be installed directly and simply, it has all the features of LVM and more cool


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#9 2017-01-06 01:00:08

geekosupremo
Member
Registered: 2016-04-27
Posts: 168

Re: LVM question - of LVs and File systems [Resolved]

Head_on_a_Stick wrote:

Btrfs offers most of the features of zfs and can be installed directly and simply, it has all the features of LVM and more cool

I did some reading on the Btrfs, but most of it seemed to say that it wasn't quite production ready yet. There were plenty of people saying that it was just fine in production ... but as I am new to this ... I think I'll stick with the more stable solution for now. wink

Offline

#10 2017-01-06 11:07:55

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: LVM question - of LVs and File systems [Resolved]

^Quite. I think debian itself doesn't consider brtfs production ready, yet. IMHO it will be safe to go with brtfs when stable debian version wil be by defautl shipped (installed) on brtfs, not ext4 as it is case now.

<random babble>
^ and ^^:
As for zfs ... a few months ago I talked to some guy who works for telecom-related company. He was in charge of finding the best free(?) virtualization setup. (I was interested, because I setup and maintain a small debian dom0, xen virtualized, lvm setup.) So he actively considered and tried various combinations of virtualization techniques, among them xen, kvm ... with various file systems ... brtfs, zfs, lvm ... His experience was: the best combination is kvm+zfs on solaris. In particular, he said that zfs+debian combination is not so good, because debian kernel and zfs are not 'mutually tuned', resulting in certain operation taking too long, or requiring too much RAM, compared to zfs+solaris combo (no suprise here since both are Sun's child). Also, he confirmed that he also feels that brtfs is not yet production ready.

(He also said that I should go with kvm instead of xen. Now I understand why (redhat embracement), and I wish I have met this guy before cry )
</random babble>


Postpone all your duties; if you die, you won't have to do them ..

Offline

Board footer

Powered by FluxBB