The partprobe
command is used to inform the operating system kernel of partition table changes, without requiring a system reboot. This command is useful when a new partition is created or an existing partition is deleted or resized. By default, the Linux kernel does not automatically detect partition table changes, so the partprobe
command is necessary to notify the kernel of these changes.
Overview
The partprobe
command is used to rescan the partitions on a device and update the kernel’s partition table. This is useful when a new partition has been created, deleted or resized on a device, but the kernel is still using the old partition table. The partprobe
command can be used to update the kernel’s partition table without requiring a system reboot.
Syntax
partprobe [options] [devices...]
Examples
To rescan all partitions on all devices, use the following command:
sudo partprobe
To rescan partitions on a specific device, use the following command:
sudo partprobe /dev/sda
To rescan partitions on multiple devices, use the following command:
sudo partprobe /dev/sda /dev/sdb
Specific use cases
- When a new partition is created on a device, the
partprobe
command can be used to inform the kernel of the new partition. - When a partition is deleted or resized on a device, the
partprobe
command can be used to inform the kernel of the changes. - When a device is added or removed from the system, the
partprobe
command can be used to inform the kernel of the changes.
Options
The following table lists the available options for the partprobe
command:
Option | Description |
---|---|
-d, –dry-run | Print the actions that would be taken, but do not actually update the partition table. |
-h, –help | Display help information for the partprobe command. |
-s, –summary | Display a summary of the actions taken by the partprobe command. |
-v, –verbose | Display verbose output. |
Troubleshooting tips
- If the
partprobe
command fails to update the kernel’s partition table, try running the command with root privileges usingsudo
. - If the
partprobe
command reports an error, check the system logs for more information about the error. The system logs can be found in/var/log/messages
or/var/log/syslog
.
Notes
- The
partprobe
command only works with devices that use the MBR or GPT partitioning schemes. - The
partprobe
command does not work with devices that use other partitioning schemes, such as APM or BSD disklabels. - The
partprobe
command is included in theparted
package, which is installed by default on most Linux distributions.