linux磁盘分区的注意事项,分区和文件系统扩展前准备(Linux)

本文介绍如何使用parted命令修复GPT分区表,并利用Fix选项调整分区表备份位置及使用全部磁盘空间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

执行以下命令,指定一块磁盘,然后输入“p”,查看磁盘的分区形式。

parted 磁盘

以查看“/dev/vdb”的分区形式为例:

parted /dev/vdb

回显类似如下信息:[root@ecs-test-0001 ~]# parted /dev/vdb

GNU Parted 3.1

Using /dev/vdb

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) p

Error: The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system believes the

disk is smaller. Fix, by moving the backup to the end (and removing the old backup)?

Fix/Ignore/Cancel? Fix

Warning: Not all of the space available to /dev/vdb appears to be used, you can fix the GPT to use all of the space (an extra 104857600

blocks) or continue with the current setting?

Fix/Ignore? Fix

Model: Virtio Block Device (virtblk)

Disk /dev/vdb: 161GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Disk Flags:

Number Start End Size File system Name Flags

1 1049kB 107GB 107GB ext4 test

(parted)

“Partition Table”表示当前磁盘的分区形式,msdos表示磁盘分区形式为MBR,gpt表示磁盘分区形式为GPT。若系统出现以下Error,请输入“Fix”。Error: The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system believes the

disk is smaller. Fix, by moving the backup to the end (and removing the old backup)?

GPT分区表信息存储在磁盘开头,为了减少分区表损坏的风险,同时在磁盘末尾会备份一份。当磁盘容量扩大后,末尾位置也会随之变化,因此需要根据系统提示输入“Fix”,将分区表信息的备份文件挪到新的磁盘末尾位置。

若系统出现以下Warning,请输入“Fix”。Warning: Not all of the space available to /dev/vdb appears to be used, you can fix the GPT to use all of the space (an extra 104857600

blocks) or continue with the current setting?

Fix/Ignore? Fix

根据系统提示输入“Fix”,系统会自动将磁盘扩容部分的容量设置为GPT。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值