[root@testggv ~]# fdisk /dev/hdc
The number of cylinders for this disk is set to 25232.
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)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-25232, default 1):
Using default value 1
Last cylinder or size or sizeM or sizeK (1-25232, default 25232):
Using default value 25232
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or
busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@testggv ~]#
[root@fc5 mdadm-2.6.3]# ./mdadm -A /dev/md0 /dev/sd[b-h]
mdadm: /dev/md0 has been started with 6 drives and 1 spare.如果有配置文件(/etc/mdadm.conf)可使用命令mdadm -As /dev/md0。mdadm先检查mdadm.conf中的DEVICE信息,然后从每个设备上读取元数据信息,并检查是否和ARRAY信息一致,如果信息一致则启动阵列。如果没有配置/etc/mdadm.conf文件,而且又不知道阵列由那些磁盘组成,则可以使用命令--examine(或者其缩写-E)来检测当前的块设备上是否有阵列的元数据信息。[root@fc5 mdadm-2.6.3]# ./mdadm -E /dev/sdi
代码如下:
mdadm: No md superblock detected on /dev/sdi.
[root@fc5 mdadm-2.6.3]# ./mdadm -E /dev/sdb
/dev/sdb:
Magic : a92b4efc
Version : 00.90.00
UUID : 0cabc5e5:842d4baa:e3f6261b:a17a477a
Creation Time : Sun Aug 22 17:49:53 1999
Raid Level : raid10
Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB)
Array Size : 3145536 (3.00 GiB 3.22 GB)
Raid Devices : 6
Total Devices : 7
Preferred Minor : 0
Update Time : Sun Aug 22 18:05:56 1999
State : clean
Active Devices : 6
Working Devices : 7
Failed Devices : 0
Spare Devices : 1
Checksum : 2f056516 - correct
Events : 0.4
Layout : near=2, far=1
Chunk Size : 64K
Number Major Minor RaidDevice State
this 0 8 16 0 active sync /dev/sdb
0 0 8 16 0 active sync /dev/sdb
1 1 8 32 1 active sync /dev/sdc
2 2 8 48 2 active sync /dev/sdd
3 3 8 64 3 active sync /dev/sde
4 4 8 80 4 active sync /dev/sdf
5 5 8 96 5 active sync /dev/sdg
6 6 8 112 6 spare /dev/sdh
[root@fc5 mdadm-2.6.3]# ./mdadm -Av --uuid=0cabc5e5:842d4baa:e3f6261b:a17a477a
/dev/md0 /dev/sd*
mdadm: looking for devices for /dev/md0
mdadm: no recogniseable superblock on /dev/sda
mdadm: /dev/sda has wrong uuid.
mdadm: no recogniseable superblock on /dev/sda1
mdadm: /dev/sda1 has wrong uuid.
mdadm: no RAID superblock on /dev/sdi
mdadm: /dev/sdi has wrong uuid.
mdadm: /dev/sdi1 has wrong uuid.
mdadm: no RAID superblock on /dev/sdj
mdadm: /dev/sdj has wrong uuid.
mdadm: /dev/sdj1 has wrong uuid.
mdadm: no RAID superblock on /dev/sdk
mdadm: /dev/sdk has wrong uuid.
mdadm: /dev/sdk1 has wrong uuid.
mdadm: /dev/sdb is identified as a member of /dev/md0, slot 0.
mdadm: /dev/sdc is identified as a member of /dev/md0, slot 1.
mdadm: /dev/sdd is identified as a member of /dev/md0, slot 2.
mdadm: /dev/sde is identified as a member of /dev/md0, slot 3.
mdadm: /dev/sdf is identified as a member of /dev/md0, slot 4.
mdadm: /dev/sdg is identified as a member of /dev/md0, slot 5.
mdadm: /dev/sdh is identified as a member of /dev/md0, slot 6.
mdadm: added /dev/sdc to /dev/md0 as 1
mdadm: added /dev/sdd to /dev/md0 as 2
mdadm: added /dev/sde to /dev/md0 as 3
mdadm: added /dev/sdf to /dev/md0 as 4
mdadm: added /dev/sdg to /dev/md0 as 5
mdadm: added /dev/sdh to /dev/md0 as 6
mdadm: added /dev/sdb to /dev/md0 as 0
mdadm: /dev/md0 has been started with 6 drives and 1 spare.