2

I have a 500 GB HDD and a 300 GB HDD. I have formatted them as btrfs raid1 between.

The total size is 800 GB.

If I copy 50 GB onto the filesystem, it causes 100 GB to be used.

If I copy 300 GB onto the filesystem, it causes the smaller drive to be full

What about the extra 200 GB on the bigger drive? Does it still use that extra 200 GB, but just doesn't mirror it?

So if having mirrored data is important to my filesystem, should I create equal sized partitions even if Ii have mismatched sized drives?

Obviously, it won't stop mirroring until the smaller drive is filled, but that just makes having mismatched sized drives pointless unless you have more than 2 drives.

Ii don't like how btrfs says the total size is 800 GB for a RAID1 setup. Even though my real (mirrored benefit) max size is 300 GB. How can I make it tell me the real max amount of data Ii can put on the filesystem (that will actually be mirrored)?

2

If I copy 50 GB onto the filesystem, it causes 100 GB to be used.

If I copy 300 GB onto the filesystem, it causes the smaller drive to be full

What about the extra 200 GB on the bigger drive? Does it still use that extra 200 GB, but just doesn't mirror it?

No, it doesn't. The result at that point is that the filesystem is full.

To allocate a new chunk, per the raid1 policy, it must allocate one chunk on each drive. That is not possible. Conclusion: ENOSPC No space left on device.

So if having mirrored data is important to my filesystem, should I create equal sized partitions even if Ii have mismatched sized drives?

It depends on what you want to do in the future and what you expect to do with the "extra" space on the second drive if you could use it.

If you plan or might plan to add a third drive to the array sometime, use the maximum size on each drive, because once you add the third drive, Btrfs will automatically become able to use the extra space.

If you have something better to do with the extra 200GB, you can always partition the 500GB drive to give 300GB to Btrfs and 200GB for something else (but of course whatever that something else is, it won't be redundantly stored).

I guess that in your case you should just leave each partition maximally sized (or even not use partitions at all) and look forward to when you will add a third disk and you will be able to use all that new free space.

Ii don't like how btrfs says the total size is 800 GB for a RAID1 setup. Even though my real (mirrored benefit) max size is 300 GB. How can I make it tell me the real max amount of data Ii can put on the filesystem (that will actually be mirrored)?

Estimating available size in Btrfs is not as easy as it sounds. There are all sorts of situations with differently-sized drives and different amounts of current usage that are difficult to predict. Moreover, multiple different policies can be in effect at the same time (one for data and one for metadata) and in that case the amount of effective available space would depend on how much future filesystem usage goes to metadata and how much goes to data. Rebalancing will also change (hopefully improve) the effective available space. Btrfs does its best.

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.