|
btrfs is probably one of those things that has potential to do a lot of changes in how things will be handled and fortunately is also one of those things you want to get yourself familiar with.
Good news is the it's very easy to learn and it combines a lot of stuff (RAID, LVM) which before required some ambition to master.
Quick getting started
Conversion
You don't need to format a partition to make it btrfs. You can just convert your ext filesystem to btrfs and keep all the data. The btrfs-convert tool will create the required b-trees in the free space and after the process is done all you have to do is mount the file system as btrfs. If something doesn't cut it for you, you can also restore to your original ext file system :)
Subvolumes
Subvolumes are like empty directories inside the filesystem, but you can mount them. They don't assign a fixed amount of space from start and basically resize in the fly, depending on what you put in them (just like directories). Fancy name, simple concept :) . To create a subvolume just do "btrfs subvolume create home_subvolume" and when you want to mount it, just do "mount -t btrfs -o subvol=home_subvolume /dev/sda /home". Obviously, if you want to delete "btrfs subvolume delete home_subvolume" is all you need to do.
Snapshot
The snapshot is a special kind of subvolume. In my opinion this is one of the coolest feature of the filesystem because it can ca "freeze" the state of you filesystem to a moment in time while using the minimum amount of space. The snapshot doesn't duplicate the data. From this point in time, only the files that change will use additional space on the filesystem because the original one is kept in the snapshot. The syntax for creating a snapshot is something like this "btrfs subvolume snapshot /home /mnt/backups/2010-10-20". Of course you can mount a snapshot just as you would with a subvolume and visit your files back in time.
RAID
With Btrfs, for creating a RAID array you don't need any special tool. You just have to specify the disks you want to put in the array when creating the filesystem and you're all set. Something like "mkfs.btrfs /dev/sda /dev/sdb /dev/sdc" is all you have to do to create an array with 3 disks. By default btrfs will have the data stripped (raid 0) and the metadata mirrored (raid 1). Parameters such as -d and -m will allow you to choose what kind of raid you want for your data and respectively metadata.
Fsck
With btrfs it is possible to do online checking, which is very cool and if you can do the fsck it's supposed to be very fast. This feature doesn't get me that excited because the important thing is you shouldn't really need it.
|