How to reload partition tables on Linux

From Leo's Notes
Last edited on 30 December 2021, at 04:46.

After changing partition information on a disk, you might need to tell Linux to reload the partition tables in order for the device partitions (eg. /dev/sda1) to show up. Below are some options to tell Linux to re-read the partition information.

Ways to force Linux to re-read partition tables[edit | edit source]

Description Example
Use partprobe to reload partition tables on all disks, or partprobe $device to reload a specific device.
# partprobe
# partprobe /dev/sda
Use hdparm. hdparm -z $device.
# hdparm -z /dev/sda
Use partx. Alternatively, kpartx might also work, though that's usually used with device mappers.
# partx -a /dev/sda
# kpartx -a /dev/sda
Interface with the kernel directly and trigger a rescan of a specific block device.
# echo 1 > /sys/block/sda/device/rescan