2

Given a RAID 6 created from 6 drives /dev/md0 which should be used fully for data (no booting from it, root and swap are on a different drive), should I create one partition on that device and then create a file system in that partition, or should I just create a file system on the device?

parted /dev/md0
  <create a partion>
mkfs -t ext3 /dev/md0p1

or just

mkfs -t ext3 /dev/md0

And why?

(This is Ubuntu Server, just in case it matters.)

dummzeuch
  • 607
  • 1
  • 8
  • 18
  • 1
    Why would you create a partition on a device that was already being partitioned? I don't know if there are any performance issues for this but unless you want to use a LVM creating an additional partition makes absolutely no sense. General rule of IT: If there are two approaches for one task and one is more simple than the other, the simple one is the best one. – Broco Aug 12 '14 at 14:42
  • @Broco I have just been looking at examples on creating RAIDs with mdadm and some of them partition the RAID, others don't but I found no explanation why I would want to do one or the other. So I asked. – dummzeuch Aug 12 '14 at 14:46
  • @Broco: Right. But even for LVM, you don't need partitions, you can use `/dev/mdX` as PV directly. – Sven Aug 12 '14 at 14:46
  • @SvW yes, you are right of course. Partitioning would only make sense if you would put multiple partitions on the one RAID. But still it is suggested to just create a raid-partition for each file-system-partition. – Broco Aug 12 '14 at 14:49
  • @dummzeuch It's ok to ask and it's nowadays possible to create multiple "native" (meaning no LVM) partitions on one RAID-volume but since you said you just need one partition on this raid this would make no sense. – Broco Aug 12 '14 at 14:52
  • 1
    @kasperd you are right, it's a duplicate by content but I did not find that question because the wording is totally different from mine. – dummzeuch Aug 12 '14 at 15:06
  • @dummzeuch That happens to most of us occasionally. Either one doesn't for just the right terms to find it, or as it happened to me once, the previous question had a screen shot containing the exact phrase I had searched for. – kasperd Aug 12 '14 at 15:41

2 Answers2

5

Arguments against the partitioning:

Partitions are strict, obsolete things in the today. A repartitioning mostly a problematic thing. You won't be able to change things in the future.

Raid devices are directly partitionable only in newer kernels.


Thus I suggest you to simply use the whole disk directly, if you won't use some advanced solution. On Linux, LVM is a such advanced "partitioning" system. It enables for you to dynamically create/move/resize/remove partitions, even below a running system, transparently.

peterh
  • 4,914
  • 13
  • 29
  • 44
2

There is no added value of creating a partition table there, unless you want to subdivide the amount of space further.

If you need to subdivide the space further you would possibly benefit most from using the logical volume manager instead of creating partitions and then you can still skip the creation of a partition table and address the whole RAID 6 volume as a LVM physical volume.

The advantage of not creating a partition table and not using partitions comes mainly in play when you extend the RAID array with additional disks.

HBruijn
  • 72,524
  • 21
  • 127
  • 192