Chinaunix首页 | 论坛 | 博客
  • 博客访问: 348278
  • 博文数量: 54
  • 博客积分: 497
  • 博客等级: 下士
  • 技术积分: 612
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-16 20:05
个人简介

行动…Don\'t ever let somebody tell you, you can\'t do something. you got a dream, you gotta protect it. people can\'t do something themselves they wanna tell you you can\'t do it.if you want something. go get it.

文章分类

全部博文(54)

文章存档

2021年(3)

2018年(1)

2017年(18)

2016年(7)

2015年(4)

2013年(1)

2011年(20)

我的朋友

分类: LINUX

2011-06-13 15:09:32

注:mdadm: SET_ARRAY_INFO failed for /dev/md0: Device or resource busy 遇到此问题,首先用fdisk -l 查看磁盘的ID 项是否为fd。然后进入/etc/fstab 把相应的磁盘类型若是ext2改为fd,重启生效. 用mount 查看,若成功是看不到相应盘。如下:要做的盘分别为sdb1、sdc1、sdd1
失败:/dev/sda2 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/sda3 on /home type ext3 (rw)
/dev/sdb1 on /mnt/sdb1 type ext2 (rw)
/dev/sdc1 on /mnt/sdc1 type ext2 (rw)
/dev/sdd1 on /mnt/sdd1 type ext2 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
 
成功:/dev/sda2 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/sda3 on /home type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
 
 
 
此处为下面步骤2磁盘划分分区的详情:
如果MD驱动被编译到内核中,当内核调用执行MD驱动时会自动查找分区为FD(Linux raid autodetect)格式的磁盘。所以一般会使用fdisk工具将HD磁盘或者SD磁盘分区,再设置为FD的磁盘。
[root@fc5 mdadm-2.6.3]# fdisk /dev/sdk
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.
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-512, default 1):1
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-512, default 512):512
Using default value 512
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.
Syncing disks.
[root@fc5 mdadm-2.6.3]# fdisk -l /dev/sdk
Disk /dev/sdk: 1073 MB, 1073741824 bytes
128 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 4096 * 512 = 2097152 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdk1               1         512     1048560   fd  Linux raid autodetect
 

软RAID阵列实际上也可以使用任何标准的块设备作为底层设备,如SCSI设备、IDE设备、RAM disk磁盘和NBD(Network Block Device)等,甚至是其他的MD设备。
 
步骤:

1.  fdisk -l

显示所有硬盘,查看它的编号。/dev/hda,/dev/hdb,等等。

然后再依次对其 fdisk /dev/hdb

2. 新建一个分区。选择全部分配,按“n“新建——”P“ 主分区——创建一个主分区成功。——“T”更改分区类型(ID),——输入“fd”——“W”写入磁盘。

3. 对其它一块要组成阵列的磁盘进行以上同样的操作。

4. 然后: mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/hdb1 /dev/hdd1

或者这样写。mdadm -C /dev/md0 -l0 -n2 /dev/hd{b,d}1

然后对它格式化 mkfs.ext3 /dev/md0,

挂接。mkdir /mnt/md0

mount /dev/md0 /mnt/md0

阅读(2875) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~