Check out "parted". I have not used it myself, but it looks as though that is something that could be used for this. You can find it at TUCOWS Linux. -- Andrew