Hits : 5161

btrfs[link1] notes:

Contents



SubVolume & SnapShot


Formatter "highlight/html" not found

top

mount a subvolume


# mount -t btrfs -o subvol=subvolume_name /dev/disk/by-uuid/a9b086df-d62b-40f7-bd05-4ff6911c3d24 /media/

# ls -la /media/
total 52
drwxr-xr-x  1 root root    18 Αύγ  11 23:37 .
drwxr-xr-x 19 root root  4096 Αύγ  11 11:00 ..
-rw-r--r--  1 root root 48104 Αύγ  11 23:37 dmesg.log


top

remove a disk


from a live mount point !

The btrfs is on UUID=a9b086df-d62b-40f7-bd05-4ff6911c3d24


Formatter "highlight/html" not found
on another shell:

# dmesg | tail

[ 3251.338634] btrfs: relocating block group 1671040073728 flags 9
[ 3292.008232] btrfs: found 14 extents
[ 3295.327223] btrfs: found 14 extents
[ 3295.990889] btrfs: relocating block group 1667818848256 flags 9

# df -h /mnt/data/
Filesystem      Size  Used Avail Use% Mounted on
/dev/dm-6       1,4T  550G  1,4T  30% /mnt/data


in the end 

# btrfs fi show

Label: 'data'  uuid: a9b086df-d62b-40f7-bd05-4ff6911c3d24
	Total devices 2 FS bytes used 547.53GB
	devid    1 size 931.51GB used 382.04GB path /dev/dm-6
	devid    3 size 233.76GB used 169.03GB path /dev/dm-5

Btrfs v0.20-rc1-253-g7854c8b


and

# df -h /mnt/data/
Filesystem      Size  Used Avail Use% Mounted on
/dev/dm-6       1,2T  549G  132G  81% /mnt/data


and 

# btrfs fi df /mnt/data/
Data, RAID0: total=336.00GB, used=334.03GB
Data: total=213.01GB, used=212.88GB
System, RAID1: total=32.00MB, used=56.00KB
System: total=4.00MB, used=0.00
Metadata, RAID1: total=1.00GB, used=628.14MB


top

add a new disk


before:

$ df
Filesystem                      1K-blocks      Used Available Use% Mounted on
/dev/mapper/western1T          1221875864 575344768 137364560  81% /mnt/data


adding:

# btrfs dev add /dev/mapper/western1Tb /mnt/data/



after:

$ df -h
Filesystem                      Size  Used Avail Use% Mounted on
/dev/mapper/western1T           2,1T  549G  1,2T  33% /mnt/data


top

balance the data between disks


eg. raid0 example

# btrfs balance /mnt/data
# btrfs balance resume /mnt/data
# btrfs balance pause /mnt/data


top




scrubbing the btrfs mount point



# btrfs scrub start /mnt/data/
scrub started on /mnt/data/, fsid a9b086df-d62b-40f7-bd05-4ff6911c3d24 (pid=12408)

# btrfs scrub status /mnt/data/
scrub status for a9b086df-d62b-40f7-bd05-4ff6911c3d24
        scrub started at Thu Dec  5 13:58:47 2013, running for 200 seconds
        total bytes scrubbed: 18.49GB with 0 errors


top





Links
[link1] https://btrfs.wiki.kernel.org