日期:2014-05-16  浏览次数:20815 次

继续继续RAID5问题
我在VMware 下的 Linux 部署RAID5.
  有4块硬盘/dev/sdb /dev/sdc /dev/sdd /dev/sde 每块20G
   
  mdadm --create /dev/md0 -l5 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde

  生成/dev/md0的文件.
  先mkfs.ext3 /dev/md0
  对其fdisk /dev/md0 分区,我对其分了3个区
  分区后发现如下:
Python code

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        2610    20964793+  83  Linux

Disk /dev/sdd: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        2610    20964793+  83  Linux

Disk /dev/sde: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1        1000     8032468+  83  Linux
/dev/sde2            1001        2000     8032500   83  Linux
/dev/sde3            2001        2610     4899825   83  Linux

Disk /dev/md0: 64.4 GB, 64424312832 bytes
2 heads, 4 sectors/track, 15728592 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/md0p1               1     5000000    19999998   83  Linux
/dev/md0p2         5000001    10000000    20000000   83  Linux
/dev/md0p3        10000001    15728592    22914368   83  Linux



  问题1:
  我对软磁盘阵列/dev/md0进行分区后,发现/dev/sdb的分区表已经不存在了.而别的盘分区表都存在.
  这是为什么.
  
  问题2:
  虽然这个/dev/sdb的分区表已经不在了,但是软磁盘阵列/dev/md0依然可以用,而且磁盘大小没变.这又是为什么.

 

------解决方案--------------------
要对支持分区的MD设备进行分区,需要在创建时使用/dev/md_d0来替代前面的/dev/md0。创建阵列是通过--auto=mdp(或者其缩写-ap)参数指定。 
/mdadm -Cv --auto=mdp /dev/md_d0 -l5 -n4 /dev/sd[b-e]