[RFC] setup-storage: generate scripts for partition table (re)creation

Michael Tautschnig mt at debian.org
Sat Sep 25 11:31:58 CEST 2010


> Hi,
> 
> I have an idea for a small new feature in setup-storage, and I'm
> looking for some feedback to gauge interest. The idea is to generate a
> script for each device that can be used to recreate the partition table
> after the initial installation, should the need arise.
> 
> The use case is pretty simple: being able to replace a failed disk in a
> RAID setup.
> 

I was initially confused for a second: That's about software RAID, no need for
doing such things on HW RAID. But yes, AFAIK I have even found myself in such
situations already.

> With an msdos disk label, I just use sfdisk to do this, but I'm not
> aware of an equivalent tool for GPT disk labels. Parted unfortunately
> doesn't have an option to generate a parted script from an existing
> partition table (that I know of, at least).
> 
> Now, I can either write a tool that parses parted output to generate a
> script using parted commands, or I can add this feature to
> setup-storage.
> 
> Any thoughts?
> 

If done from within setup-storage, would it be as simple as to write all the
parted commands to a separate file (as well)? If so, wouldn't it be best to
really just print all the commands to be executed *such that this command script
ends up in the logs*? To me, logs sound like a good place for keeping this kind
of backup-information. If it really is just about logging the commands, the
question is whether all commands should be logged, or just a specific subset. If
the latter is the case, we could extend the setup-storage code that is used to
create commands to take a flag to enable or disable logging of the specific
command.

Best,
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
Url : http://lists.uni-koeln.de/pipermail/linux-fai-devel/attachments/20100925/e2e45c18/attachment.bin 


More information about the linux-fai-devel mailing list