I mainly refer to ArchWiki and btrfs Wiki. did.
Please install btrfs-progs.
Use the mkfs.btrfs command to create the file system. The only required argument is the partition, but you can set the label by using the -L option.
# mkfs.btrfs -L mylabel /dev/partition
The -m option specifies the meta RAID mode and the -d option specifies the data RAID mode.
# mkfs.btrfs -m raid1 -d raid1 /dev/sda /dev/sdb
Edit / etc / fstab to set mount options and mount with mount -a.
/etc/fstab
UUID={uuid} /data btrfs noatime,compress-force=lzo,space_cache 0 0
| Option | Description |
|---|---|
| noatime | Does not record the last access date and time. The purpose is to improve performance. |
| compress-force | Use the transparent compression function unless the file size increases. |
| space_cache | Enable free space cache. |
Here are some ways to verify that RAID is actually working:
# btrfs filesystem df /data
Data, RAID1: total=1.00GiB, used=512.00KiB
System, RAID1: total=8.00MiB, used=16.00KiB
Metadata, RAID1: total=1.00GiB, used=112.00KiB
GlobalReserve, single: total=3.25MiB, used=0.00B
# btrfs filesystem show /data
Label: {label} uuid: {uuid}
Total devices 2 FS bytes used 640.00KiB
devid 1 size 1.82TiB used 2.01GiB path /dev/sda
devid 2 size 1.82TiB used 2.01GiB path /dev/sdb
Recommended Posts