大网数据广告活动
服务器运维问答

Advantages of partitioning RAID HDs?

· 52CE 我爱测

I have a bunch of identical, brand new HDs (4*3T, if it matters) I need to use for a single RAID5 array (Linux mdmadm). It is still undecided if I'll use the entire combined content for a single FileSystem (ext4?) or I'll partiti…

问题原文

原帖链接 · ZioByte · CC BY-SA 4.0

I have a bunch of identical, brand new HDs (4*3T, if it matters) I need to use for a single RAID5 array (Linux mdmadm).

It is still undecided if I'll use the entire combined content for a single FileSystem (ext4?) or I'll partition in several virtual drives using LVM.

RAID5 will span the full content of the disks and I don't need boot sector (booting is from another device).

In this condition is there any advantages (or disadvantages) to "traditionally partitioning" the drive with a single partition vs using the whole, unpartitioned, device as base for mdmadm assemble?

Saying the same thing in a different way: Is there any advantage in doing

mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 --spare-devices=1 /dev/sde1

versus

mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd --spare-devices=1 /dev/sde

beside trivial loss of a few sectors in the former (which is a negligible "disadvantage")?

已采纳解答

原帖链接 · shodanshok · CC BY-SA 4.0

Partitioning a disk for MD RAID duties has some advatanges:

  • MBR/GPT partition table serves as a protective layer if/when the disks are installed on a non-linux machine (a partition table is a strong indication the disk was in using in other systems and it may contain valuable data);

  • using a slightly smaller partition (versus the entire disk size) ensure that you can replace one failed disk with another 3 TB model even if the latter misses some sectors (ie: it is slightly smaller than the original disk);

  • you can dedicate some partitions to a different RAID layout based on the expected data (for example, using RAID0 for swap and scratch data).

For simplicitly sake, if not booting off the RAID array and not needing a swap partition on it, I would probably not use partition for the MD array. This is especially true when using RAID inside a virtual machines, where the underlying disk can be resized by the hypervisor (requiring you to resize the partition table before growing the array).

On the other hands, for a bare metal installation, using a partition table for a RAID array only commands an extremely small overhead/annoyance, so if any of the above points is significant for you, go ahead with partitioning.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-11-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。