目标
添加一个新硬盘,分为三个区,卷标为userdata,groupdata,otherdata,分别使用设备路径、label、UUID挂载到/mnt/usrdata,/mnt/grpdata,/mnt/otherdata下
配置环境
新装的CentOS7.8 最小化版本
步骤
1. 添加硬盘
关闭虚拟机,点击“编辑虚拟机设置”>“添加”>“硬盘”,直接点击“下一步”到指定磁盘容量对话框,这里设置容量为3G。
点击“下一步”>“完成”>“确定”。可以看到多了一块3G的磁盘
2. 分区(用fdisk)
创建一个500M主分区和两个500M的逻辑分区
[root@localhost ~]# ls /dev/sd* # 查看是否有sdb
/dev/sda /dev/sda1 /dev/sda2 /dev/sdb
[root@localhost ~]# fdisk --help # 查看帮助
[root@localhost ~]# fdisk -l /dev/sdb # 查看sdb信息
[root@localhost ~]# 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 table
Building a new DOS disklabel with disk identifier 0x981f67c7.
Command (m for help): n # 新建主分区
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1