阿里云CentOS 7系统挂载SSD云盘的教程
程序员文章站
2023-11-09 11:47:46
一、查看ssd云盘
sudo fdisk -l
disk /dev/vda: 42.9 gb, 42949672960 bytes, 83886080...
一、查看ssd云盘
sudo fdisk -l disk /dev/vda: 42.9 gb, 42949672960 bytes, 83886080 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes disk label type: dos disk identifier: 0x635e6c7d device boot start end blocks id system /dev/vda1 2048 83886079 41942016 83 linux disk /dev/vdb: 107.4 gb, 107374182400 bytes, 209715200 sectors units = sectors of 1 * 512 = 512 bytes sector size (logical/physical): 512 bytes / 512 bytes i/o size (minimum/optimal): 512 bytes / 512 bytes
可以看到ssd系统已经识别为/dev/vdb
二、格式化云盘
sudo mkfs.ext4 /dev/vdb mke2fs 1.42.9 (28-dec-2013) filesystem label= os type: linux block size=4096 (log=2) fragment size=4096 (log=2) stride=0 blocks, stripe width=0 blocks 6553600 inodes, 26214400 blocks 1310720 blocks (5.00%) reserved for the super user first data block=0 maximum filesystem blocks=2174746624 800 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872 allocating group tables: done writing inode tables: done creating journal (32768 blocks): done writing superblocks and filesystem accounting information: done
三、挂载
sudo mount /dev/vdb /opt
将云盘挂载到/opt目录下。
四、配置开机自动挂载
修改/etc/fstab文件,文件末尾添加
/dev/vdb /opt ext4 defaults 0 0
五、重启检查
使用
init 6
优雅的重启系统。
使用
sudo df -h filesystem size used avail use% mounted on /dev/vda1 40g 3.6g 34g 10% / devtmpfs 1.9g 0 1.9g 0% /dev tmpfs 1.9g 0 1.9g 0% /dev/shm tmpfs 1.9g 8.4m 1.9g 1% /run tmpfs 1.9g 0 1.9g 0% /sys/fs/cgroup /dev/vdb 99g 61m 94g 1% /opt tmpfs 380m 0 380m 0% /run/user/1000
可以看到系统已挂载了ssd云盘。
总结
以上就是阿里云centos 7挂载ssd云盘方法的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。