← 返回命令列表

Linux command

addpart 命令

文件

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

常用示例

Example

addpart [device] [partition] [start] [length]

说明

addpart is a simple wrapper around the "add partition" ioctl that notifies the Linux kernel about a partition that exists on disk but was not detected automatically. This is useful when partition tables are modified while the disk is in use, or when the kernel's partition scanning missed an entry during boot. The command only updates the kernel's in-memory partition table; it does not create or modify the actual partition table on disk.

参数

device
The block device containing the partition (e.g., /dev/sda)
partition
The partition number to add
start
The starting sector of the partition
length
The length of the partition in sectors

FAQ

What is the addpart command used for?

addpart is a simple wrapper around the "add partition" ioctl that notifies the Linux kernel about a partition that exists on disk but was not detected automatically. This is useful when partition tables are modified while the disk is in use, or when the kernel's partition scanning missed an entry during boot. The command only updates the kernel's in-memory partition table; it does not create or modify the actual partition table on disk.

How do I run a basic addpart example?

Run `addpart [device] [partition] [start] [length]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does device do in addpart?

The block device containing the partition (e.g., /dev/sda)