CentOS7.8格式化分区并挂载到指定目录

需求:将安装了CentOS7.8系统的虚拟机中的一块未使用的分区进行格式化并挂载到指定目录

1、查看虚拟机中所有磁盘:fdisk -l

通过命令可以看到有2块磁盘,第一块是磁盘/dev/vda,下面已经有/dev/vda1分区(安装系统的分区);第二块是磁盘/dev/vdb,下面没有分区(需要对这块磁盘进行分区)。

2、执行分区命令:fdisk /dev/vdb

依次输入这些命令:n->p->1->回车->回车->w

3、将新建的/dev/vdb1分区格式化为xfs文件格式:mkfs -t xfs /dev/vdb1

4、建立/www文件夹:mkdir -p /www

5、将新建的/dev/vdb1分区永久挂载到/www文件夹:echo '/dev/vdb1 /www xfs defaults 0 0' >> /etc/fstab

6、重新加载fstab文件中的内容(让vdb1分区可以用起来):mount -a

上一篇: Nginx限速操作
下一篇: 迁移后的VPS性能差了好多

发表评论


数据库出错:

MySQL Query Error
Mysql error description: Table './blog_is36_com/sablog_sessions' is marked as crashed and should be repaired
Mysql error number: 145
Date: 2024-06-04 @ 08:29
Script: http://blog.is36.com/index.php/module/action/param1/archives/archives/438/page/7/page/2/category/technology_all/user/%E6%AD%A3%E5%86%B0/user/%E6%AD%A3%E5%86%B0/tagslist/wap/comments/tagslist/links/comments/wap/include/jscript/comments/archives/490/https:/blog.is36.com/index.php/module/action/param1/archives/archives/438/page/7/page/2/category/technology_all/user/%E6%AD%A3%E5%86%B0/user/%E6%AD%A3%E5%86%B0/tagslist/wap/comments/tagslist/links/comments/wap/include/jscript/comments/archives/490/page/57/?action=show&id=489