5

I have a fresh install of Fedora 33, with BTRFS.
While installing it I created separate partitions for / and /home. But now the system (df, gparted) thinks that I have the same partition mounted in both:

$ df -h
...
/dev/nvme0n1p2  850G   36G  814G   5% /
tmpfs            32G   34M   32G   1% /tmp
/dev/nvme0n1p2  850G   36G  814G   5% /home

When I add a large file to /home, I see the used space increasing in both. The weird thing (to me) is that when I look at / I don't see directories from /home.

What happened? Does anyone know if this is safe, i.e. can writing to the user's directory overwrite or mess up system files and vice versa?

0

2 Answers 2

6

When I add a large file to /home, I see the used space increasing in both.

This is how btrfs works. You have one partition formatted to btrfs and the filesystem itself is divided into multiple (in case of Fedora two) subvolumes. All the subvolumes share the same space, that's why you see both / and /home having same 814G free space and that's why creating a new file in /home also increases used space in /. But there's no reason to be worried, it's still two separate directories and you can't overwrite data on / when writing to /home or vice versa.

While installing it I created separate partitions for / and /home

If you used the manual partition tool and selected btrfs (which is now default) you created subvolumes, not partitions. If you want separate partitions, you need to switch the partitioning scheme from Btrfs to Standard Partition:

custom partition in fedora

4
  • btrfs is default? Isn't it infamous for losing data?
    – user253751
    Nov 27, 2020 at 19:50
  • Yes, btrfs is now default in Fedora 33 -- fedoramagazine.org/btrfs-coming-to-fedora-33 Nov 27, 2020 at 19:53
  • 2
    @user253751: I'd take such claims with a grain of salt. I still remember when Reiserfs was "infamous for losing data", but actually, Reiserfs was introduced at the same time that UDMA133 was introduced. For the entire history of Parallel ATA, people had always used out-of-spec cables (including myself), and it had always worked fine, until the super high-performance UDMA133 adapters and hard disks with huge caches came along, which was roughly at the same time as Reiserfs. Throw in a couple of weird bugs that every new filesystem has at the very beginning, and you have your urban myth. Nov 27, 2020 at 21:05
  • 1
    @user253751 SuSE has been using btrfs as root for years. Fedora is just late to the game.
    – jsbillings
    Nov 28, 2020 at 21:47
3

This is normal when you mount different subvolumes of the same Btrfs filesystem. In the output of mount you will see subvol=… different for each. Your /etc/fstab is probably where these are specified.

I created separate partitions for / and /home.

Maybe you did create partitions, but somehow these mountpoints use a single filesystem now. Or maybe you misinterpreted and it was about separate subvolumes from the start? Without details I cannot tell. You may want to investigate if there's an unused partition.

Compare this answer of mine. I think it may be helpful.

Yes, mounting subvolumes like this is safe.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .