Re: partition table rereading

Jakub Jelinek (jj@sunsite.ms.mff.cuni.cz)
Sat, 3 Apr 1999 16:43:05 +0200 (CEST)


>
> jj writes:
>
> : In fact, BLKRRPART could be improved: currently you get EBUSY if some
> : partitions of the disk are used. But if the partitions which are busy
> : have not changed at all (and kept the same number), then I think there
> : is no reason not to succeed. It will require some additional code
> : (checking if the busy partitions have the same start/length in kernel
> : tables and in the new partition table), but IMHO is worth doing that.
>
> I am not so sure this is very useful in practice -
> think it would help only in a few cases.

It happened to me several times already. If you have large disk and your
root partition on it and want to repartition the rest, you'd otherwise have
to reboot...
>
> The code for checking whether a reread can be done without harm
> will be messy (with the danger of races). Probably it is better
> to do this from user space. With routines
> add_partition(int devfd, int start, int length, char *name, int flags)
> del_partition_by_start(int devfd, int start, int flags)
> del_partition_by_name(int devfd, char *name, int flags)
> with devfd referring to the entire disk,
> we need not check all possible uses of the disk, but add_partition()
> needs only check that there is no overlap with any existing partition,
> and del_partition() needs only check that this partition exists and
> is not in use.
>
> This looks clean and powerful: able to cope with foreign
> partition table types and disks without any partition table.

I completely agree with this. Probably some ioctl (e.g. BLKRR1PART) with
some structure describing what to do.
If I find some time for it, I'll try to code something and come with it back
to you.

Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux | http://ultra.linux.cz/ | http://ultra.penguin.cz/
Linux version 2.2.5 on a sparc64 machine (3958.37 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/