BtrFS

From DailyWiki

(Redirected from Btrfs)
Jump to: navigation, search

Contents

Working with a (sub)volume

Create s simple BtrFS volume with label datavol:

$ sudo mkfs.btrfs -L 'datavol' /dev/sdb2

Create a subvolume home on volume datavol:

$ sudo mount /dev/sdb2 /mnt
$ sudo btrfs subvolume create /mnt/home
$ sudo umount /dev/sdb2

Modify /etc/fstab to mount the subvolume home from volume datavol on /home:

LABEL=datavol	/home	btrfs	defaults,subvol=home	0	0
LABEL=datavol	/media/brfs-datacol	btrfs	defaults,noauto,subvolid=0	0	0

Mount the new file system:

$ sudo mount -a

Working with a read-only snapshot

$ sudo btrfs subvolume snapshot -r home home\@`date "+%Y%M%d-%H%m%S-%Z"
$ sudo btrfs subvolume delete home@20124721-080109-CET

Working with a read-write snapshot

$ sudo btrfs subvolume snapshot  home home_clone
$ sudo btrfs subvolume delete home_clone

Scrubbing a (sub)volume

With Linux 3.0.0 scrubbing was introduced which allows for verifying that data on disk as can be done with ZFS.

Starting a scrub on /media/btrfs-datavol:

$ sudo btrfs scrub start /media/btrfs-datavol

The status of a scrub action:

$ sudo btrfs scrub status /media/btrfs-datavol
scrub status for afed6685-315d-4c4d-bac2-865388b28fd2
	scrub started at Sat Jan 14 15:11:58 2012, running for 106 seconds
	total bytes scrubbed: 5.77GB with 0 errors
...
$ sudo btrfs scrub status /media/btrfs-datavol
scrub status for afed6685-315d-4c4d-bac2-865388b28fd2
	scrub started at Sat Jan 14 15:11:58 2012 and finished after 11125 seconds
	total bytes scrubbed: 792.82GB with 0 errors

Cancel a running scrub:

$ sudo btrfs scrub cancel /media/btrfs-datavol

Resume a canceled scrub:

$ sudo btrfs scrub resume /media/btrfs-datavol

Documents

Personal tools
Google AdSense