<---- template headericclude ----->
btrfs with or without lvm?
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 11 of 11
  1. #1
    Join Date
    May 2010
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    btrfs with or without lvm?

    What's the verdict for using btrfs dedicated to its own partition, vs. first setting up lvm and then formatting a lv as btrfs?

  2. #2
    leigh123linux Guest

    Re: btrfs with or without lvm?

    Why would anyone want to use btrfs till it's complete?
    Last time I checked there was no fsck for it.

  3. #3
    tox Guest

    Re: btrfs with or without lvm?

    Quote Originally Posted by leigh123linux
    Why would anyone want to use btrfs till it's complete?
    Last time I checked there was no fsck for it.
    i think going from kernel 3.2 there is more btrfs updates but i agree with you, using btrfs is silly unless you wanna lose your data

  4. #4
    Join Date
    May 2010
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: btrfs with or without lvm?

    Oy vey. These are answers to a question that was not asked. If you do that then I get to complain about why in the world there's a major f'n HURT ME button in the installer if it's such an evil file system, but still the question asked isn't answered.

    ---------- Post added at 03:06 AM ---------- Previous post was at 03:02 AM ----------

    And also I am seeing a file 'btrfsck' in the base install of F16. So what is that if not btrfsck?

  5. #5
    Join Date
    Aug 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: btrfs with or without lvm?

    just thinking out loud here...

    btrfs can grow and shrink at will, just like lvm, even though one is an fs, and the other is not.

    The remaining reason for previously using lvm, besides being able to grow or shrink the volume, would be that you had separate filesystems on each lvm, and this would protect you from logical filesystem errors (i.e. if /var died for some reason, you still had all the other filesystems in working order).

    You can also do this with btrfs (and even before the introduction of LVM) by creating separate partitions on the physical disk, each one containing a btrfs filesystem, but the partition is harder to manage (with Gparted) to grow and shrink, than an LVM volume would be.

    So... I suppose that LVM is still useful and is needed. Set up everything as you would previously with LVM, but instead of creating ext4 filesystems, use btrfs!

    This would apply to a laptop for instance, but if I was on a server (which I am) and wanted to create a new fs (one mount point) with several physical drives (which I do), then I would only use btrfs. No mdadm, no lvm, just create btrfs filesystem on one or two physical devices, then I could really easily use btrfs to add/remove devices, even if they differ physically. Yay!

  6. #6
    Join Date
    Jul 2011
    Location
    Birmingham, UK
    Age
    41
    Posts
    2,759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: btrfs with or without lvm?

    Quote Originally Posted by finite9
    btrfs can grow and shrink at will, just like lvm, even though one is an fs, and the other is not.
    So can the venerable old ext2/3/4 (with the resize2fs command), although btrfs is more flexible about it. You'll still have to resize the containing volume separately, or with a higher-level program that knows both file system and volume management.

    The remaining reason for previously using lvm, besides being able to grow or shrink the volume, would be that you had separate filesystems on each lvm, and this would protect you from logical filesystem errors (i.e. if /var died for some reason, you still had all the other filesystems in working order).
    Btrfs has sub-volumes, so that you can have multiple logical file systems in a single physical file system/volume. Having completely separate volumes is still safer though, in the sense that if a multi-sub-volume btrfs became corrupt, it wouldn't necessarily be contained to a single sub-volume.

    So... I suppose that LVM is still useful and is needed. Set up everything as you would previously with LVM, but instead of creating ext4 filesystems, use btrfs!
    That should work just fine. Also I think there are still a few clever things that can be done with LVM that btrfs doesn't do. Some people feel that LVM is over-used as things are, and in those cases btrfs probably will make it completely redundant if it isn't already, but in general LVM still has its place.

    if I was on a server (which I am) and wanted to create a new fs (one mount point) with several physical drives (which I do), then I would only use btrfs. No mdadm, no lvm, just create btrfs filesystem on one or two physical devices, then I could really easily use btrfs to add/remove devices, even if they differ physically. Yay!
    Ultimately, yes. Personally I'd stick to mdraid with ext4 on a serious machine for now though, at least until RHEL etc. make btrfs default. Let the bugs get ironed out first. But it certainly seems ready for home use (if you keep back-ups).

    Gareth

  7. #7
    Join Date
    May 2010
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: btrfs with or without lvm?

    LVM2 lets us do certain things that e.g. ext4, XFS, cannot do on their own.

    a.) Much more flexible than disk partitioning, since it can span 2^32 disks, and produce as many logical volumes.

    b.) Create a single logical volume (and thus a single ext4 or XFS volume) greater than the physical size of a disk.

    c.) Migrate physical extents from one disk to another while the underlying file system is still available (i.e. upgrading from a smaller to larger hard drive, or replacing a drive suspected of imminent failure).

    d.) Snapshots, I think up to 32.

    e.) Has extent based striping and mirroring.

    On those four issues, btrfs compares:

    a.) Also much more flexible than disk partitioning alone. A single volume can be up to 16EB which is still quite a few drives, and subvolumes metted out from that. I'm not sure if the subvolume quote code is done yet, but will mimic LVs.

    b.) Btrfs volumes can be larger than a single disk.

    c.) Btrfs data can be migrated off a disk (balanced to other disks), while the filesystem is online.

    d.) Also has snapshots, virtually unlimited. Can grow the file system even when you have rw snapshots online.

    e.) Has chunk based striping and mirroring, and eventually RAID 5 and 6 like behavior. But btrfs also lacks the ambiguity found in either md, dm, or lvm mirroring, as to which mirrored data is correct, when they aren't identical (i.e. corruption of either data or metadata). Performance should be better too because instead of sector based mirroring, it's done in 256+MB chunks.

    Plus a couple of extra things btrfs can do that LVM can't.

    f.) Compression (LZO, gzip, and Snappy on the way in kernel 3.4)

    g.) 16EB volumes. LVM is limited to 8EB.

    h.) checksums on data and metadata (which LVM+ext4, nor XFS has).

    So I think btrfs compares well to LVM's capabilities. For sure LVM isn't going away. But what we're seeing with modern file systems is incorporating aspects of LVM and RAID, and moving away from journals to COW.

  8. #8
    Join Date
    Aug 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: btrfs with or without lvm?

    Just a few questions regarding lvm-like functions:

    If I create a btrfs raid-0 on 2 raw devices (no partition), what happens when I add a third device to that fs? does re-balancing occur automatically?

    If I have the space to contain my files on only 2 of the devices in the 3 device raid-0, and choose to remove the third device from the raid-0 fs, will it work? Will it re-balance across the other 2 devices, then allowing me to remove the third device?

  9. #9
    Join Date
    May 2010
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: btrfs with or without lvm?

    You'd have to search the btrfs mailing list to see if re-balancing is expected to be automatic in the future. Presently you execute 'btrfs filesystem balance'. I'd like to think when adding a device, we'd eventually get an automatic re-balancing, but there may be good reasons for not doing so by default.

    When removing a device 'btrfs device remove' re-allocates extents to other devices, similar conceptually to LVM's pvmove.

  10. #10
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: btrfs with or without lvm?

    Re-balancing can be very slow, and would impact performance (until it finishes). It also might be a bit of a problem if there is a crash while it is running. Re-balancing may also cause ENOSPC ("Error NO SPaCe left on device") oops, which can only be recovered by deleting a large file...

    Small filesystems shouldn't have a problem though.

  11. #11
    Join Date
    May 2010
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: btrfs with or without lvm?

    I'm guessing that if you want striping performance of 3 drives, as in a conventional RAID 0, you'd want to re-balance. Otherwise seems the behavior would be more like concatenation/spanning, without rebalancing.

    ---------- Post added at 01:17 PM ---------- Previous post was at 01:13 PM ----------

    ** assuming the first two drives, in this example, were already full.

Similar Threads

  1. [SOLVED]
    BTRFS and F16
    By tox in forum F16 Development
    Replies: 10
    Last Post: 10th August 2011, 12:48 AM
  2. [SOLVED]
    BTRFS May Not be default in F16?
    By tox in forum F16 Development
    Replies: 4
    Last Post: 21st July 2011, 06:43 AM
  3. btrfs - More info?
    By keenanparm in forum Using Fedora
    Replies: 15
    Last Post: 15th July 2011, 09:53 PM
  4. Replies: 0
    Last Post: 4th July 2011, 01:21 AM
  5. BTRFS - use as default FS? Why/Why not?
    By Ben.Hahlen in forum Using Fedora
    Replies: 2
    Last Post: 9th June 2011, 01:06 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]