如果想对支持分区的MD设备(Partitionable raid array)进行分区,需要在创建时使用/dev/md_d0来替代前面的/dev/md0。创建阵列是通过--auto=mdp(或者其缩写-ap)参数指定。
[root@fc5 mdadm-2.6.3]# ./mdadm -Cv --auto=mdp /dev/md_d0 -l5 -n6 /dev/sd[b-g] -x1 /dev/sdh
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 64K
mdadm: size set to 1048512K
mdadm: array /dev/md_d0 started.
[root@fc5 mdadm-2.6.3]# fdisk /dev/md_d0
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 1310640.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1310640, default 1):1
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1310640, default 1310640): +1024M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (250002-1310640, default 250002):250002
Using default value 250002
Last cylinder or +size or +sizeM or +sizeK (250002-1310640, default 1310640):1310640
Using default value 1310640
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@fc5 mdadm-2.6.3]# fdisk -l /dev/md_d0
Disk /dev/md_d0: 5368 MB, 5368381440 bytes
2 heads, 4 sectors/track, 1310640 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Device Boot Start End Blocks Id System
/dev/md_d0p1 1 250001 1000002 83 Linux
/dev/md_d0p2 250002 1310640 4242556 83 Linux
