LinuxCommandLibrary

partprobe

Update kernel's partition table without rebooting

TLDR

Notify the operating system kernel of partition table changes

$ sudo partprobe
copy

Notify the kernel of partition table changes and show a summary of devices and their partitions
$ sudo partprobe --summary
copy

Show a summary of devices and their partitions but don't notify the kernel
$ sudo partprobe --summary --dry-run
copy

SYNOPSIS

partprobe [-d] [-s] [disk...]

PARAMETERS

-d
    Don't call ioctl to re-read partition table. This is useful when the kernel doesn't support re-reading the partition table or when you want to avoid potential problems with the kernel's partition table handling.

-s
    Only report what partitions would be added or changed without actually making any changes to the system. This is a dry-run mode.

disk...
    Specifies the disk(s) to probe. If no disk is specified, partprobe will attempt to probe all disks.

DESCRIPTION

The partprobe command is used to inform the operating system kernel about changes to a disk's partition table. This is crucial after you've made modifications to the partitions of a drive using tools like fdisk, gdisk, or parted.

Without running partprobe (or rebooting the system), the kernel might continue to use the old partition table, leading to data corruption or unexpected behavior when accessing partitions. partprobe essentially tells the kernel to reread the partition table from the specified disk(s), ensuring that the system is aware of the current partition layout. The command can also be used to create device nodes under /dev, which represent the partitions. partprobe is particularly important in scenarios where the kernel's partition table cache is outdated. Its usage generally resolves errors when partitions are created, deleted, or resized.

It is recommended to use partprobe after any partition-related operation to avoid inconsistencies between what the user expects and how the operating system interprets the disk's layout. When no disk is specified, it will scan all disks on the system.

CAVEATS

Using partprobe incorrectly or on the wrong disk can potentially lead to data loss. Always double-check the disk names before running the command. Sometimes, a reboot is still necessary to guarantee that the changes are fully applied.

EXIT STATUS

partprobe returns 0 on success and non-zero on failure.

EXAMPLES

  • To probe /dev/sdb: partprobe /dev/sdb
  • To probe all disks: partprobe
  • To do a dry run on /dev/sdc: partprobe -s /dev/sdc

HISTORY

The partprobe command has been part of the util-linux package for many years and has evolved alongside the Linux kernel's handling of partition tables. It was created to address the need to update the kernel's view of partitions without requiring a full system reboot. Its importance has grown with the increasing complexity of storage devices and partitioning schemes.

SEE ALSO

fdisk(8), gdisk(8), parted(8), kpartx(8)

Copied to clipboard