bsddisklabel and BLKRRPART


Subject: bsddisklabel and BLKRRPART
From: Andrea Arcangeli (andrea@suse.de)
Date: Tue Oct 12 1999 - 16:17:39 PDT


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

--
To UNSUBSCRIBE, email to debian-alpha-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



This archive was generated by hypermail 2a22 : Thu Nov 04 1999 - 16:56:58 PST