[mythtv-users] RAID: full disk or partition (was: Question re: available SATA ports and linux software RAID)

Kevin Ross kevin at familyross.net
Mon Apr 25 23:04:03 UTC 2011

On 4/25/2011 1:08 AM, Jean-Yves Avenard wrote:
> Hi
> On 25 April 2011 12:36, Alex Halovanic<halovanic at gmail.com>  wrote:
>> https://raid.wiki.kernel.org/index.php/Partition_Types
>> This gave a few arguments for using partitions (while also conceding that
>> the author of the RAID tool uses full disks, so clearly it's OK).  The
>> biggest one that stood out to me was that replacement disks could end up
>> being slightly smaller due to manufacturer or model variance, and of course,
>> nobody advertises the exact size.  RAID requires a replacement disk to be at
>> least as large as the failed disk to rebuild the array.
>> When I set up my RAID 5 array, I went with slightly undersized partitions
>> and "wasted" a bit of the free space.  Knowing I can throw in any 2TB disk I
>> can find off the shelf to replace a dead disk was worth both the extra GB or
>> two and the hassle of setting up partitions to me.
> Thanks for the link.
> Finally a clear and definitive answer.
> I added the two new disks as a full size partition. While they are now
> all 2TB disks, the array still uses 1.5TB disk size. So when I extend
> the size of the array, I will use the smallest of all disks. There are
> 5 disks, the likelihood of getting another smaller disk as a
> replacement will be lower ; plus by the time I need replacing 3TB will
> be common and cheap :)
> JY

There's one more reason to avoid making the partition the entire size of 
the device that hasn't yet been mentioned.  mdadm puts some info at an 
offset from the end of the partition (or device).  If your partition 
fills entirely the hard drive, meaning the end of the partition is the 
same as the end of the device, then when the computer boots up, when it 
tries to autodetect raid partitions, it will see a superblock on 
/dev/sdX, and will stop looking for /dev/sdX1, but the one for /dev/sdX 
will be invalid.  This caused me lots of grief until I figured out what 
was going on.  After that, I just shrunk the partition by 8 blocks, and 
everything was happy.

More information about the mythtv-users mailing list