Btrfs Filesystem /etc/fstab Entry To Mount It Automatically At Linux System Startup
I‘ve RAID-1 based btrfs store backups on my person system and how do I mount a multi-volume btrfs filesystem using /etc/fstab file when my Linux server comes online?
[donotprint][/donotprint]The file /etc/fstab contains descriptive information about the various file system on a Linux or Unix-like system. It is the duty of the system administrator to properly create and maintain this file. This is also useful if you don’t have an initrd or your initrd does not scan for a btrfs device on boot. In this tutorial you will learn how to mount a btrfs device using /etc/fstab.
How to format hard disk as a btrfs device?
Warning: mkfs.btrfs command destroy the data and replace the file system with a new one on existing disk. Be careful with the device names. It cannot be stressed enough how important it is to make a backup of your system before you do this.
The syntax is: # mkfs.btrfs /dev/sdb To create RAID-1 of /dev/sda and /dev/sdb, enter (no need to create partitions): # mkfs.btrfs -d raid1 -m raid1 /dev/sda /dev/sdb
Finding information about your btrfs device
You can see the btrfs filesystem with info with the following command: # btrfs filesystem show /mount/point/ # btrfs filesystem show /dev/DEVICE # btrfs filesystem show /dev/sda # btrfs filesystem show
So, I’ve two devices /dev/sda and /dev/sdb. You can use any one of the device to mount btrfs. If your btrfs device mounted at /data/, enter: # btrfs filesystem df /data/ Sample outputs:
The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.