记录一下磁盘挂载的经历,背景是这样的,业务运行时有大量的日志文件产生,因此给服务器挂载一个数据盘。
先普及几个查看linux磁盘空间的命令:
df -h 查看磁盘空间
du -m 查看当前目录下各个文件占用存储空间大小,单位为MB
fdisk -l 查看当前磁盘分区信息
1.使用fdisk -l查看当前磁盘分区信息,还有一个200+GB的数据盘可以使用
sudo fdisk -l
2.发现有路径为/dev/vdb可以来挂载,使用fdisk命令进行磁盘挂载
sudo fdisk /dev/vdb
接下来进入交互界面,相关命令如下:
命令操作
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empt