Setting up btrfs

Associate
Joined
28 Apr 2013
Posts
100
I've been playing around in an Arch VM trying to setup and understand btrfs. Seems like it can do a lot of useful things like zfs but it's baked into the kernel and so makes sense using it for root drive.

I've found a few guides and read through the arch wiki page but I don't quite get why things are the way they are.

Like what's all this __ volumes? Why does it need the __ ?
 
Hello again!

What don't you get?

You can name subvolumes anything you want. I know what you mean with the __, I've seen that a few times. Probably each guide copies the other. That might be from some btrfs snapshot management script and for some reason it needs the __ to work. I don't really know, and guess wasn't that bothered to find out!
 
I was working off this guide.

It seemed weird that there's the __ in front of everything, wasn't sure if that was required syntax or a setting which makes the subvolume do something.

Under the create a btrfs filesystem, it makes the __active and then under(?) that it makes the rootvol, home and var and says:

The reason for having rootvol on a dedicated subvolume is that it makes recovering from snapshots easier than if home and var were children of rootvol.

I don't understand why you'd do that?
 
At the top that author tries to explain the layout of subvolumes, and it's pretty much similar to directories and partitions. How you can have /, /var, /home, etc. all on different partitions.

The reason it's done this way is so that you can take snapshots of root, var, home etc. all separately. You might want more frequent snapshots of home than var for example. It just gives you great control.

Like you, I played around with btrfs in a vm for a while. Not actually got round to using it on my computer yet though. I found just by going through and doing it, it made more sense.

This site is good too. Maybe once you've done the basics go and read it.
 
I think I see. I'll keep going and see if that helps me understand. I presume also that the /mnt/defvol directory is just arbitrarily named too?

Thanks for the link I'll look at that guys blog posts and see what else there is.
 
Yes. The author is just naming it default volume, as that's what he called it.

That Marc blog, shows a similar subvolume structure but you'll see he names them differently. Again, the names don't matter it's just the layout.

That installation guide doesn't show much about grub or mkinitcpio hooks - I think the arch wiki details what's needed for grub and mkinitcpio with btrfs, but let me know if you get stuck.
 
I got it all working and it makes more sense now.

I feel like there are loads of things btrfs can do, does anyone have good guides or practices for using it?

I have a snapshot of my clean system
 
Marc's blog has some good scripts to automate snapshot stuff. Can't remember if it was there or not, but I saw someone made one whereby it took a system snapshot before upgrading packages. You could then roll back if something didn't work and you didn't have time to fix it.
 
Back
Top Bottom