Saturday, April 20, 2024
 Popular · Latest · Hot · Upcoming
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 13180  / 2 Years ago, sun, september 11, 2022, 4:09:57

I've install Ubuntu 11.10 with btrfs as the / file system (was a bit of a mess to do, I'll explain if people are interested) so I can expand the primary file system into the second drive on the system(*).



After installing the system, I ran btrfs device add /dev/sdb1 / and it added the new device and expanded the file system on to it, and all was good. But according to the (wrong) manual I was reading, I also had to run btrfs filesystem balance and this apparently converted my filesystem to "raid1" mode so everything is stored redundantly twice - once on each drive, and I can only use 50% of my total capacity:



$ btrfs filesystem df /
Data, RAID0: total=78.00GB, used=41.57GB
System, RAID1: total=8.00MB, used=16.00KB
System: total=4.00MB, used=0.00
Metadata, RAID1: total=3.75GB, used=355.06MB


Its a nice feature, but I was kind of wanting to use "raid0" (stripping). I've tried to remove the new device so I can re-add it, but when I try that I get an error and syslog has this:



btrfs: unable to go below two devices on raid1


So my question is: how can I convert my filesystem back to raid0 so I can use the total space of both disks?



(*) Like can be done with LVM, but with btrfs you can host multiple "partitions" on the same "file system" and space is allocated dynamically where you need it - unlike in LVM.


More From » raid

 Answers
2

btrfs balance start -dconvert=raid0 /



That's all you need to do. The system will busily move the existing data around to be raid0 (striped, no parity) and any further data will be written that way as well.



METAdata will still be written in duplicate. If you want to live EXTRA SUPER dangerously, feel free to tack on an -mconvert raid0 argument into the above command as well, then both data AND metadata on the array at / will be converted to raid0.


[#41648] Monday, September 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atelti

Total Points: 194
Total Questions: 129
Total Answers: 110

Location: North Korea
Member since Tue, Jun 16, 2020
4 Years ago
;