0

I'd like to convert my file system from ext4 with LVM partitions (Fedora style: swap, root, home) to btrfs, primarily for the backup/snapshot feature. I read that it's beneficial to not use a LVM when using btrfs to make use of the full potential of btrfs (I'm light on understanding the exact reasons...).

My question is how would I go about "collapsing" these volumes (removing LVM), so I could continue with the official migration path (btrfs-convert) described here?

$> pvdisplay -m
  --- Physical volume ---
  PV Name               /dev/nvme0n1p3
  VG Name               fedora
  PV Size               475.74 GiB / not usable 0   
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              121790
  Free PE               0
  Allocated PE          121790
  PV UUID               xxxxxx-yyyy-zzzz-aaaa-bbbb-cccc-ddddd
   
  --- Physical Segments ---
  Physical extent 0 to 4024:
    Logical volume  /dev/fedora/swap
    Logical extents 0 to 4024
  Physical extent 4025 to 106429:
    Logical volume  /dev/fedora/home
    Logical extents 0 to 102404
  Physical extent 106430 to 108989:
    Logical volume  /dev/fedora/root
    Logical extents 12800 to 15359
  Physical extent 108990 to 121789:
    Logical volume  /dev/fedora/root
    Logical extents 0 to 12799

There's also a /boot/efi(/dev/nvme0n1p1) and a /boot (/dev/nvme0n1p2) partition on the disk (in addition to LVM2 /dev/nvme0n1p3). My current backup method (dd...) captures those partitions. Would a btrfs backup in future also include those partitions?

1 Answer 1

2

You can have btrfs on top of LVM and still use all the features (like snapshots or compression), but every layer in in the storage stack will cost you some performance and add unnecessary complexity so if you don't need LVM, you should not use it.

Unfortunately it is not possible to just remove LVM so in this case I would recommend backup and a fresh installation of Fedora with btrfs.

There's also a /boot/efi (/dev/nvme0n1p1) and a /boot (/dev/nvme0n1p2) partition on the disk

You need a separate partition for /boot/efi because it must be on a FAT filesystem, but you can have /boot on btrfs. Default for Fedora is separate /boot but using a btrfs subvolume for /boot is supported.

1
  • If I was to create another partition outside of LVM, copy nvme0n1p3 (home) over, change the fstab to use the new partition, could I then remove LVM? If so, how would I then continue? Would I merge the partition with root and have 1 btrfs partition? My aim is to get a backup mechanism as thorough as dd if=/dev/nvme0n1 ..., so in case of a disk failure, I could get a new disk and reinstall the whole system (not just home).
    – orange
    Mar 1 at 0:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.