Linux系统磁盘管理
添加虚拟磁盘
磁盘分区格式化
磁盘挂载使用
开机自动挂载
添加虚拟机磁盘(3块磁盘)
首先关闭虚拟机,虚拟机设置,添加磁盘。
登入系统,然后查看是否添加成功
硬盘的显示:/dev 目录 硬件设备
sd: 硬盘
sda 表示第一块硬盘(安装系统的时候添加的)
sdb 表示第二块硬盘
我们的环境应该会有:sda/sdb/sdc/sdd, 如果存在说明磁盘添加成功了。
ls | grep sd
sda1 第一块硬盘的第一个分区
sda2 第一块硬盘的第二个分区
磁盘使用过程(Linux)
将磁盘联机(完成== 虚拟机磁盘添加到虚拟机)
磁盘分区格式化(创建文件系统的过程)
磁盘挂载(可以正常使用磁盘了)
分区
mbr gpt
fdisk 分区工具
[root@myserver ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.32.1).
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.
Created a new DOS disklabel with disk identifier 0x1fb209a3.
Command (m for help): n 创建分区
Partition type
p primary (0 primary, 0 extended, 4 free) 主分区
e extended (container for logical partitions) 扩展分区
Select (default p): p 主分区
Partition number (1-4, default 1): 1 分区号
First sector (2048-41943039, default 2048): 起始位置默认
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039): +5G 分配5G空间
Created a new partition 1 of type &