You are not logged in.

#1 2014-08-11 11:29:22

frednet
Member
Registered: 2014-08-11
Posts: 1

Btrfs only confusion

I'm trying to install Arch on my old computer which is BIOS based and I've been going round in circles trying to work out how to install it on a BTRFS only system. Various Wiki pages seem to contradict each other, some say BTRFS doesn't need GRUB, some says it does, some say it can support swap, some say it can't, I'm utterly confused and so are the Wiki pages! I don't use hibernate so don't need swap any way, I assume I need to use GPT but do I need to leave a partition for grub?
Can anyone explain the basic steps necessary for a single BTRFS / partition on an old BIOS PC with a SSD hard drive?

Thanks to anyone who can explain it to me!

Offline

#2 2014-08-11 13:13:12

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Btrfs only confusion

The current verson of GRUB does support btrfs (thus you don't need a separate /boot partition using a different filesystem), btrfs does not support swap files directly (you need to have a swap partition if you want to hibernate, you can use a loop device for a swap file on btrfs, with worse performance than a regular swap file).

You can e.g. use GRUB and have a single btrfs filesystem on a single partition with subvolumes mounted at / and /home.

-edit-

Instead of using a single partition, you can simply use the whole disk and forget about partitioning. I myself have a swap partition and a btrfs partition.

Last edited by lucke (2014-08-11 13:27:51)

Offline

#3 2014-08-11 22:05:50

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: Btrfs only confusion

As lucke says it works fine with grub.

Here's my /etc/fstab for a four disk raid1 btrfs setup all combined together on root:

# 
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
/dev/sda        /       btrfs   rw,autodefrag,compress=lzo,noatime,thread_pool=16       00

Very easy. smile  Btrfs does much of the work after you properly prepare the devices.  They are scanned for upon boot (you will see a message stating this on boot).  Thread_pool=16 is because I have 4 cores and this seemed to help with I/O in an earlier version. YMMV.

Then I also use a loopback swap file.  I found it helpful on my 6 GB system to prevent OOM conditions.  But you can worry about the swap later after you get other things set-up first.  That is what I did.

Last edited by davidm (2014-08-11 22:07:18)

Offline

#4 2014-08-15 04:12:21

grandtheftjiujitsu
Member
Registered: 2013-07-27
Posts: 91

Re: Btrfs only confusion

Both the Grub wiki page and the BTRFS wiki page indicate that you do NOT need separate /boot partition nor a any kind of partitioning (MBR or GPT).  In addition to what's already been said you'll skip the partitioning phase of the installation and get straight to...

 mkfs.btrfs /dev/sdX

rather than

 mkfs.btrfs /dev/sdaX

That is, install to the device (/dev/sdX) rather than the partition (/dev/sdaX).  Then, install your bootloader like normal

 grub-install /dev/sdX 

Basically it comes down to your needs / requirements.  If you don't have any qualms about (for example) booting via BIOS (opposed to UEFI) than I don't see any issue.  Exceptions may of course apply if you're wanting to dual boot or are partial to a particular bootloader (formerly Syslinux didn't play nice with BTRFS).

Offline

#5 2014-08-19 07:51:47

mrshannon
Member
Registered: 2014-06-06
Posts: 6

Re: Btrfs only confusion

I currently run with / on a partitionless btrfs SSD drive.  That means using mkfs.btrfs on the drive instead of a partition which means MBR/GPT is a moot point but a standard grub install will be needed.  I don't have any swap and have yet to run into issues (even though my data drives are using the memory hungry ZFS filesystem), but I do have 16GB of ram and this install is only a few weeks old.  If you have low ram or want to hibernate I suggest either using 2 partitions: swap and btrfs root (I run a couple machines setup this way), or a loopback swap (never tried this).

One thing I have noticed is that I cannot use Clonezilla on my system drive.  I don't know if this is due to my partitionless btrfs drive as I haven't taken the time to debug the problem but I thought I ought to mention it.

One more thing, if you decide to use one or more actual partitions then you don't have to use GPT which requires a special grub partition on BIOS systems.  Since you are using a drive that is less than 2TB you could stick with MBR partitioning for simplicity.  The main reasons I know of for using GPT are:

  • System is UEFI

  • Drive is larger than 2TB

  • You need more than 4 non-logical partitions.

Last edited by mrshannon (2014-08-19 07:52:18)

Offline

#6 2014-08-19 08:28:37

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: Btrfs only confusion

frednet wrote:

[...]
Various Wiki pages seem to contradict each other, some say BTRFS doesn't need GRUB, some says it does, some say it can support swap, some say it can't, I'm utterly confused and so are the Wiki pages!
[...]

Which wiki-pages contradict the statement that grub+btrfs works fine (as confirmed by others)? If you list those pages someone (possibly even you) can update them

Offline

#7 2014-08-19 08:40:40

headkase
Member
Registered: 2011-12-06
Posts: 1,981

Re: Btrfs only confusion

As a caution you should be aware that Btrfs isn't considered production ready yet:

https://bbs.archlinux.org/viewtopic.php?id=182505

Which may influence choosing a more mature file-system such as tried and true ext4.

Offline

Board footer

Powered by FluxBB