Now that there was some interest in such a program, I yesterday
wrote a little program, partx, that is willing to add or remove
the partitions the kernel knows about.
See ftp://ftp.cwi.nl/pub/aeb/partx-tst.tar.gz .
(In util-linux one already finds the skeleton programs
addpart and delpart. Now addpart allows you to say
# ./addpart /dev/hde 12 1000000 20000
and have a new hde12:
# grep hde /proc/partitions
33 0 35673120 hde
33 12 10000 hde12
(starting at sector 1000000, and 20000 sectors large).
And delpart removes it again:
# ./delpart /dev/hde 12
In case /dev/hde already has a partition table, we can
read that:
# ./partx -a /dev/hde
# grep hde /proc/partitions
33 0 35673120 hde
33 1 96358 hde1
33 2 6136830 hde2
33 3 31 hde3
33 4 835380 hde4
33 5 28603701 hde5
Note: this is not fdisk, these programs do not write
anything to disk but just tell the kernel how the disk
is partitioned. For the time being overlap is not allowed.
Today these are just throwaway programs, but in case this
is useful, the kernel and user space sides can be improved
to do whatever people need at installation time or at boot time.
Comments are welcome.)
Andries - aeb@cwi.nl
-
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/
This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:37 EST