To test how simple it is to start with only one RAID disk I added two disk to a VM and did all needed steps there. From the starting point off the simple creation to starting the RAID.
To verify this, I created some files on the first disk and compared the hash of the files after the test.
1. create the file system with one disk
[root@centos ~]# mkfs.btrfs -L test_merge_HDs /dev/sdb
SMALL VOLUME: forcing mixed metadata/data groups
WARNING! - Btrfs v3.12 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using
Turning ON incompat feature 'mixed-bg': mixed data and metadata block groups
Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
Created a data/metadata chunk of size 8388608
fs created label test_merge_HDs on /dev/sdb
nodesize 4096 leafsize 4096 sectorsize 4096 size 500.00MiB
Btrfs v3.12
[root@centos /]# btrfs fi df /mnt/merge/
System, single: total=4.00MiB, used=4.00KiB
Data+Metadata, single: total=8.00MiB, used=28.00KiB
[root@centos /]# btrfs fi show
Label: test_merge_HDs uuid: b5aa052e-b44c-4e80-8e2b-3b7d04eb19e4
Total devices 1 FS bytes used 32.00KiB
devid 1 size 500.00MiB used 12.00MiB path /dev/sdb
Btrfs v3.12
2. add the second disk
[root@centos /]# btrfs device add /dev/sdc /mnt/merge/
SMALL VOLUME: forcing mixed metadata/data groups
[root@centos /]# btrfs fi df /mnt/merge/
System, single: total=4.00MiB, used=4.00KiB
Data+Metadata, single: total=8.00MiB, used=28.00KiB
[root@centos /]# btrfs fi show
Label: test_merge_HDs uuid: b5aa052e-b44c-4e80-8e2b-3b7d04eb19e4
Total devices 2 FS bytes used 32.00KiB
devid 1 size 500.00MiB used 12.00MiB path /dev/sdb
devid 2 size 500.00MiB used 0.00 path /dev/sdc
Btrfs v3.12
3. start the RAID
[root@centos /]# btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/merge/
Done, had to relocate 2 out of 2 chunks
[root@centos /]# btrfs fi df /mnt/merge/
System, RAID1: total=32.00MiB, used=4.00KiB
Data+Metadata, RAID1: total=112.00MiB, used=100.00KiB
[root@centos /]# btrfs fi show
Label: test_merge_HDs uuid: b5aa052e-b44c-4e80-8e2b-3b7d04eb19e4
Total devices 2 FS bytes used 104.00KiB
devid 1 size 500.00MiB used 144.00MiB path /dev/sdb
devid 2 size 500.00MiB used 144.00MiB path /dev/sdc
Btrfs v3.12
Keine Kommentare:
Kommentar veröffentlichen