Home / Alt manpages / partprobe(8)

  • partprobe(8)
  • Admin command
  • linux

Rescan Partitions Safely with partprobe

You just changed a partition table with another tool and the kernel is still showing the old one, which is exactly the gap partprobe closes. This walks through a dry run, a targeted probe and a verification check with GNU parted 3.6 (package parted version 3.6-4build1), and takes about ten minutes.

  • Needs: a shell, the parted package, and the exact block-device path whose table changed.
  • Privileges: the real probe can need elevation; the read-only checks below do not.
  • Won't touch: partprobe creates, resizes and deletes nothing. It only tells the kernel about a table another tool already changed.

1. Confirm the installed command

Start with checks that need no sudo:

$ command -v partprobe
/usr/sbin/partprobe
$ partprobe --version
partprobe (GNU parted) 3.6
$ dpkg-query -W -f='${Package} ${Version}\n' parted
parted 3.6-4build1

The manual describes partprobe as a program that informs the kernel of partition table changes, using short Unix-style options with documented long equivalents. Leave the device off the command line and it probes everything, which is rarely what you want on a busy host.

Checkpoint

Identify the device itself, not one of its partitions.

$ lsblk -o NAME,TYPE,SIZE,RO,MOUNTPOINTS
NAME   TYPE  SIZE RO MOUNTPOINTS
DEVICE disk  ...

Replace DEVICE below with a real path such as /dev/sdb, read from lsblk, never guessed from an old inventory. A partition path such as /dev/sdb1 is not interchangeable with the whole disk whose table changed.

2. Preview the request

Reach for --dry-run when you're checking a script, reviewing a command or just confirming the device path. The manual defines it as not updating the kernel:

$ partprobe --dry-run /dev/DEVICE
$ printf 'exit status: %s\n' "$?"
exit status: 0

A successful dry run can print nothing at all. The useful result is the exit status: non-zero means the request was not accepted, so keep that diagnostic text rather than swapping it for a generic message.

Tip

A dry run is the safest first move on an unfamiliar host, since it never touches the kernel's view. It doesn't prove the real probe will succeed though; permissions, a busy device and the device's current state can still get in the way.

3. Probe only the changed device

Once the path is verified and the partitioning operation has finished, run a targeted probe:

$ sudo partprobe /dev/DEVICE
$ printf 'exit status: %s\n' "$?"
exit status: 0

Use elevated privileges only when the host demands them; if your account already has device access, drop sudo.

Example

On this machine, an unprivileged probe of /dev/sda reports Error: Error opening /dev/sda: Permission denied and exits 1. That's an access failure, not evidence the partition table is damaged.

Skip the reflex of running a broad, device-less probe on a busy production host. Naming the device limits the scope; the probe is still not a substitute for checking the earlier partitioning tool actually succeeded.

4. Ask for a partition summary

Add --summary when you want the command to describe the device and its partitions:

$ sudo partprobe --summary /dev/DEVICE
$ printf 'exit status: %s\n' "$?"
exit status: 0

The exact wording is device-dependent, so never script against a particular line or column of it. The manual promises a summary, not a stable machine-readable format; use the exit status for automation and a separate inventory command for structured inspection. You can combine both flags while testing:

$ sudo partprobe --dry-run --summary /dev/DEVICE
$ printf 'exit status: %s\n' "$?"
exit status: 0

Because --dry-run skips the kernel update, that combined form is a review step, not the final refresh.

5. Verify what Linux now sees

Once the real probe returns status 0, inspect the device with a separate command:

$ lsblk -o NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS /dev/DEVICE
NAME       TYPE  SIZE FSTYPE MOUNTPOINTS
DEVICE     disk  ...
DEVICE1    part  ...

Compare the names and sizes against the table you intended to create. A successful partprobe status only says the probe completed, it says nothing about whether your partitioning design was correct.

Warning

If a newly created partition still isn't visible, stop before formatting or mounting anything. Recheck the exact device path, inspect the partitioning tool's output and check kernel messages through your normal procedure. Don't repeatedly probe a path chosen from memory, and don't assume a missing partition is safe to recreate.

Common traps

  • Permission denied: rerun the same targeted command with the privilege your system needs, usually sudo. Don't escalate straight to a command-wide probe.
  • No output: can be normal for a successful probe. Check the exit status, then verify with lsblk, silence is not failure.
  • Wrong scope: omitting the device asks the command to probe everything. Name the changed device unless you have a reason to refresh the lot.
  • Confusing options: --dry-run suppresses the kernel update, --summary only requests display output. Neither one edits a partition table.

Warning

There's no undo for a successful probe, it doesn't reverse the partition-table change, so recovery belongs to whatever tool made that change: keep its records and backups. Formatting, mounting or touching a live service's storage path are separate, destructive, service-disrupting steps, never fold them into this workflow.

Done means

  • Checked the installed command and package version.
  • Identified the exact whole-device path with lsblk.
  • Ran a dry run before the real request where practical.
  • Confirmed status 0 on the targeted probe, elevating only when needed.
  • Verified the result independently, without formatting or recreating any partition.