Gentoo Archives: gentoo-user

From: Marc Joliet <marcec@×××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] planned btrfs conversion: questions
Date: Tue, 06 May 2014 10:18:51
Message-Id: 20140506121832.678ae781@marcec
Hi all,

I've become increasingly motivated to convert to btrfs.  From what I've seen,
it has become increasingly stable; enough so that it is apparently supposed to
become the default FS on OpenSuse in 13.2.

I am motivated by various reasons:

- The experience of insignificant data loss after a reboot after no
  (visible) problems during normal operations (no similar occurrence since). I
  suspect this would have been discovered sooner by btrfs' data checksumming.

  While the data lost was of a small amount, not to mention insignificant
  (internet pictures) and could be retrieved again easily, I worry that this
  sort of silent corruption might happen to data that I *do* care about. My
  backups would become less than useless if I were to discover such corruption
  too late.

- The outright sexy multiple device support :) .

This migration will occur in conjunction with a migration of / + /usr to a
cheap SSD that I just bought (Crucial M500 120 GB). The overall plan is thus as
follows:

Replace

	/boot on /dev/md1 (EXT3, RAID 1)
	/ (with assorted sub-directories, sans /usr) on /dev/md2 (EXT4, RAID 10)
	the rest on LVM on /dev/md3 (all LVs EXT4, RAID 10)

with

	/ + /boot + /usr + swapfile on the SSD (EXT4)
	the rest (/home, my media partitions) on a btrfs RAID 10

(which replaces an older plan to recreate the RAID 10 + LVM to use the whole
disks with the current 1.2 metadata format)

The goals are, in addition to alleviating my data safety concerns above, to
guarantee that I don't need an initramfs at boot (hence the SSD), and to
greatly simplify my partitioning scheme (I just have too many separate logical
volumes ;-) ). Any added performance is "just" a nice bonus.

The reason why I would choose EXT4 for the SSD is that btrfs still lacks support
for swap files and I worry about creating a swap partition on the SSD. Is that
warranted, or will the wear-levelling of the SSD handle that just fine? Do swap
partitions support SSDs specially? Also, does anyone know whether EXT4 goes
beyond "merely" supporting TRIM? That is, the btrfs wiki advertises the
following:

  "SSD (Flash storage) awareness (TRIM/Discard for reporting free blocks for
  reuse) and optimizations (e.g. avoiding unnecessary seek optimizations,
  sending writes in clusters, even if they are from unrelated files. This
  results in larger write operations and faster write throughput)"

Does EXT4 also implement such optimisations for SSDs?

So I guess I want to know: does anybody have any further suggestions to make?
Is btrfs a good choice for / after all? And should I be using the most recent
kernel versions? (I would go with no, despite the advice from upstream, because
the changes in the last two versions don't seem to be particularly user
visible, at least to me, from reading kernelnewbies.org.)

I also have a more specific question regarding RAID 10: the btrfs wiki says
that you can add devices with different sizes to a multiple device setup, but I
don't think it says to which RAID levels this applies and how. From [0] I would
say it works with RAID 10 (since that's what the example uses), but thought
maybe somebody here knows more details and/or gotchas. From my understanding,
this means that I can iteratively upgrade my RAID 10 to larger drives and have
btrfs use all of the available space (or at least as much as is possible). This
is important to me because I currently have 4 320 GB HDDs + 1 (possibly broken,
must check) spare and wish to be able to upgrade without having to buy four
HDDs at once.

Now to the migration plan: first, partition the SSD and copy all relevant file
systems to it; this will be done from a Live-CD (SystemRescueCD). After I have
configured the mount options appropriately and can boot from that, I should be
able to mount the other file systems (/home and my media partitions) read-only
from the actual system and do the RAID + LVM -> btrfs migration from there.

Note that I will in general follow the advice from [1-3], and if people
recommend btrfs on /, then I will also try to get relevant information from [4].

[0]
https://btrfs.wiki.kernel.org/index.php/SysadminGuide#RAID_and_data_replication
[1] https://wiki.archlinux.org/index.php/Solid_State_Drives
[2] https://wiki.archlinux.org/index.php/Btrfs
[3] http://wiki.gentoo.org/wiki/Btrfs
[4] http://wiki.gentoo.org/wiki/Btrfs_system_root

Greetings and thanks in advance for any help given
-- 
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-user] Re: planned btrfs conversion: questions James <wireless@×××××××××××.com>
Re: [gentoo-user] planned btrfs conversion: questions Marc Joliet <marcec@×××.de>
Re: [gentoo-user] planned btrfs conversion: questions William Kenworthy <billk@×××××××××.au>
[gentoo-user] Re: planned btrfs conversion: questions Jonathan Callen <jcallen@g.o>
[gentoo-user] experience thus far (was: planned btrfs conversion: questions) Marc Joliet <marcec@×××.de>