HOWTO: btrfs Mint 17 with raid1 ssd, gpt for UEFI

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
fraze
Level 1
Level 1
Posts: 19
Joined: Sat Jun 30, 2012 7:16 pm

HOWTO: btrfs Mint 17 with raid1 ssd, gpt for UEFI

Post by fraze »

Hi all,
Having just won against the Mint 17 installer I thought I'd share my joy with you all in case it saves somebody hours of fiddling and frustration.

My use case: two SSDs, raid1, on BTRFS. The computer has UEFI and I chose that instead of legacy bios. I did install using this same process on a bios computer and most of the steps are identical except for the partitioning.

I've been using mirrored btrfs on Mint 16 without any issues and it's been great so far.

---------------

Ctrl-Alt-T (opens Terminal)
$ sudo -i
# apt-get install btrfs-tools
# gparted

In GParted, create partitions on /dev/sda:
/dev/sda1 512 MiB cleared (eventually EFI boot)
/dev/sda2 15000 MiB cleared (eventually root fs)
/dev/sda3 215000 MiB cleared (eventually /home)
/dev/sda4 512 MiB swap (if you need encrypted /home this is necessary to prevent the installer from barfing)

Do the exact same layout for /dev/sdb

On Desktop, Install Linux Mint

Choose Something Else when partitioning
/dev/sda1 -> EFI boot partition
/dev/sda2 -> btrfs, /
/dev/sda3 -> btrfs, /home

/dev/sdb1 -> EFI boot partition

Install Now

When installation completes choose Continue Testing

Go back to Terminal and install btrfs-tools in our new system:
# mount /dev/sda2 /mnt -o subvol=@
# cp /etc/resolv.conf /mnt/etc/resolv.conf
# chroot /mnt/
# apt-get install btrfs-tools
# exit

Now enable BTRFS raid1 for /
# btrfs device add /dev/sdb2 /mnt
# btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt
# umount /mnt

Now raid1 for /home
# mount /dev/sda3 /mnt -o subvol=@home
# btrfs device add /dev/sdb3 /mnt
# btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt
# umount /mnt

Now fix the boot partition:
# dd if=/dev/sda of=/dev/sdb bs=1024 seek=2048 count=512
seek=2048 skips the first 2 MiB that GParted leaves by default for grub2

Now reboot into the new RAID1 btrfs Linux Mint 17
# shutdown -r now
User avatar
pepper311
Level 1
Level 1
Posts: 10
Joined: Fri Dec 26, 2014 4:24 pm

Re: HOWTO: btrfs Mint 17 with raid1 ssd, gpt for UEFI

Post by pepper311 »

How much better is the btrfs performance compared to ext4?

I would be most concerned about backups because alot of the backup software doesnt support btrfs.
ravenpi
Level 1
Level 1
Posts: 3
Joined: Tue Jul 10, 2012 1:18 pm

Re: HOWTO: btrfs Mint 17 with raid1 ssd, gpt for UEFI

Post by ravenpi »

btrfs performance generally is not better than ext4. However, for most use cases, it's in the same ballpark. Where it shines, however, is the added features it gives you. Snapshots -- of filesystems, or files; filesystem-aware RAID; block-based checksumming -- goodbye, silent corruption; out-of-band de-duplication... the list goes on. As for not being supported by backup software, I'm unsure what you mean; I see no reason that btrfs can't be backed up like other filesystems, though there is one caveat: if you have mounted multiple snapshots, cloned files, etc., you'll want to not duplicate your efforts by backing up your duplicate data. E.g., I have one server with a 1 TB drive that I use for a month's worth of snapshots of a remote system. The aggregate of those snapshots is *WAY* more than 1 TB -- probably closer to 15 TB. So if you were doing backups of that sort, just be sure to only point at the more recent snapshot.

As for the advice on how to install Mint 17 on btrfs: THANK YOU! It's been pissing me off that I've had to revert to Ubuntu.
Post Reply

Return to “Tutorials”