Skip to content

Instantly share code, notes, and snippets.

@hgn
Last active May 13, 2024 11:58
Show Gist options
  • Save hgn/fc997a2c7160e18a7aaa to your computer and use it in GitHub Desktop.
Save hgn/fc997a2c7160e18a7aaa to your computer and use it in GitHub Desktop.
sudo mount /dev/sda2 /
# mounting sda2 is boot time related via fstab:
# UUID=01e804ec-cc93-44c9-8b92-8fcd41c95aff / btrfs rw,relatime,space_cache 0 0
# now add sdb1 to /
sudo btrfs device add /dev/sdb1 /
sudo btrfs filesystem show
# Label: none uuid: 01e804ec-cc93-44c9-8b92-8fcd41c95aff
# Total devices 2 FS bytes used 8.42GiB
# devid 1 size 931.02GiB used 10.06GiB path /dev/sda2
# devid 2 size 931.51GiB used 0.00B path /dev/sdb1
sudo btrfs balance start -dconvert=raid1 -mconvert=raid1 /
# take some time
sudo btrfs filesystem show
# Label: none uuid: 01e804ec-cc93-44c9-8b92-8fcd41c95aff
# Total devices 2 FS bytes used 8.42GiB
# devid 1 size 931.02GiB used 4.06GiB path /dev/sda2
# devid 2 size 931.51GiB used 6.00GiB path /dev/sdb1
sudo btrfs filesystem df /
# Data, single: total=9.00GiB, used=8.30GiB
# System, DUP: total=32.00MiB, used=16.00KiB
# Metadata, DUP: total=512.00MiB, used=125.62MiB
# GlobalReserve, single: total=48.00MiB, used=0.00B
# To delete a device (which can take some "seconds"
btrfs device delete /dev/sdb1 /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment