How to partition disk with btrfs?

Hey guys. Tomorrow i’m having a one-person install party as a gift for myself (some khaki fruit, a cup of winter tea and openSUSE 13.2 :slight_smile: ) and i have a question. I’d like to use btrfs, but not sure how to partition. If i understood correctly, it doesn’t use volumes, but subvolumes, so basically there’s one unit for / and /home? And the partitioner lets me change the size of a selected subvolume as much as i like? So i basically create a:

sda
|
|----/ (30GB, for example)
|
|----/home (Rest of the HDD)

?

Do i have to create a swap volume on btrfs?

Thank you!

P.S.: on ext3 and ext4, i usually did a ‘classic’ /,/home and swap partitioning scheme, coming out sda1, sda2 & sda3…

Thanks for your help guys.

On 2014-11-05 14:26, holden87 wrote:
>
> Hey guys. Tomorrow i’m having a one-person install party as a gift for
> myself (some khaki fruit, a cup of winter tea and openSUSE 13.2 :slight_smile: ) and
> i have a question. I’d like to use btrfs, but not sure how to partition.
> If i understood correctly, it doesn’t use volumes, but subvolumes, so
> basically there’s one unit for / and /home?

My gut feeling is, that if you want to use btrfs for system and home,
you dont’ make any partition at all. A single one for btrfs, and let
YaST apply subvolumes to it all. I expect the sizes to shuffle and
adjust as needed. Dunno.

I don’t know how to handle subvolumes and how to do fresh installs on
it, and keeping home.

The defaults are btrfs for system and xfs for home, though.

> Do i have to create a swap volume on btrfs?

I expect outside, on another partition.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On Wed 05 Nov 2014 01:26:01 PM CST, holden87 wrote:

Hey guys. Tomorrow i’m having a one-person install party as a gift for
myself (some khaki fruit, a cup of winter tea and openSUSE 13.2 :slight_smile: ) and
i have a question. I’d like to use btrfs, but not sure how to partition.
If i understood correctly, it doesn’t use volumes, but subvolumes, so
basically there’s one unit for / and /home? And the partitioner lets me
change the size of a selected subvolume as much as i like? So i
basically create a:

sda
|
|----/ (30GB, for example)
|
|----/home (Rest of the HDD)

?

Do i have to create a swap volume on btrfs?

Thank you!

P.S.: on ext3 and ext4, i usually did a ‘classic’ /,/home and swap
partitioning scheme, coming out sda1, sda2 & sda3…

Thanks for your help guys.

Hi
You only really need to use btrfs for / the rest as you see fit, xfs,
ext4 etc. Is this mbr or gpt/uefi system?

There is nothing different in the partitioning scheme for the install.

Here is a btrfs system (mbr/bios)


lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 119.2G  0 disk
├─sda1   8:1    0   512M  0 part /boot (ext4)
├─sda2   8:2    0    40G  0 part / (btrfs)
├─sda3   8:3    0  70.8G  0 part /data (ext4)
└─sda4   8:4    0     8G  0 part [SWAP]

Here is a btrfs system (gpt/uefi)


lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk
├─sda1   8:1    0   260M  0 part /boot/efi (fat)
├─sda2   8:2    0    40G  0 part / (btrfs)
├─sda3   8:3    0  63.5G  0 part /data (xfs)
└─sda4   8:4    0     8G  0 part [SWAP]

I don’t use a separate /home all part of / and automatically excluded
from snapshots. So my /data could be your /home.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.28-4-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

On 2014-11-05 14:46, malcolmlewis wrote:

> Hi
> You only really need to use btrfs for / the rest as you see fit, xfs,
> ext4 etc. Is this mbr or gpt/uefi system?

You /need/ btrfs nowhere. You /may/ place it anywhere. :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Hey.

It’s a mbr system. So i basically check out the default, modify the sizes, and that’s it?

  • Will it be a problem if i use btrfs for my /home?

regards geekos, tomorrow’s a big day, can’t wait :slight_smile:

Hi
Well I always use the expert partitioner and rescan the device before setting up the partitions, or predefine them using the rescue cd.

Using btrfs on /home, I personally wouldn’t, unless I was wanting to take advantage of the snapper tools. I’m sure there will be someone mentioning the possibility of corrupting a btrfs partition with lots of small file writes. I’m using XFS and ext4 here.

About the same here. Unless I want to make changes to the partitioning / filesystems, I use the “Import” function. BTW. I did some testing with btrfs on /home. to me it seemed KDE was slower, specially after akonadi’s start.

IMO you should have a separate home partition with what ever format you like it is simply the safer way to go for future proofing the system. Keep your data and the system data separate. Note that BTRFS uses snapper by default so you should allow at least 50% more space then you would normally. ie if you use 20 gig root normally set it to 30 gig. for the snapshots I don’t think the installer is taking this calculation into account so do it manually if need be.

Also recommend a separate ext2/4 boot partition of at least 500 meg. The problem is that grub does not know how to write to BTRFS so there is some thingas that can cause you grief at some point. A separate boot will fix the problems.

… since you didn’t invite me to the party, I’m not even going to respond.:cry:

… okay, okay, okay!

Enough twisting my arm, already. I will set aside a machine to start testing and getting familiar with BTRFS.

You happy now?:sarcastic:

Kidding aside, that is a very usefull little illustration, Malcolm, that should demystify things for a lot of people here. Good on you, and thanks.

I seem to recall recommendations somewhere of using a minimum 40-G for the root partition if using BTRFS.

Also recommend a separate ext2/4 boot partition of at least 500 meg. The problem is that grub does not know how to write to BTRFS so there is some thingas that can cause you grief at some point. A separate boot will fix the problems.

This also seems, from numerous threads here, to be a wise choice, and from another post by wolfi, he suggests ext2 is the best choice for that, IIRC.

On Thu 06 Nov 2014 12:36:02 AM CST, Fraser Bell wrote:

… okay, okay, okay!

Enough twisting my arm, already. I will set aside a machine to start
testing and getting familiar with BTRFS.

You happy now?:sarcastic:

Kidding aside, that is a very usefull little illustration, Malcolm, that
should demystify things for a lot of people here. Good on you, and
thanks.

Hi
LOL, I have three more…lets make it complete :wink:

Windows Preview and openSUSE 13.2 (gpt/uefi/secure boot)


lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk
├─sda1   8:1    0   300M  0 part (windows recovery?)
├─sda2   8:2    0   260M  0 part /boot/efi (fat) [win pre and openSUSE]
├─sda3   8:3    0   128M  0 part (windows msr)
├─sda4   8:4    0    40G  0 part / (btrfs) [openSUSE 13.2]
├─sda5   8:5    0   160G  0 part /data (ext4)
├─sda6   8:6    0     8G  0 part [SWAP]
└─sda7   8:7    0  89.4G  0 part (ntfs) [windows preview]

This is Windows 7 and SLED 12 (gpt/uefi)


lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk
├─sda1   8:1    0   260M  0 part /boot/efi (fat) [windows 7 and SLED]
├─sda2   8:2    0   128M  0 part (windows msr)
├─sda3   8:3    0    40G  0 part / (btrfs) [SLED 12]
├─sda4   8:4    0   160G  0 part /data (xfs)
├─sda5   8:5    0     8G  0 part [SWAP]
└─sda6   8:6    0  89.7G  0 part (ntfs) [windows 7]

This is SLES 12 (gpt/uefi/secure boot)


lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 596.2G  0 disk
├─sda1   8:1    0   260M  0 part /boot/efi (fat)
├─sda2   8:2    0    40G  0 part / (btrfs)
├─sda3   8:3    0    12G  0 part [SWAP]
└─sda4   8:4    0 543.9G  0 part /data (xfs)

Now that I have 13.2 up and running on a laptop, the first example will
change will still be similar but do plan to add some additional disks
for raid(lvm?) and use part of the ssd for bcache, but the / file system
will be btrfs with openSUSE 13.2.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.28-4-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Thanks for the additional … appreciated.

Thank you guys!

On 2014-11-06 01:36, Fraser Bell wrote:
> This also seems, from numerous threads here, to be a wise choice, and
> from another post by wolfi, he suggests ext2 is the best choice for
> that, IIRC.

I do as well.

The reasoning is that you do not need a log on a small partition, where
space is needed; and being most of the time a partition that is not
written to, a log is not big benefit. On the contrary, as during return
from hibernation the log has to be played in memory, it takes some time
to process (like an fsck in ram every single hibernation cycle). This is
specially noticeable with boot on reiserfs and grub2, takes minutes.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)