搭建硬盘
- 集群分片有要求,避免同步失败
- 硬盘数量相同
- 硬盘地址相同
**
选择 SCSI 磁盘类型,不需要 cpu 参与控制
 
- 挂载多两个硬盘
给硬盘分区
- 查看当前硬盘
fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 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: 0x00022f87Device Boot Start End Blocks Id System/dev/sda1 * 2048 2099199 1048576 83 Linux/dev/sda2 2099200 41943039 19921920 8e Linux LVM---Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes---Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes
- 可以看到多了
/dev/sdb和/dev/sdc两块硬盘
- 创建分区
- 仅创建主分区
fdisk /dev/sdb
- 仅创建主分区
Welcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition tableBuilding a new DOS disklabel with disk identifier 0x06d08c49.Command (m for help): mCommand actiona toggle a bootable flagb edit bsd disklabelc toggle the dos compatibility flagd delete a partitiong create a new empty GPT partition tableG create an IRIX (SGI) partition tablel list known partition typesm print this menu # 打印命令菜单n add a new partition # 添加新分区o create a new empty DOS partition tablep print the partition table # 打印分区表q quit without saving changes # 退出而不保存s create a new empty Sun disklabelt change a partition's system idu change display/entry unitsv verify the partition tablew write table to disk and exit # 把分区表写入硬盘并且退出x extra functionality (experts only)Command (m for help): nPartition type:p primary (0 primary, 0 extended, 4 free) # 主分区e extended # 拓展分区Select (default p): pPartition number (1-4, default 1): 1 # 分区编号First sector (2048-2097151, default 2048):Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):Using default value 2097151Partition 1 of type Linux and of size 1023 MiB is setCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.
- 再次键入
fdisk -l会发现/dev/sdb的分区信息 ```shell
Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x06d08c49
Device Boot Start End Blocks Id System /dev/sdb1 2048 2097151 1047552 83 Linux
- 格式化分区> mkfs -t ext4 /dev/sdb1- 永久挂载硬盘> vim /etc/fstab```shell# 在后面加载分区对应挂载目录/dev/sdb1 /mnt/p0 ext4 defaults 0 0
重启
挂载的目录可以访问了
cd /mnt/p0
- 对另外的硬盘和其他分片虚拟机也进行上面的操作
