You are not logged in.

#1 2014-01-14 00:51:23

cdysthe
Member
Registered: 2009-11-20
Posts: 62

Installation on a btrfs formatted disk.

HI,

On one of my laptops I want to install Arch on btrfs only and check out the features in this file system. I normally install with a / partition for the OS, some swap and the rest of the disk for /home. I like this layout but wonder how I should be doing it using btrfs which works with sub volumes. Since I am not completely famliar with how this works I would like to ask here how to formal the disk. Should I create one large btrfs partition and create sub volumes for / and /home? Or should I create / and /home as separate partitions? Some distro's like Ubuntu can now install on btrfs only so I assume I can get that to work for Arch also? Any advice on running btrfs only would be appreciated.

Offline

#2 2014-01-14 13:03:16

beta990
Member
Registered: 2011-07-10
Posts: 207

Re: Installation on a btrfs formatted disk.

I use btrfs myself and don't use any partition for /home. Also read the wiki about btrfs! Swap isn't supported!

Offline

#3 2014-01-14 15:29:22

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Installation on a btrfs formatted disk.

beta990 wrote:

I use btrfs myself and don't use any partition for /home. Also read the wiki about btrfs! Swap isn't supported!

You can make use of swap space, but only in a separate partition, not a swap file.

Offline

#4 2014-01-14 15:44:00

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Installation on a btrfs formatted disk.

@teateawhy, that is not actually entirely true.  You can use a swapfile, but it has to be through a loopback device.  This apparently degrades any potential performance (I have never actually tried this) and is not the recommended way to do things, but it *should* work.

@OP, I would say that rather than looking and relying on the Arch wiki in this case, you should look at the btrfs wiki itself.  Btrfs is still in pretty rapid development so it is hard to keep the Arch wiki up to date.

There are a number of forum users here who have btrfs set up in the way you describe (myself included).  Btrfs can treat any subvolume as its own mountable point of the overall filesystem.  There are a couple articles about how to use btrfs in the btrfs wiki's from page.  In particular, I found the articles by Margaret Bierman with Lenz Grimmer to be a good into.  The point at which I really grasped the use of btrfs as a volume manager was when I read the oracle documentation on btrfs use. 

Just keep reading through all the articles and tutorials, and it will start to make sense.  It really is a great filesystem and for me it has been pretty stable.  It is not without issues though and you should definitely have tested backups on hand.

Last edited by WonderWoofy (2014-01-14 15:44:17)

Offline

#5 2014-01-14 20:44:20

cdysthe
Member
Registered: 2009-11-20
Posts: 62

Re: Installation on a btrfs formatted disk.

beta990 wrote:

I use btrfs myself and don't use any partition for /home. Also read the wiki about btrfs! Swap isn't supported!

Do you use a subvolume for home? Traditionally I have kept a separate / partition so that I can easily reinstall the OS by cleaning /home only keeping my data and reinstall on /. Will I be able to do that is I run one large btrfs partition with a subvolume for /home?

Offline

#6 2014-01-14 22:49:49

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Installation on a btrfs formatted disk.

Yes you can do that.  But you should really go read the btrfs wiki.  My preference is to have all subvols off the root of the whole filesystem and then actually mount those with the 'subvol=' option.  That way, going back to a previous snapshot is much easier.  But you can nest subvolumes if you please.  I use nested subvols in my /home subvol so that I can prevent certain areas from being included in my snapshots (like ~/.cache).

Offline

#7 2014-01-14 23:35:08

cdysthe
Member
Registered: 2009-11-20
Posts: 62

Re: Installation on a btrfs formatted disk.

WonderWoofy wrote:

Yes you can do that.  But you should really go read the btrfs wiki.  My preference is to have all subvols off the root of the whole filesystem and then actually mount those with the 'subvol=' option.  That way, going back to a previous snapshot is much easier.  But you can nest subvolumes if you please.  I use nested subvols in my /home subvol so that I can prevent certain areas from being included in my snapshots (like ~/.cache).

Thank you. I have read most of the btrfs wiki but there's a lot that hasn't stuck yet. I would like to do the install and make sure I am not messing it up and have to do the disk layout again. I have created two paritions, one large btrfs paritions and swap. Listing subvolumes gives me:

sudo btrfs subvolume list -a /
ID 257 gen 62 top level 5 path <FS_TREE>/@
ID 258 gen 61 top level 5 path <FS_TREE>/@home

In /etc/fstab I have the following:

UUID=0eff8daf-5924-4a1f-922c-ec82ec594dc0 /               btrfs   defaults,subvol=@ 0       1
UUID=0eff8daf-5924-4a1f-922c-ec82ec594dc0 /home           btrfs   defaults,subvol=@home 0       2
UUID=babcf82e-ec47-4e02-b73a-8eed7b51908f none            swap    sw              0       0

Arch is up and running, but I would like to know if this is a setup I can keep and work with learning btrfs?

Offline

#8 2014-01-14 23:54:27

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Installation on a btrfs formatted disk.

That is the way in which I use btrfs.  So I think you're okay there.  You should set all the btrfs pass no's to zero though, as that is the priority in which the filesystems are fscked.  Since btrfs is not meant to be fscked, all those numbers in the last column should be 0.

I don't specify subvol=@ for the rootfs in the fstab either.  To me, it makes more sense to have this one part on the kernel command line.  So you would have 'rootflags=subvol=@' in your bootloader config.  That way, if you make a snapshot at /snap@2014-01-14 for example, you can change it to 'rootflags=subvol=snap@2014-01-14' and you will roll back to that snapshot.

Offline

Board footer

Powered by FluxBB