大网数据广告活动
服务器运维问答

Ubuntu - unable to extend partition with growpart - partition 1 could only be grown by 2046

· 52CE 我爱测

I want to extend /dev/sdb1 partition I extended disk for 2 GB in Hypervisor and new disk size is shown for /dev/sdb disk (from 20 to 22 GB) Device Boot Start End Sectors Size Id Type /dev/sdb1 * 2048 40894463 40892416 19.5G 83 Li…

问题原文

原帖链接 · overflowed · CC BY-SA 4.0

I want to extend /dev/sdb1 partition

I extended disk for 2 GB in Hypervisor and new disk size is shown for /dev/sdb disk (from 20 to 22 GB)

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sdb1  *        2048 40894463 40892416 19.5G 83 Linux
/dev/sdb2       40896510 41940991  1044482  510M  5 Extended
/dev/sdb5       40896512 41940991  1044480  510M 82 Linux swap / Solaris

But getting partition 1 could only be grown by 2046 [fudge=2048]

growpart -v /dev/sdb 1
update-partition set to true
resizing 1 on /dev/sdb using resize_sfdisk_dos
46137344 sectors of 512. total size=23622320128 bytes
## sfdisk --unit=S --dump /dev/sdb
label: dos
label-id: 0x000467a9
device: /dev/sdb
unit: sectors

/dev/sdb1 : start=        2048, size=    40892416, type=83, bootable
/dev/sdb2 : start=    40896510, size=     1044482, type=5
/dev/sdb5 : start=    40896512, size=     1044480, type=82
max_end=40896510 tot=46137344 pt_end=40894464 pt_start=2048 pt_size=40892416
NOCHANGE: partition 1 could only be grown by 2046 [fudge=2048]

已采纳解答

原帖链接 · sfl0r3nz05 · CC BY-SA 4.0

You need to remove/move /dev/sdb2 and /dev/sdb5.

  1. Use sudo cfdisk /dev/sdb to select partitions and delete/modify them.
  2. Extend a partition in a partition table to fill available space: sudo growpart /dev/sdb 1.
  3. Enlarge the mounted file system: sudo resize2fs /dev/sdb1.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-04-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。