|
我看腾讯云轻量数据盘100GB、500GB、1TB三块都可以购买一次,因此直接下单,爽歪歪,加起来1.7TB了,然后每次挂载嫌麻烦,因此想到可以通过mdadm组raid0,直接组成一块硬盘不爽歪歪么。反正也不放重要数据。
本教程仅仅针对如何组成raid0实操。不对具体的数据负责,操作前请自行备份好相关数据!!!!!!!
后台挂载号硬盘后,链接ssh,登陆后查看硬盘
- Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x0009ac89 Device Boot Start End Blocks Id System/dev/vda1 * 2048 209715166 104856559+ 83 LinuxDisk /dev/vdb: 118.1 GB, 118111600640 bytes, 230686720 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x8b564d31 Device Boot Start End Blocks Id System/dev/vdb1 2048 230686719 115342336 83 LinuxDisk /dev/vdc: 1073.7 GB, 1073741824000 bytes, 2097152000 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/vdd: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/vde: 536.9 GB, 536870912000 bytes, 1048576000 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes
复制代码
vdc vdd vde三块是我新挂载的硬盘,因此直接怼
- mdadm -Cv /dev/md0 -a yes -n 3 -l 0 /dev/vdc /dev/vdd /dev/vde
复制代码- mdadm: chunk size defaults to 512Kmdadm: Defaulting to version 1.2 metadatamdadm: array /dev/md0 started.
复制代码
可以看到组完成,然后输入命令重新查看
出来了
Disk /dev/md0: 1717.6 GB, 1717581119488 bytes, 3354650624 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1572864 bytes
接下来格式化- [root@VM-20-8-centos ~]# mkfs.xfs -f /dev/md0meta-data=/dev/md0 isize=512 agcount=32, agsize=13104128 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0, sparse=0data = bsize=4096 blocks=419331328, imaxpct=5 = sunit=128 swidth=384 blksnaming =version 2 bsize=4096 ascii-ci=0 ftype=1log =internal log bsize=4096 blocks=204752, version=2 = sectsz=512 sunit=8 blks, lazy-count=1realtime =none extsz=4096 blocks=0, rtextents=0
复制代码
然后查看分区ID:
/dev/md0: UUID="记住这一串数字" TYPE="xfs"
然后修改修改/etc/fstab文件
在文件最后用过uuid加上下面这一行
UUID="上面的UUID" /挂载目录 xfs defaults 0 0
如
UUID="12345D" /ssd xfs defaults 0 0
/ssd 为挂载目录
保存,然后正常执行挂载流程,挂载教程请自行百度。 |
|