Linux基础(维护基本存储空间)

1.使用fdisk对/dev/nvme0n1剩余空间进行分区


 
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type
   p   primary (2 primary, 0 extended, 2 free)
   e   extended (container for logical partitions)
Select (default p): 
 
Using default response p.
Partition number (3,4, default 3): 3
First sector (41590784-41943039, default 41590784): 
Last sector, +sectors or +size{K,M,G,T,P} (41590784-41943039, default 41943039): 
 
Created a new partition 3 of type 'Linux' and of size 172 MiB.
 
Command (m for help): p
Disk /dev/nvme0n1: 20 GiB, 21474836480 bytes, 41943040 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
Disklabel type: dos
Disk identifier: 0xd9a564d3
 
Device         Boot    Start      End  Sectors  Size Id Type
/dev/nvme0n1p1 *        2048  1026047  1024000  500M 83 Linux
/dev/nvme0n1p2       1026048 41590783 40564736 19.4G 8e Linux LVM
/dev/nvme0n1p3      41590784 41943039   352256  172M 83 Linux

2.新添加一块儿磁盘使用gdisk,设置gpt分区表,新建分区3.使用parted对新添加的磁盘添加分区(交互式)


GNU Parted 3.2
Using /dev/nvme0n2
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mkpart 2ndGPT 316M 632M
(parted) p                                                                
Model: NVMe Device (nvme)
Disk /dev/nvme0n2: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
 
Number  Start   End    Size   File system  Name       Flags
 1      1049kB  316MB  315MB               Linux LVM  lvm
 2      316MB   632MB  317MB               2ndGPT
 
(parted) quit                                                             
Information: You may need to update /etc/fstab.
 

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

 

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

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

 

 reboot重启后可以看见已经自动挂载了

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值