Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

partprobe

Tell the kernel to read the partition table of a disk again.

Level
RHCSA exam
Group
Disks and file systems
Needs root
Yes
Package
parted

What it does

After you change partitions, the kernel must learn the new table. fdisk and parted try this themselves; when the disk is in use, the kernel may keep the old table. partprobe DEVICE asks again, so new partitions appear in /dev without a reboot.

How to write it

partprobe [-d] [-s] [DEVICE]...

Options 5

Most used

DEVICE
The disk to probe (all disks without a name).
-s, --summary
Show a summary of the partitions.
-d, --dry-run
Do not tell the kernel; only check.
-h, --help
Show help.
-v, --version
Show the version.

Examples 10

$ run as a normal user# run as root (or with sudo)

  1. 1After fdisk

    partprobe /dev/vdb
    lsblk /dev/vdb

    New partitions now have device files.

  2. 2Show what it found

    partprobe -s /dev/vdb
    /dev/vdb: gpt partitions 1 2 3

    Quick check.

  3. 3All disks

    partprobe

    Probes every disk.

  4. 4When it fails

    partprobe /dev/vda
    Error: Partition(s) 2 on /dev/vda have been written, but we have been unable to inform the kernel...

    The disk is busy (system disk). A reboot may be needed, or use partx.

  5. 5Alternative: partx

    partx -u /dev/vdb

    Updates only the changed partitions.

  6. 6Wait for udev to create the devices

    partprobe /dev/vdb; udevadm settle

    In scripts, before mkfs.

  7. 7Dry run

    partprobe -d -s /dev/vdb

    Test without changing anything.

  8. 8After growing a VM disk

    echo 1 > /sys/class/block/vdb/device/rescan; partprobe /dev/vdb

    The kernel learns the new disk size (for SCSI/virtio with rescan support).

  9. 9Check the result with the kernel view

    cat /proc/partitions

    The kernel's list of partitions.

  10. 10In an automated disk setup

    parted -s /dev/vdb mklabel gpt mkpart data xfs 1MiB 100% && partprobe /dev/vdb && mkfs.xfs /dev/vdb1

    Each step only when the step before worked.

Exit codes

0 :: Done. 1 :: Error.