制作软件磁盘阵列(raid)

本文详细介绍了在Linux系统中如何创建、格式化、挂载及管理软件RAID5阵列,包括分区、使用mdadm工具、设置开机自启动、救援模式以及关闭卸载RAID的操作步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、分区

这里我使用的是鸟哥linux私房菜上的案例。

  • 4个分区组成RAID5;
  • 每个分区约1GB大小,需确定每个分区一样大较佳;
  • 1个分区设为spare disk(备份分区),大小也为1GB
  • chunk(区块)设定为256K;
  • 此RAID5挂载在/srv/raid目录下
[root@study ~]# gdisk /dev/sda    #对sda磁盘划分区
Command (? for help): n
Partition number (4-128, default 4):         #默认值
First sector (34-83886046, default = 65026048) or {+-}size{KMGTP}: +1gb     #大小1gb
Last sector (67123200-83886046, default = 83886046) or {+-}size{KMGTP}: +1gb
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): fd00      #fd00代表Linux RAID
Changed type of partition to 'Linux RAID'

#重复5次

#按w写并退出
Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.

[root@study ~]# gdisk -l /dev/sda

#看到分区4,5,6,7,8表示成功分区

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            6143   2.0 MiB     EF02  
   2            6144         2103295   1024.0 MiB  0700  
   3         2103296        65026047   30.0 GiB    8E00  
   4        67123200        69220351   1024.0 MiB  FD00  Linux RAID
   5        71317504        73414655   1024.0 MiB  FD00  Linux RAID
   6     
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值