AWS EC2 mount volume

1. Check disk space

df -h

Insert picture description here
2. View available volume information

lsblk

Insert picture description here
3. Initialize the new volume

這個地方需要注意一下, 磁盤的格式, 比如我這裏是 xfs 有的是ext4  ext3。 可自行選擇
sudo mkfs -t xfs /dev/nvme2n1

Insert picture description here
4. Mount the volume

我這裏測試挂載到db, 可以直接挂載到根目錄下面
sudo mount /dev/nvme2n1 /db

Insert picture description here

5. Check the disk space
Insert picture description here
6. Check the UUID of the device

ls -al /dev/disk/by-uuid/

Insert picture description here
7. Check the disk type

df -T -h

Insert picture description here
8. Unmount the volume

umount -d /dev/nvme2n1

Insert picture description here
9. Expand the corresponding partition

sudo growpart /dev/nvme0n1 1

Insert picture description here

10. Expand the file system

sudo xfs_growfs /

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_38637558/article/details/108517709