BTRFS – Multi Device Filesystem with Different Disk Sizes

btrfslinux

I have an existing BTRFS filesystem composed of one 500GB disk and I just bought a 2TB
disk to increase the storage capacity of my home server and I want add the new disk to the
existing filesystem. From what I read, it seems like no BTRFS setup can handle disk of different sizes without wasting the difference in size between the larger and the smaller
disk, but I'm new to BTRFS and I might have missed something, so is there a setup that can
allow me to combine two disks in a filesystem without wasting space ?

Best Answer

Btrfs can use different raid levels for data and Metadata:

the default (even for one disk) is raid1 for the metadata (directories etc) and raid0 for the data.

If you did not change this then likely you will have no problem adding the second disc and running re-balance. because only the metadata will be copied to both discs (you can see your metadata size with btrfs filesystem df /). Just be aware that if either of your disks fails you loose data.

because the 2tb disk is sooooooooo much bigger than the 500g it would perhaps give you better odds if you add the new one and then remove the old one (the odds of one specific drive failing are a lot less than the odds of either of the drives failing).

if you plan on having a raid array later (with more similar sized drives) you may want to re-create the filesystem on the new drive with raid1 for both data and metadata and then copy everything over. then later when you have more money buy the second 2tb drive.

ps: using raid1 on a singl drive means the data will be stored in two locations on that one drive (to protect against corruption) and will reduce your storage space (its a really really good idea for the metadata).

pss: seriously, dont be tempted to not use raid1 for metadata. psss: there is a very good chance that btrfs will gain the ability to change raid levels dynamically.