Help Articles
search
Graphical tutorial on viewing, partitioning and mounting Linux system hard disks
Category: Linux system related
author: Jack
Time: 2024-11-04
Read: 344

Linux系统查看硬盘一般都使用“df”命令查看,但是看到的是已经分区了的硬盘分区,并不包括未分区的硬盘。

这时我们可以用“fdisk -l”来查看未分区硬盘。未分区的硬盘的名称为/dev/sdb,有5G未分区的,如下图:

1.对未分区硬盘盘进行分区:

执行“fdisk /dev/sdb”命令,对数据盘进行分区;根据提示,依次输入“n”,“p”“1”,两次回车,“wq”,分区开始了,很快就会完成。

2.对新分区格式化:

使用“mkfs.ext3 /dev/sdb1”命令对新分区进行格式化,格式化的时间根据硬盘大小有所不同。

3.添加分区信息:

使用“echo '/dev/sdb1  /mnt ext3    defaults    0  0' >> /etc/fstab”命令写入新分区信息。

然后使用“cat /etc/fstab”命令查看,出现以下信息就表示写入成功。如下图:

4.挂载新分区

使用“mount -a”命令挂载新分区,然后用“df -h”命令查看,出现以下信息就说明挂载成功,如下图:

上一篇:Method for migrating the system disk to the data disk of CentOS6.x/7.x on Linux Pagoda Panel
下一篇:How to solve Windows Server 2012 R2 remote desktop connection error (the remote session was interrupted because there is no remote desktop authorization server to provide a license. Please contact the server administrator)
Customer Service
Pre sales consultation
在线客服
after-sale service
24/7 operation and maintenance
运维客服
Feedback
Complaints and Suggestions
投诉与建议
置顶