unattended disk clone

Adrian Wontroba aw1 at stade.co.uk
Thu Nov 2 03:30:40 GMT 2006


On Wed, Nov 01, 2006 at 11:49:19PM +0000, Spadge wrote:
> Chris Whitehouse wrote:
> >I'm running dump/restore in a script to clone disks. For each partition 
> >restore stops and asks me if I want to
> >set owner/mode for '.'? [y/n]
> >Can I somehow avoid this prompt so that the script is completely 
> >automatic? I'm sure the answer ought to be simple and obvious but I 
> >can't see it.
>      -r      Restore (rebuild a file system).  The target file system 
> should be made pristine with newfs(8), mounted and the user cd(1)'d into 
> the pristine file system before starting the restoration of the initial 
> level 0 backup.  If the level 0 restores successfully, the -r flag may 
> be used to restore any necessary incremental backups on top of the level 
> 0.  The -r flag precludes an interactive file extraction and can be 
> detrimental to one's health if not used carefully (not to mention the disk).
> 
> Is that what you're doing? What flags are you using in the dump/restore 
> script?

This fragment from a make file (don't ask!) works without asking
questions:
dump -L -C 32 -0 -f- $$f | (cd /mnt$$f; restore -r -f- ) ; \

A quick look at the source for restore makes me think that it will only
ask this question if running with -i or -x.

-- 
Adrian Wontroba




More information about the Ukfreebsd mailing list