第四步 实验完毕,清理磁盘
#清理数据,做RAID必须做如下操作
#首先停掉RAID
[root@serv01 ~]# mdadm --manage /dev/md0--stop
mdadm: stopped /dev/md0
[root@serv01 ~]# rm -rf /etc/mdadm.conf
[root@serv01 ~]# mdadm -E /dev/sdb1
mdadm: cannot open /dev/sdb1: No such fileor directory
#检测发现有残留信息
[root@serv01 ~]# mdadm -E /dev/sdc1
/dev/sdc1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 1f1a007f:7ed82aa0:49722d2f:1e664330
Name : serv01.host.com:0 (localto host serv01.host.com)
Creation Time : Wed Jul 31 23:30:26 2013
Raid Level : raid0
Raid Devices : 2
Avail Dev Size : 4190854 (2046.66 MiB 2145.72MB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 7e3d4caf:35001960:b95d9eae:19fa3093
Update Time : Wed Jul 31 23:30:26 2013
Checksum : 64b18466 - correct
Events : 0
Chunk Size : 512K
Device Role : Active device 1
Array State : AA ('A' == active, '.' == missing)
#清空磁盘
[root@serv01 ~]# mdadm --misc—zero-superblock /dev/sdc1
[root@serv01 ~]# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated.It's strongly recommended to
switch off the mode (command 'c') andchange display units to
sectors (command 'u').
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G}(1-261, default 261):
Using default value 261
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@serv01 ~]# mdadm -E /dev/sdb1
/dev/sdb1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 1f1a007f:7ed82aa0:49722d2f:1e664330
Name : serv01.host.com:0 (localto host serv01.host.com)
Creation Time : Wed Jul 31 23:30:26 2013
Raid Level : raid0
Raid Devices : 2
Avail Dev Size : 4190854 (2046.66 MiB 2145.72MB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
State : clean
Device UUID : f76937d2:74ac3af1:506bed88:795c81ed
Update Time : Wed Jul 31 23:30:26 2013
Checksum : 4d5dcd15 - correct
Events : 0
Chunk Size : 512K
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing)
#清空磁盘
[root@serv01 ~]# mdadm --misc--zero-superblock /dev/sdb1
mdadm: Couldn't open /dev/sdb1 for write -not zeroing
[root@serv01 ~]# cat /proc/mdstat
Personalities : [raid0]
md0 : inactive sdb1[0](S)
2095427 blocks super 1.2
unused devices: <none>
root@serv01 ~]# mdadm --manage /dev/md0--stop
mdadm: stopped /dev/md0
[root@serv01 ~]# mdadm --misc--zero-superblock /dev/sdb1
[root@serv01 ~]#
[root@serv01 ~]# mdadm -E /dev/sdb1
/dev/sdb1:
MBR Magic : aa55
[root@serv01 ~]# mdadm -E /dev/sdc1
mdadm: No md superblock detected on/dev/sdc1.
