rhcsa第八次作业

目录

今日作业:1.使用fdisk对/dev/nvme0n1剩余空间进行分区

2.新添加一块儿磁盘使用gdisk,设置gpt分区表,新建分区

3.使用parted对新添加的磁盘添加分区(交互式)

4.使用parted对/dev/nvme0n1新增分区(命令式)

5.挑选任一分区,进行格式化挂载(临时挂载)

6.挑选另一分区,进行格式化挂载(永久挂载


今日作业:
1.使用fdisk对/dev/nvme0n1剩余空间进行分区

[root@192 ~]# fdisk /dev/nvme0n1
Partition 4 has been deleted.

Command (m for help): n
Partition type
   p   primary (3 primary, 0 extended, 1 free)
   e   extended (container for logical partitions)
Select (default e): p

Selected partition 4
First sector (41781248-41943039, default 41781248): 
Last sector, +sectors or +size{K,M,G,T,P} (41781248-41943039, default 41943039): +50m

Created a new partition 4 of type 'Linux' and of size 50 MiB.

Command (m for help): 


2.新添加一块儿磁盘使用gdisk,设置gpt分区表,新建分区

Command (m for help): gdisk
Created a new GPT disklabel (GUID: 3F6BA327-B0FD-774F-9B41-A5BB486DDA2C).
The old dos signature will be removed by a write command.

Command (m for help): n
Partition number (1-128, default 1): 1
First sector (2048-41943006, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943006, default 41943006): +1M

Created a new partition 1 of type 'Linux filesystem' and of size 1 MiB.
Partition #1 contains a xfs signature.

Do you want to remove the signature? [Y]es/[N]o: y

The signature will be removed by a write command.

Command (m for help): 


3.使用parted对新添加的磁盘添加分区(交互式)

[root@localhost ~]# parted /dev/nvme0n1p1
GNU Parted 3.2
Using /dev/nvme0n1p1
Welcome to GNU Parted! Type 'help' to view a list of commands.                                                                                                       
(parted) mkpart                                                         
Partition name?  []? dp2                                                
File system type?  [ext2]? ext4                                          
Start? 0                                                                 
End? 100M                                                       
(parted) p                                                                
Model: NVMe Device (nvme)
Disk /dev/nvme0n1p1: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name  Flags
 1      17.4kB  100MB  100MB  ext4         dp2

(parted) q                                                                


4.使用parted对/dev/nvme0n1新增分区(命令式)

[root@localhost ~]# parted /dev/nvme0n1p1 mkpart primary 100M 200M      


5.挑选任一分区,进行格式化挂载(临时挂载)

[root@localhost ~]# mkfs -t xfs /dev/nvme0n1p1


6.挑选另一分区,进行格式化挂载(永久挂载

[root@localhost ~]# vim /etc/fstab

你可能感兴趣的:(linux,运维,服务器)