← 返回命令列表

Linux command

growpart 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Extend

growpart /dev/sdX [n]

Example

growpart -N /path/to/disk.img [n]

说明

growpart extends a partition to fill available free space following it on a disk. It is commonly used after enlarging a virtual disk or cloud volume to make the added space available to the partition. The tool works with both physical disks (like /dev/sda) and disk image files. It automatically handles partition table updates for both MBR and GPT partition schemes. After growing a partition, you typically need to resize the filesystem within it using tools like resize2fs (ext4), xfs_growfs (XFS), or btrfs filesystem resize (Btrfs).

参数

-N, --dry-run
Show what would be done without making changes
-u, --update _TYPE_
Update type: auto, growfs, off
-v, --verbose
Enable verbose output
-h, --help
Display help message

FAQ

What is the growpart command used for?

growpart extends a partition to fill available free space following it on a disk. It is commonly used after enlarging a virtual disk or cloud volume to make the added space available to the partition. The tool works with both physical disks (like /dev/sda) and disk image files. It automatically handles partition table updates for both MBR and GPT partition schemes. After growing a partition, you typically need to resize the filesystem within it using tools like resize2fs (ext4), xfs_growfs (XFS), or btrfs filesystem resize (Btrfs).

How do I run a basic growpart example?

Run `growpart /dev/sdX [n]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -N, --dry-run do in growpart?

Show what would be done without making changes