第一步新增硬盘:
<使用虚拟机新增>
查看磁盘位置 /dev/
IDE接口硬盘:/dev/dh[a-z] SCSI接口硬盘:/dev/sd[a-z]
第二步硬盘分区(使用fdisk):
可以使用 m 查看各字母的帮助信息
顺序:n(新建) > p(创建主分区)> 分区编号> 起始扇区> 设置分区大小> p(查看)> w(保存)
第三步重新读取新的分区表(使用partprobe):
第四步格式化并创建文件系统:
Linux支持很多文件系统,常用的有ext4 和 xfs
第五步挂载,将文件系统和硬盘进行挂钩:
手动挂载:重启后失效。用于检测已经格式化的设备,是否可以和预期一样的进行工作。
mount 文件系统 挂载点(目录)
永久挂载:就是将设备添加到 /etc/fstab 中
使用 df -h 查看是否挂载成功