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

Michael Tautschnig mt at debian.org
Sat Sep 25 12:04:53 CEST 2010


> Michael Tautschnig <mt at debian.org> wrote:
> 
> Hi,
> 
> > 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
> 
> Nope, not that simple :)
> 
> I want one script per physical device, and the script must include any
> command that might be needed to recreate the partition table,
> filesystems and (I don't need that at the moment) LVM volumes. mdadm
> commands aren't needed in this context.
> 
> But that script must come out identical regardless of preserved
> partitions during installation (that requires some effort).
> 

But things shouldn't be too bad, at least given the current code (Toomas Tamm
doesn't like that :-) ) - even preserved partitions will be (re-)created by
parted commands. Ok, filesystems require some extra work, but then again I'm not
sure whether you actually want/need that - at least not in context of failing
RAID devices. For LVM the pvcreate commands will have to be executed.

> > 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
> 
> The goal is to have scripts in /tmp/fai that I can copy to /root or
> somewhere else that is safe (RAID1) *on the machine* so the sysadmins
> can just pull the failed drive, instert the new one, run the script,
> rebuild the RAID.
> 
> I have no guarantee the install logs will be available 4 years after the
> deployment when disks will fail :)
> 
> > 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.
> 
> It needs a bit more than that, as there are some mods needed so that
> preserving a partition still emits the necessary parted command in the
> script.
> 
> So you need at least 2 flags: log command and execute command.
> 

As said above: Should mostly just be the logging, and maybe do it as follows:

- Add a function that does logging
- Add a flag to push_command that causes the logging function to be called
- If commands are not pushed because of preserve being in effect, call the
  logging function directly.
  
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/2cbf0645/attachment.bin 


More information about the linux-fai-devel mailing list