bsddisklabel and BLKRRPART
On Tue, 12 Oct 1999, Andrea Arcangeli wrote:
>>Second, it is a well known problem that either fdisk or the kernel (I think
>>it's just a missed out call to ioctl() in fdisk) will not re-scan the
>
>Reproduced here. I think it's the missing ioctl in fdisk after writing
>partitions to disk.
Here it is the fix (works fine here). Please merge it in the next
ulil-linux relases.
--- util-linux-2.9t/fdisk/fdiskbsdlabel.c.~1~ Sat May 1 13:31:05 1999
+++ util-linux-2.9t/fdisk/fdiskbsdlabel.c Wed Oct 13 00:42:50 1999
@@ -52,6 +52,7 @@
#include <sys/param.h>
#include <linux/hdreg.h> /* for HDIO_GETGEO */
+#include <sys/mount.h> /* BLKRRPART */
#include "common.h"
#include "fdisk.h"
@@ -769,6 +770,9 @@
printf (_("\nSyncing disks.\n"));
sync ();
sleep (4);
+ printf(_("Calling ioctl() to re-read partition table.\n"));
+ if (ioctl(fd, BLKRRPART) < 0)
+ perror("failed to reload the partiton table");
}
#if defined (i386) || defined (sparc)
Andrea
Reply to: