Why make a partition at all for mdadm/raid?

2

i have 4 disks, sd[a,b,f,g] of various sizes that I want to 'merge' together. I am using mdadm to achieve this.

my question is, what's the difference between --

mdadm --create /dev/md0 --level=linear --raid-devices=4 /dev/sda /dev/sdb /dev/sdf /dev/sdg

and

mdadm --create /dev/md0 --level=linear --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdf1 /dev/sdg1

When both work? For some reason (if someone could explain this too, it would be awesome) I lose a lot of disk space as is when I look at /dev/md0 but if I create partitions and then create a linear raid, I end up losing even more space.

So why create partitions at all? Even when I do not have this setup and just want to use a disk, can I just do a mkfs.ext3 /dev/sda ?


Additional stuff - Here's /proc/partitions -

8 0 244140625 sda
8 1 244139008 sda1
8 16 244140625 sdb
8 17 244139008 sdb1
8 80 39063024 sdf
8 81 39061504 sdf1
8 96 156290904 sdg
8 97 156289024 sdg1

WHy are the sizes of my partitions smaller than my disk as listed above?

Hari Sundararajan

Posted 2013-03-26T07:04:59.813

Reputation: 144

It is perfectly legal to do that, but you will have problem if you try to do that on your boot drive. Your will need to store your boot loader somewhere. – Zoredache – 2013-03-26T07:35:33.637

Note that you're not losing any space until the fifth significant figure. That is, the loss -- which is used for storing the partition table, MBR, and other metadata -- is tiny and not worth worrying about. – Reid – 2013-04-24T23:17:04.367

Answers

3

Why make a partition at all

You need partitions if you want to use part of a drive for RAID for a specific array. You can also be more flexible with more partitions.

Example:

1 TB HDD #1:    SDA1 (500 MB)     SDA2 (490 MB)
1 TB HDD #2:    SDB1 (500 MB)     SDB2 (490 MB)
1 TB HDD #3:    SDC1 (500 MB)     SDC2 (500 MB)

I can add sda1, sdb1 and sdc1 in a stripe for performance,
and sda2 and sdb2 in a mirror for security,
amd sdc2 just as a plain disk.

I can not do that if I use the whole drive.

In your case you seem to want only one single large setup, which means that it does not matter which way you do it.

Hennes

Posted 2013-03-26T07:04:59.813

Reputation: 60 739

All right thanks. Yeah I just want the entire disk (atleast for the disks I have). So this clarifies it :) – Hari Sundararajan – 2013-03-28T14:14:48.583