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-2.26/disk-utils/fdisk-list.c.orig 2015-02-10 10:49:46.346584245 +0100
26 +++ util-linux-2.26/disk-utils/fdisk-list.c 2015-02-23 21:04:01.522730338 +0100
28 char *next_proc_partition(FILE **f)
31 + static char iobuf[32*1024];
34 *f = fopen(_PATH_PROC_PARTITIONS, "r");
36 warn(_("cannot open %s"), _PATH_PROC_PARTITIONS);
39 + setvbuf(*f, iobuf, _IOFBF, sizeof(iobuf));
42 while (fgets(line, sizeof(line), *f)) {