Table of Contents
What are BTRFs?
BTRFs or, alternatively, B-Tree Filesystem is a copy-on-write (CoW) filesystem. Standard filesystem operations include features such as defragmentation, label setting, label getting, space stats, as well as resizing. The BTRFs filesystem includes all the regular features of a standard filesystem as well as the ability to perform whole filesystem level tasks.
Thus, the btrfs filesystem includes many advanced filesystem features. The focus of this filesystem is to allow for easy administration and repair while also focusing on fault tolerance.
How to use BTRFs on Synology NAS?
The BTRFs filesystem is supported by Synology on all of their NAS devices. Entire shared folders can be easily and quickly copied as BTRFs are copy-on-write filesystems. BTRFs snapshots do not impact on the performance of the filesystem as they do not take up a lot of disc space. The btrfs filesystem is able to quickly recover data in the event of hard drive failure or damage. This is because the BTRFs filesystem maintains two copies of the filesystem metadata.
The filesystem allows users to take an instant snapshot of an entire shared folder. In the event that important files or folders are removed from a shared folder, the BTRFs filesystem will easily be able to recover these files or folders by recovering the previous state of the snapshot. Creating shared folders on a BTRFs volume means that the user is able to limit the amount of storage space that a shared folder uses.
The File Station app and/or Windows File Explorer allow users to view earlier states, as well as restore earlier states or versions of files. Filesystem errors are quickly identified and steps are automatically implemented to recover corrupted files. This is achieved through checksums that are provided for the data and metadata, which are verified each time the data or metadata is accessed. Frequent and scheduled backups can be set and performed automatically. Users are also able to configure the number of snapshots for each shared folder. This means that only the most recent copies are kept on file.
How to create a BTRFs volume in Synology
- Go to DSM Storage Manager
- Go to Volume
- Go to Create
- Go to Create Volume
- Select Quick or Custom
- Click Next
- Select your storage pool and click Next
- Allocate the volume and click Next
- Select the BTRFs file system and click Next
- Confirm and click Apply
How to install and create a BTRFs filesystem?
According to Thegeekdiary.com, the mkfs.btrfs command can be used to create a s filesystem. The BTRFs filesystem can be created on either a single device or multiple devices. There are four types of devices, including loop-back devices, LUNs that implement RAID in hardware, disc partitions, or multipath devices. Furthermore, Thegeekdiary.com highlights several instructions for creating a BTRFs filesystem:
Step 1: Input the following for a single block device:
# mkfs.btrfs /dev/sdb
Step 2: Input the following for two block devices:
# mkfs.btrfs /dev/sdb /dev/sdc
Step 3: Input the following for multiple devices where the data and metadata are striped:
# mkfs.btrfs –m raid0 /dev/sdb /dev/sdc
Step 4: Input the following multiple devices where the data and metadata are mirrored:
# mkfs.btrfs –d raid1 /dev/sdb /dev/sdc
Step 5: Input the following to create a BTRFs filesystem for a single device and instruct that the metadata should not be duplicated:
# mkfs.btrfs –m single /dev/sdb
Step 6: Input the following for RAID data and metadata:
# mkfs.btrfs –d raid10 –m raid10 /dev/sd[bcde]
What are the benefits of Synology’s BTRFs?
Synology.com states that the following are the benefits of a BTRFs filesystem:
- It offers sufficient drive storage space
- The data is consistently backed up
- Entire shared folders can be duplicated
- Storage limits can be set for shared folders
- The system offers snapshots and protection of data
- The filesystem takes up little disc storage space
- Users are able to manually restore older versions of snapshot
- Snapshots can be taken instantaneously of entire shared folders
- The system features a customizable retention policy that updates files and discards older files that are no longer needed
- Metadata can be mirrored while more data is available
- Checksums are available for data and metadata
What are the cons of BTRFs?
While there are many advantages to the advanced features offered by the BTRFs filesystem, there are also a few disadvantages. Larger files can easily become fragmented. This requires frequent defragmentation. In addition, certain features on the filesystem may or have been considered experimental.
How do BTRFs protect your data?
The BTRFs filesystem has a feature that provides checksums for data and metadata. The filesystem will create two copies of the metadata. The checksums are verified with each reading process. Mirrored metadata allows the BTRFs system to identify corrupt files and proceed to recover broken data through the supported RAID systems. IBM states that in order to protect the data, it must be backed up. The BTRFs filesystem can be included in specifications for restore and backup commands, retrieval and archive commands, as well as in restore and backup images.
Should I go for BTRFs or ext4?
This will depend on personal preference. BTRFs are fast growing but, at the same time, are considered not as stable as ext4, which is currently the default system. In addition, ext4 is much faster than BTRFs at transferring files.
Other interesting articles: