# Linux格式化数据盘
初始化,数据会丢失
[阿里云链接](https://help.aliyun.com/document_detail/25426.html?spm=5176.2020520101disk.0.0.2e284df5As3OxY#concept-jl1-qzd-wdb)
~~~
fdisk -l
~~~
创建分区
~~~
fdisk -u /dev/vdb
~~~
![](https://img.kancloud.cn/25/ab/25ab085adc7fc8370c3dca6c1509a4cb_475x621.png)
查看分区信息
~~~
fdisk -lu /dev/vdb
~~~
创建文件系统
~~~
mkfs -t ext4 /dev/vdb1
~~~
备份fstab
~~~
cp /etc/fstab /etc/fstab.bak
~~~
查看UUID
~~~
sudo blkid /dev/vdb1
~~~
写入UUID
~~~
sudo vi /etc/fstab
~~~
~~~
cat /etc/fstab
~~~
挂载
~~~
mount /dev/vdb1 /mnt
~~~
查看挂载结果
~~~
df -h
~~~