Re: extended partitions

Andries.Brouwer@cwi.nl
Thu, 5 Oct 1995 10:40:10 +0100


: > : >It is this line in genhd.c:
: > : >
: > : > /* prevent someone doing mkfs or mkswap on
: > : > an extended partition */
: > : > hd->part[minor].nr_sects = 0;
: > : >
: > : >Since nothing else depends on it, you can take it out.
: > : >But I think the advantages outweigh the disadvantages.

: How about just changing the 0 into a 1? That will still make mke2fs
: refuse to touch the partition, but it should allow LILO to write to the
: first sector (first 1k block, actually, but that's still better than
: writing a filesystem on the extended partition).

It would have to be a 2, since this counts sectors, not blocks.
Make it
if (hd->part[minor].nr_sects > 2)
hd->part[minor].nr_sects = 2;

: Or does somebody object to this particular approach?

Well, of course the objection is that it is not precisely right -
indeed, 1 would be precisely right, but if I am not mistaken
the kernel does not want to read or write a partial block.
But this is much better than nothing, and seems to be the best
we can come up with right now.

I might send you a patch today - there is another small thing
that can be improved in genhd.c.

Andries