When I want Linux to consider newly created partitions without rebooting, I have several tools available to force a refresh of the kernel "partition cache":
partx -va /dev/sdX
kpartx -va /dev/sdX
hdparm -z /dev/sdX
blockdev --rereadpt /dev/sdX
sfdisk -R /dev/sdX
(deprecated)partprobe /dev/sdX
- ...
I'm not sure about the difference between these techniques, but I think they don't use the same ioctl
, like BLKRRPART
or BLKPG
. So, what is the difference between those ioctl
?
kpartx
is derived frompartx
,sfdisk
is another partition edit tool.hdparm
is for other uses, but also has a way to read partition table into kernel. If you really need to know, then look at the source code. – ctrl-alt-delor Jul 09 '14 at 09:13