1 Mount has to read /proc/partitions in one gulp. It doesn't. Failed for me
2 after a hard powerdown (oops) and the resulting fsck-the-world frenzy on
3 startup, before the mount -a. Failure cause is identical (getting out of
4 sync with the text at the 1K boundary), but failure mode not quite so
5 drastic as it doesn't bail out like fsck does.
7 --- util-linux-2.11y/disk-utils/blockdev.c.procpartitions 2002-03-08 17:57:02.000000000 -0500
8 +++ util-linux-2.11y/disk-utils/blockdev.c 2003-01-13 14:28:41.000000000 -0500
13 + char iobuf[32*1024];
15 procpt = fopen(PROC_PARTITIONS, "r");
18 progname, PROC_PARTITIONS);
21 + setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
23 while (fgets(line, sizeof(line), procpt)) {
24 if (sscanf (line, " %d %d %d %[^\n ]",
25 --- util-linux-ng-2.17.2/fdisks/fdisk.c.orig 2010-03-22 09:21:34.000000000 +0100
26 +++ util-linux-ng-2.17.2/fdisks/fdisk.c 2010-05-09 12:31:53.050933394 +0200
27 @@ -343,6 +343,7 @@ static void print_all_devices_pt(struct
31 + char iobuf[32*1024];
33 f = fopen(_PATH_PROC_PARTITIONS, "r");
35 @@ -352,6 +353,8 @@ static void print_all_devices_pt(struct
37 DBG(FRONTEND, dbgprint("reading "_PATH_PROC_PARTITIONS));
39 + setvbuf(f, iobuf, _IOFBF, sizeof(iobuf));
41 while (fgets(line, sizeof(line), f)) {
42 char ptname[128 + 1], devname[256];