User Tools

Site Tools


general:linux:btrfs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
general:linux:btrfs [2022/05/11 15:06] – created sunkangeneral:linux:btrfs [2022/05/11 16:33] (current) sunkan
Line 4: Line 4:
 Use RAID1 and choose stronger checksum XXHASH64 Use RAID1 and choose stronger checksum XXHASH64
 <code> <code>
-root@lotr:~# mkfs.btrfs -d raid1 -L lotr --checksum xxhash /dev/sda /dev/sdb+root@lotr:~# mkfs.btrfs -d raid1 -L btrfs_lotr --checksum xxhash /dev/sda /dev/sdb
 </code> </code>
  
 +fstab like so
 +<code>
 +UUID=<the_uuid> /btrfs_root btrfs defaults,noatime 0       0
 +</code>
  
 +Installed btrfsmaintenance package and edited /etc/default/btrfsmaintenance since we are not mounted at /
 +<code>
 +BTRFS_BALANCE_MOUNTPOINTS="/btrfs_root"
 +BTRFS_SCRUB_MOUNTPOINTS="/btrfs_root"
 +BTRFS_TRIM_MOUNTPOINTS="/btrfs_root"
 +</code>
 +
 +Enabled these timers
 +<code>
 +systemctl enable btrfs-balance.timer
 +systemctl enable btrfs-scrub.timer
 +</code>
 +
 +And refreshed the configuration (unsure if it is needed or a reboot does the same)
 +<code>
 +systemctl restart btrfsmaintenance-refresh.service
 +</code>
 +
 +Verified that timers were added to systemd
 +<code>
 +root@lotr:~# systemctl -t timer list-units 'btrfs*'
 +  UNIT                LOAD   ACTIVE SUB     DESCRIPTION
 +  btrfs-balance.timer loaded active waiting Balance block groups on a btrfs filesystem
 +  btrfs-scrub.timer   loaded active waiting Scrub btrfs filesystem, verify block checksums
 +</code>
 +
 +Create subvolume for imagelib
 +<code>
 +btrfs su create /btrfs_root/imagelib
 +</code>
 +
 +Setup fstab to mount subvolume separate from btrfs_root
 +<code>
 +UUID=<the_uuid> /imagelib btrfs defaults,noatime,subvol=imagelib 0       0
 +</code>
general/linux/btrfs.1652281580.txt.gz · Last modified: 2022/05/11 15:06 by sunkan

Donate Powered by PHP Valid HTML5 Valid CSS Run on Debian Driven by DokuWiki