Announcement

Collapse
No announcement yet.

BTRFS on raid1 setup - partition or raw?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    BTRFS on raid1 setup - partition or raw?

    In a previous post Oshunluvr wrote:
    One of the other features of BTRFS is it can reside on a whole device thus no partitioning is required at all. Yes - that's right - mkfs.btrfs /dev/sda rather than mkfs.btrfs /dev/sda1. As an added bonus, BTRFS performs slightly better when it occupies an entire device in this manner.
    I have taken a trip to the States to buy components to build a new computer from scratch, one which doesn't have the severe space limitations that my single-drive desktop system has. The new box can hold plenty of drives, so it's easily expandable. I also have three new 4TB drives which I will use the first two as raid1 drives, and the third will be an independent backup drive, so I finally have a space I can copy snapshots to. Finally! (Yes GrayGeek, you impressed me with your backup droning! Thank you.)

    I have read the instructions for how to do this configuration in https://seravo.fi/2016/perfect-btrfs-setup-for-a-server and have a couple questions.

    First, the author instructs readers to install the boot loader to MBR, but I'd rather install to GPT instead. Will this change be a problem? I presume not.

    Second question: The author instructs readers to install a partition for the btrfs, and to not install btrfs to the raw drive. Why? I recall that GrayGeek said to not bother with a partition, just install btrfs directly to the raw drive, and Oshunluvr seems to agree (as per the above quote,) but the author of the article says not to do so, to use a partition - but he doesn't explain why. Is it his personal preference, or is there a technical reason that a partition must be used? Or can I safely install to the raw drive?
    --
    I'd rather have a bottle in front of me, than a frontal lobotomy!

    #2
    Originally posted by rwbehne1 View Post
    ... is there a technical reason that a partition must be used? Or can I safely install to the raw drive?
    There is absolutely no technical reason to use a partition. Moreover, you can use two of your drives to achieve mirrored metadata (Raid 1) and striped data (Raid 0). This is the default configuration if you make a 2-drive filesystem on two of your drives. See the wiki article.

    Comment


      #3
      BTRFS on raid1 setup - partition or raw?

      I’ve tried both ways: raw and partition. Using a partition allows you to be sure of disk alignment. Your hardware will probably prefer GPT.

      As of 11/4/2017 the following recommendations apply. Read the entire document before you take any action.
      https://wiki.debian.org/Btrfs#Warnings
      Also, be sure to use UUID’s and NOT “/dev/sdXn” in the fstab. If you use “/dev/sdXn” the drives can spontaneously re-assign themselves and any scripts or programs which use sdXn assignments will break or do bad things to a partition. (I was using sda1 and sdb1. When I added a third drive and used the whole disk I was surprised to see that my 3rd disk booted as sdb1 and the second drive of my RAID1 became sdc. I later converted my RAID1 to a single volume to increase free volume space but the assignment stuck. It hasn’t given me any problems but from then on I've used UUID, even for USB sticks.)
      Last edited by GreyGeek; Dec 15, 2017, 10:31 AM. Reason: typos
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #4
        Besides alignment as GG pointed out (that would be an interesting questions to pose to the btrfs devs), the other reason not to use the whole device is boot-ability. You can't boot from a whole device btrfs file system. I suspect alignment isn't an issue for btrfs. If it was, it would simply not use the leading portion. My gut tells me alignment is more about the partition table than the drive space, but I haven't researched it.

        My server has two 2-drive RAID1 (with RAID0 metadata as dibl describes) arrays using the whole device for all four drives. I have a 5th drive on that system to boot to and hold the OS. My desktop has 2 partitioned SSDs with all but a small amount being used as a two drive RAID0 BTRFS file system.

        The small amount not in the RAID0 file system is 2 partitions that hold a stand alone grub (my preference because I have multiple installs), 2 swap partitions, and 2 BIOS boot partitions. I have written an entire How-To on installing grub to a GPT drive here. IF your prefer EFI booting, there is also a How-To on this forum for that as well.

        Since your drives are 4TB, GPT is required.

        GPT partitioning has several advantages over MBR but it's unlikely you'd notice much difference with normal use. GPT does CRC checking and is much easier to restore a partition table in the event the primary table gets corrupted.
        Last edited by oshunluvr; Dec 15, 2017, 01:51 PM.

        Please Read Me

        Comment

        Working...
        X