mdadm-C 创建-v 显示创建的过程-l 指定RAID的级别是0 1 5 10-D 查看详细信息完成之后可以查询-f 模拟设备损坏 -a 检测设备名称-a yes 自动创建设备文件-n 有几块盘 删除占用mdadm /dev/md1 --fail /dev/sdc --remove /dev/sdcmdadm --stop /dev/md1或者/绑定的文件 删除磁盘阵列mdadm --remove /dev/md1或者/绑定的文件 删除磁盘阵列
虚拟机模拟磁盘阵列实验 RAID 10 并切换切换RAID 5操作过程
1.先在虚拟机前设中添加4个磁盘
2.查询磁盘并使用mdadm命令添加磁盘阵列!
[root@lizhiqiang Desktop]# mdadm -Cv /dev/md/zhuxing -a yes -n 4 -l 10 /dev/sd[c-f]mdadm: layout defaults to n2mdadm: layout defaults to n2mdadm: chunk size defaults to 512Kmdadm: size set to 20954624Kmdadm: Defaulting to version 1.2 metadatamdadm: array /dev/md/zhuxing started.其中 /dev/md/zhuyxing 可以更改为/dev/md[0-无限]但必须有/dev/md格式 /dev/sd[c-f]可以设置为/dev/sdc /dev/sdd /dev/sdf /dev/sde
3.格式化主磁盘,并在家目录创建文件夹以挂载主磁盘
[root@lizhiqiang Desktop]# mkfs.ext4 /dev/md/zhuxingmke2fs 1.42.9 (28-Dec-2013)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=128 blocks, Stripe width=256 blocks2621440 inodes, 10477312 blocks523865 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=2157969408320 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624Allocating group tables: doneWriting inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done[root@lizhiqiang Desktop]# cd ~[root@lizhiqiang ~]# mkdir zhu[root@lizhiqiang ~]# mount /dev/md/zhuxing /zhumount: mount point /zhu does not exist[root@lizhiqiang ~]# mount /dev/md/zhuxing /root/zhu其中在家目录中只写/zhu不可以挂载 只能用绝对路径挂载 显示挂载成功!
把磁盘加到启动项,并使用-D命令查看挂载分区信息
[root@lizhiqiang ~]# echo "/dev/md/zhuxing /zhu ext4 defaults 0 0" >> /etc/fstab[root@lizhiqiang ~]# mdadm -D /dev/md/zhuxing/dev/md/zhuxing:Version : 1.2Creation Time : Tue Oct 20 06:43:30 2020Raid Level : raid10Array Size : 41909248 (39.97 GiB 42.92 GB)Used Dev Size : 20954624 (19.98 GiB 21.46 GB)Raid Devices : 4Total Devices : 4Persistence : Superblock is persistentUpdate Time : Tue Oct 20 06:52:37 2020State : clean Active Devices : 4Working Devices : 4Failed Devices : 0Spare Devices : 0Layout : near=2Chunk Size : 512KName : lizhiqiang:zhuxing(local to host lizhiqiang)UUID : 0a64eebf:9c26768e:88803e37:5ca70cdfEvents : 17NumberMajorMinorRaidDevice State08320active sync/dev/sdc18481active sync/dev/sdd28642active sync/dev/sde38803active sync/dev/sdf
RAID 10 切换RAID 5
先使用命令卸载磁盘,再停止使用著主磁盘占用防止浪费磁盘,成功卸载之后就可以装载RAID 5
[root@lizhiqiang Desktop]# umount /dev/md/zhuxing[root@lizhiqiang Desktop]# mdadm --stop /zhumdadm: error opening /zhu: Is a directory[root@lizhiqiang Desktop]# mdadm --stop /dev/md/zhuxingmdadm: stopped /dev/md/zhuxing[root@lizhiqiang Desktop]# mdadm -D /dev/md/zhuxingmdadm: cannot open /dev/md/zhuxing: No such file or directory
装载RAID 5 使用mdadm命令并格式化,mdadm命令需要加入一个备份盘 使用-x命令
此时会提示分盘占用 用y强制使用便成功!
[root@lizhiqiang Desktop]# mdadm -Cv /dev/md/zhuxing -a yes -n 3 -l 5 -x 1 /dev/sd[c-f]mdadm: layout defaults to left-symmetricmdadm: layout defaults to left-symmetricmdadm: chunk size defaults to 512Kmdadm: /dev/sdc appears to be part of a raid array:level=raid10 devices=4 ctime=Tue Oct 20 06:43:30 2020mdadm: /dev/sdd appears to be part of a raid array:level=raid10 devices=4 ctime=Tue Oct 20 06:43:30 2020mdadm: /dev/sde appears to be part of a raid array:level=raid10 devices=4 ctime=Tue Oct 20 06:43:30 2020mdadm: /dev/sdf appears to be part of a raid array:level=raid10 devices=4 ctime=Tue Oct 20 06:43:30 2020mdadm: size set to 20954624KContinue creating array? ymdadm: Defaulting to version 1.2 metadatamdadm: array /dev/md/zhuxing started.[root@lizhiqiang Desktop]# mdadm -D /dev/md/zhuxing/dev/md/zhuxing:Version : 1.2Creation Time : Tue Oct 20 07:17:32 2020Raid Level : raid5Array Size : 41909248 (39.97 GiB 42.92 GB)Used Dev Size : 20954624 (19.98 GiB 21.46 GB)Raid Devices : 3Total Devices : 4Persistence : Superblock is persistentUpdate Time : Tue Oct 20 07:19:18 2020State : clean Active Devices : 3Working Devices : 4Failed Devices : 0Spare Devices : 1Layout : left-symmetricChunk Size : 512KName : lizhiqiang:zhuxing(local to host lizhiqiang)UUID : 19cec61b:0d1c4f49:972ba0ec:fad30b55Events : 32NumberMajorMinorRaidDevice State08320active sync/dev/sdc18481active sync/dev/sdd48642active sync/dev/sde3880-spare/dev/sdf
- 虚拟机安装ubuntu22.04后双屏显示
- ubuntu安装配置NS-3
- centos7.4系统的虚拟机网络配置教程
- 各有所长的清洁工 —— Java虚拟机的垃圾收集器清单
- Vm安装虚拟机出现Vmware此主机不支持64位客户机操作系统问题
- Mac电脑安装win10虚拟机,然后安装ensp教程
- android 脱壳 虚拟机
- 【JVM】Java虚拟机中的程序计数器
- 一 复现区块链Fabric1.4项目记录安装配置centos8虚拟机
- 保护站点上已存在另一个具有相同实例 UUID的虚拟机_淮安钢筋保护帽厂商电话