Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I'm going to create a multi-device btrfs filesystem. The official recommendation from the documentation apppears to be to create it on raw devices; i.e. /dev/sdb, /dev/sdc, etc, but this is not explained.

Are there any advantages to creating a partition table on these devices first, either GPT or MBR, and then creating the filesystem on /dev/sdb1, /dev/sdc1 et cetera? Does feeding btrfs whole devices have some particular advantage, or are these basically equivalent?

share|improve this question
add comment

5 Answers

There are a number of disadvantages of partitioning. MBR wastes a whole "track". A track is number of sectors times sector size, but a real disc does have sectors and sector size is not 512o. A real disc has blocks which are 8 times larger for rotating disc and much larger for flash devices. This shifting to the next track may make it impossible to align "logical" sectors with actual blocks using stride and stripe.

In the old days you could define sector size in FAT, but MBR put an end to that.

If you are booting from the disc then BIOS needs a boot signature in the end of the first 512o so that it knows it can run this when its loaded. If you are running EFI get drunk. The file system would need to have a hole for this if it is to be used to boot the system.

XFS (mostly used on /var on rotating discs) does not have such a hole.

share|improve this answer
1  
I am a little confused; wouldn't "(total) number of sectors times sector size" be the entire disk, if the disk is made up of sectors? Or is something other than "total" implied? –  Glyph Nov 13 '12 at 23:35
add comment

Partitioning is just a way to split a disk up into multiple volumes which can be used independently. If you only want one volume per disk, partitioning doesn't buy you anything -- it just uses removes some disk space (yes, it's very small), and complicates things like aligning your data on harddrives with 4K sectors or flash drives. The only other reason to have a partition table is in order to boot off that drive. If there's no reason to have a partition table it's simpler to just omit it.

share|improve this answer
add comment

If I understand correctly, using whole disks will allow BTRFS to make some assumptions which allow some optimization of behavior.

Like, if granted full devices to work from, it can assume that it won't have anything challenging it for access to the device, and it can tailor its access methods instead of having to anticipate delays periodically from something else asking for data from somewhere else on the device, and having to wait for the drive to get back to it after handling the other request.

share|improve this answer
add comment

With all these 4K sectors drives you can use partitioning to align your filesystem. Simply start fdisk with:

fdisk -H 224 -S 56

and create a single partition that span the whole device.

share|improve this answer
add comment

Use seperate Disks to get advantages to disk read/save speed.

Basically, /dev/sda is one hard disk, and /dev/sda1, /dev/sda2 are parts of the same physical disk.

if you use /dev/sda, + /dev/sdb for your setup, you have two separate disks able to retrive at the same time.

if you use /dev/sda1 /dev/sda2 then you get the same disk trying to read both, and so it has to do one and then the other.

share|improve this answer
    
If you're saying that using sda is faster than sda1, where does this speed advantage come from? –  grawity Jun 3 '12 at 20:48
    
the speed advantage comes from parallel hardware storing and retrieving your data, instead of the same hardware trying to skip to multiple locations on the same disk –  Jharwood Jun 3 '12 at 20:50
    
There wasn't any mention of multiple locations or multiple partitions. The question is about a single partition covering the whole disk. –  grawity Jun 3 '12 at 21:03
    
Ahh, sorry I misunderstood the question. –  Jharwood Jun 3 '12 at 22:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.