BTRFS in new HDD with Fedora 32

I am setting up a new HDD.
I found Fedora 33 will use BTRFS so, why not setup this disk with it already?

I used to partition disk with ext4 as shown:
/boot, 512 MB
swap, 16 GB (in an 8 GB RAM machine)
/ (root), 16 GB
/var, 32 GB
/tmp, 32 GB
/usr, 64 GB
/usr/local, 64 GB
/home, rest of space
not assigned, less than 4 GB

I am currently creating same partitions in btrfs and assigning same space but I am noticing Anaconda shows a BTRFS volume for every partition.

My intuition brings me to ask if I am doing something not OK.

1 Like

I guess you created various partitions. And you formatted each of them as btrfs. Is it?

I don’t have many experience. But I think we should change point of view.
The partition is one single partition formatted as btrfs. Then inside the btrfs pool you create the subvolumes, like /, /home, etc.

2 Likes

Exactly.
That is what I was atempting to do.
The computer got stucked and then I thought it over and came to ask before restarting the process.
Right.
I started to look on the subject and was reading this is the idea.

Thank you, @alciregi
Now I will see how Anaconda allows me to handle the subvolumes.

1 Like

I’m not sure about Anaconda’s own partitioner, haven’t used it in a while, but if you select Advanced Custom (Blivet-GUI) it’s quite simple.

  • keep (or recreate) your swap, BIOS Boot and/or EFI partitions (the latter two might not exist, depending on your system configuration), delete all others
  • create one big btrfs partition in the free space. You can assign it a mountpoint of / or no mountpoint at all
  • select the btrfs volume and add all your partitions as subvolumes. Note that you don’t have to specify a size for these, btrfs subvolumes are not like normal partitions, they do not have a size. If you chose not to assign / to the btrfs partition, you need to create a root subvolume and assign it to / now.

I typically go the route of having a root subvolume, as having all data in subvolumes feels more natural to me (as if the btrfs volume were a disk and the subvolumes its partitions) and simplifies snapshotting, but both approaches have their merit. I think F33 will also go the subvolume route, but I haven’t checked (yet).

3 Likes

Thank you, @lcts.
I proceeded under your indications.
Found out Anaconda does not allow the creation of subvolumes.

BIOS boot uses just 2 MB
swap is accepted without any hassle.
Then, when creating the btrfs volume, it asks for a label and mount point.
There is the point to indicate “/”.
But nothing else.
How can be /home be separated?

I have ALWAYS used a separate partition for /home and for several years have used a separate HDD for /home (currently raid 5). That way if something goes south with the contents of the root partition/disk/etc I do not lose any of my /home contents.

Using one HDD I would create one BTRFS volume for “/” and another for “/home”, In that way a reinstall as a result of a snafu would not risk losing the contents of /home.

Yes, @computersavvy, using ext4 and before I always partitioned the disk as explained at the beginning of this post.}

But I got confused with the concept of btrfs.
I think I will take all of your suggestions and do a /boot partition, the swap and then the / and /home btrfs volumes.

I really appreciate all of your input, @computersavvy, @alciregi, @lcts.

Just some hints.
You are here. (Custom partitioning)

Click on “+” and add /boot partiton.

Screenshot from 2020-08-27 18-10-24

Click again on “+”, to add the btrfs pool. Select “/” as mount point, and leave Desired Capacity blank. This step should create the btrfs partition and the “/” subvolume.

Screenshot from 2020-08-27 18-12-31

Click again on “+”, to add the “/home” subvolume, again without specyfing the capacity.

Screenshot from 2020-08-27 18-13-54

This is the result.

4 Likes

I’m kind of surprised btrfs is still in Fedora. RedHat banned it in EL8 without ever giving a clear, concise, intelligible reason. They’ve issued no apology nor plans to reverse that decision. And Fedora’s continued support of it creates mixed messages and can mislead new linux users into thinking btrfs will be supported in Enterprise Linux when it won’t be given Fedora’s place as basically the upstream of RHEL

“Use LVM and XFS instead” is what I hear when I ask about btrfs in EL8. Maybe they’ll change course for EL9, but it seems unlikely.

It’s rumored that Btrfs development is too fast, so it is not suited for RHEL.
Instead, it is being promoted by Facebook, which has some influence on Fedora.

Guess what, @b3y ?, Fedora 33 will be coming with BTRFS as default.

1 Like

Too fast? I’ve heard it’s too slow too. I’ve heard its not mature. but it’s been around now what almost ten years? I’ve heard it’s dead, yet there’s still more features people want. So I’m calling BS. That much misdirection means only one thing. Political conspiracy to spoil it.

This is spot on. The screenshots definitely help.

Note 1: In the top screen shot you can choose the Btrfs partition scheme preset, click on the blue text above, and the default Btrfs layout will be created. This layout has been used for many years in the installer’s Custom partitioning. And it’s the same layout used in Fedora 33 as the Automatic partitioning default.

Note 2: If you rerun the installer, after installing, you’ll see you can reuse an existing subvolume for /home. Whereas it does enforce creation of a new subvolume for /. So in case you decide to do a clean install down the road, rest assured you can reuse the home subvolume, and assign it to /home.

2 Likes

This is all relative, that is, too slow for a home user may be not slow enough for a corporate one. :wink:
It doesn’t mean that there is a single reason only, and I’m not going to prove it right or wrong.

Btrfs has been supported by the Fedora installer (Anaconda) for many years. It’s had one of, if not the most, sophisticated Btrfs capabilities of any installer. Most of that work came from the Anaconda team at Red Hat.

Btrfs by default was an idea that the Workstation working group evaluated on the merits. Facebook have a number of upstream kernel developers for Btrfs development, but also other core things we use in Fedora like the SCSI driver, cgroups (resource control), block device drivers, and so on. Fedora has a long track record working closely with upstream. Red Hat is an upstream for things we use too, but just not Btrfs.

5 Likes

It’s not official, but it’s the most persuasive answer to the question I’ve read.

Josef is at Facebook as one of the core Btrfs developers. Before that, he was at Red Hat, and worked on ext4 and XFS support, as well as Btrfs development. In the really unlikely event you run into a Btrfs issue, good chance it’ll be either him or me who will be triaging it.

It’s completely OK for folks to stick with what they’re familiar with; and to use a different file system when they know it better suits their needs. Custom partitioning isn’t going away. You don’t have to decide today or for Fedora 33 that you’re going to use Btrfs. It’s understandably exciting but everyone should be respected to take this change at their own pace.

4 Likes

Well, I finished installation, @alciregi, @lcts, @computersavvy
I ended like this:
/dev/sda1 ext4 /boot 512 MB
/dev/sda2 swap 16 GB
/dev/sda3 btrfs / 256 GB
/dev/sda4 extended
/dev/sda5 btrfs /home 719 GB
I am just about to enable the root user pwd.
For some reason Fedora 32 doesn’t allow to create it during setup.
I need the root user to install the NVIDIA drivers for the GPU for it doesn’t work fine with Nouveau.

I’m a big fan of sda1 512mb/1gb md0 raid1 metadata 0.90 /boot and sda2 lvm pv

Same on every drive. Then put your filesystems that you can safely move around without unmounting, rebooting, or shutting down.

Sorry but it is not correct. (Yep, you can partition your disk as you prefer, that’s fine).
The point is: there should be one partition, let’s say /dev/sda3, let’s say 975 GB (256+719), formatted as btrfs; then you should have two subvolumes: root (/) and /home. In this way, mainly, the available space is shared between all the subvolumes. Then you can assign particular options to each subvolume. In case of system re-installation you can preserve the /home even if the physical partition is the same. I don’t see a real advantage in using a separate physical partiton for each btrfs subvolume.

For the records, this is the result of a F33 installation where automatic partitioning was selected:

$ sudo fdisk -l
...
Device     Boot   Start      End  Sectors Size Id Type
/dev/sda1  *       2048  2099199  2097152   1G 83 Linux
/dev/sda2       2099200 67108863 65009664  31G 83 Linux
...

Where sda1 is the boot partiton and sda2 the btrfs one.

$ sudo mount|grep sda
/dev/sda2 on / type btrfs (rw,relatime,seclabel,space_cache,subvolid=258,subvol=/root)
/dev/sda2 on /home type btrfs (rw,relatime,seclabel,space_cache,subvolid=256,subvol=/home)
/dev/sda1 on /boot type ext4 (rw,relatime,seclabel)
$ sudo lsblk 
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   32G  0 disk 
├─sda1   8:1    0    1G  0 part /boot
└─sda2   8:2    0   31G  0 part /home
$ sudo btrfs filesystem show
Label: 'fedora_localhost-live'  uuid: f26ab08f-689b-4919-be9c-7724c6c014bd
	Total devices 1 FS bytes used 5.56GiB
	devid    1 size 31.00GiB used 6.52GiB path /dev/sda2
$ sudo btrfs subvolume list /
ID 256 gen 349 top level 5 path home
ID 258 gen 352 top level 5 path root
ID 265 gen 45 top level 258 path var/lib/machines
4 Likes