欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > linux >内容正文

linux

linux raid auto 软raid parted,linux下的raid5配置方法.doc

发布时间:2025/4/5 linux 48 豆豆
生活随笔 收集整理的这篇文章主要介绍了 linux raid auto 软raid parted,linux下的raid5配置方法.doc 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

要求:需要在三块硬盘上创建RAID5 并挂载到 /raid5disk 目录下!

先用fdisk -l 看一下三块磁盘的设备号,在这里就是

/dev/sdb

/dev/sdc

/dev/sdd

1. 首先在三块硬盘上分别创建一个分区!

# fdisk /dev/sdb

Command (m for help): n 按n创建新分区

Command action

e extended

p primary partition (1-4) 输入p 选择创建主分区

Partition number (1-4): 输入 1 创建第一个主分区

First cylinder (1-204, default 1): 直接回车,选择分区开始柱面这里就从 1 开始

Last cylinder or +size or +sizeM or +sizeK (1-204, default 204):

也是直接回车,最后一个柱面!我这里是204, 各人的硬盘大小不一样大,这里的值也不一样大!

这样就将硬盘1柱面到204柱面创建了第一个主分区!

Command (m for help): t 输入t 指定分区类型!

Selected partition 1

Hex code (type L to list codes):

可以直接输入fd,指定分区类型就为Linux raid auto 也可以输入l看一下所有支持的分区类型!

我这里倒数第三个就是raid的分区类型代号为fd

Command (m for help): w 然后输入w写盘!

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

按照此步骤在另外的两块磁盘上做同样的操作!

全部做完后,运行 fdisk -l 应该可以看到如下信息!

Disk /dev/sdb: 214 MB, 214748160 bytes

64 heads, 32 sectors/track, 204 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System

/dev/sdb1 1 204 208880 fd Linux raid autodetect

Disk /dev/sdc: 214 MB, 214748160 bytes

64 heads, 32 sectors/track, 204 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System

/dev/sdc1 1 204 208880 fd Linux raid autodetect

Disk /dev/sdd: 214 MB, 214748160 bytes

64 heads, 32 sectors/track, 204 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System

/dev/sdd1 1 204 208880 fd Linux raid autodetect

看到上面三个磁盘上分别建了一个分区,分区大小都一样!

然后再运行

#mdadm -Cv /dev/md0 -l5 -n3 /dev/sdb1 /dev/sdc1 /dev/sdd1

这里就在三个分区上创建了raid5 软件陈列, 新的分区设备号为md0

然后格式化一下

总结

以上是生活随笔为你收集整理的linux raid auto 软raid parted,linux下的raid5配置方法.doc的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。