btrfs¶
check and scrub btrfs filesystem¶
scrub¶
this just checks checksums of the data, it does not repair a filesystem
start the process:
check the status:
check¶
should be done on a readonly or not mounted filesystem, however it can be run on a mounted filesystem as well, with the --readonly and --force flag you can make sure that nothing will be modified:
create btrfs filesystem and partition¶
parted -s /dev/nvme1n1 mklabel gpt
parted -s /dev/nvme1n1 mkpart primary 1MiB 100%
partprobe /dev/nvme1n1
sgdisk --typecode=1:8300 /dev/nvme1n1
mkfs.btrfs -L data /dev/nvme1n1p1
resizing btrfs filesystems¶
to max:
by gb:
managing btrfs snapshots¶
you should use them more often, perhaps in combination with a a backup tool
snapshot utilities¶
- snapper - automatically create snapshots based on a configuration
- snap-sync - send snapshots to a target destination, another disk locally, ssh etc.
list snapshots¶
get more information about a snapshot¶
create a read only snapshot¶
sudo btrfs subvolume snapshot / /my_snapshot # root partition
sudo btrfs subvolume snapshot /mnt /mnt/my_snapshot # partition mounted at /mnt
delete btrfs snapshot¶
btrfs raid configuration¶
convert raid levels, from raid0 to raid1¶
raid1¶
with kernel version 5.5+ raid1c3 can be used for the metadata (-m)