华为云挂载磁盘及初始化数据盘(Linux)_华为服务器怎么挂载硬盘

Select (default p): p
Partition number (1-4, default 1): 

接下来每步均使用默认值,直接按“Enter”。

Partition number (1-4, default 1): 
First sector (2048-209715199, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199): 
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set

Command (m for help): 

输入“p”,按“Enter”,查看新建分区的详细信息。

Command (m for help): p

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
Disk label type: dos
Disk identifier: 0x3e9baf68

   Device Boot      Start         End      Blocks   Id  System
/dev/vdb1            2048   209715199   104856576   83  Linux

Command (m for help): 

输入“w”,按“Enter”,将分区结果写入分区表中。

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

执行以下命令,将新的分区表变更同步至操作系统。

partprobe

4.设置分区文件系统格式

执行以下命令,将新建分区文件系统设为系统所需格式。
mkfs -t 文件系统格式 /dev/vdb1

以设置文件系统为“ext4”为例:

mkfs -t ext4 /dev/vdb1

[root@Server-c00ef8c3

你可能感兴趣的:(程序员,服务器,linux,华为云)