You are not logged in.
What I (believe to) understand:
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
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
*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
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.
I like to use this one too - some more detail in it:
You must unlearn what you have learned.
-- yoda
Offline
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.
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
You lot are great!
Thank you for confirming what is true and directing me where I need to go further. Much appreciated!
Offline
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
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
Offline
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
They say that the zfs is even more powerfull ...
Postpone all your duties; if you die, you won't have to do them ..
Offline
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
Offline
Btrfs offers most of the features of zfs and can be installed directly and simply, it has all the features of LVM and more
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.
Offline
^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 8.( )
</random babble>
Postpone all your duties; if you die, you won't have to do them ..
Offline