quick C program to re-read a partition table on Linux:

#include <stdio.h>
#include <sys/ioctl.h>

#include <linux/fs.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main (int argc, char **argv) {
      int fd= open("/dev/hda",O_RDWR);
      ioctl (fd, BLKRRPART);
      ioctl (fd, BLKFLSBUF);
      close(fd);
}
 
wiki/linuxrereadpartitiontable.txt · Last modified: 21.04.2006 12:37 (external edit)