[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: a cautionary tale w/ successful recovery



On 20091107_090413, Alex Samad wrote:
> On Fri, Nov 06, 2009 at 11:40:06AM -0700, Paul E Condon wrote:
> > On 20091104_075158, Paul E Condon wrote:
> > > On 20091103_114547, Boyd Stephen Smith Jr. wrote:
> > > > On Tuesday 03 November 2009 10:38:41 Johannes Wiedersich wrote:
> > > > > Andrew Sackville-West wrote:
> > > > > > On Sun, Nov 01, 2009 at 07:08:00PM -0500, Andrew Reid wrote:
> > > > > >>   For the sysems I back up at work, we do the dpkg --get-selections
> > > > > >> thing, but I've never kept a copy of the boot sector -- that's an
> > > > > >> excellent idea.
> > > > >
> > > > > I guess the 'state of the art' way of recording a list of installed
> > > > > packages, nowadays is
> > > > >
> > > > > # aptitude -F "%p" search '~i!~M' > package-list
> > > > >
> > > > > You can then just install like
> > > > >
> > > > > # aptitude install $(cat pacage-list)
> > > > >
> > > > > dpkg --get-selections does not distinguish between packages installed
> > > > > manually or automatically, so that information is lost on the reinstall.
> > > > >  The search pattern just looks for packages that were installed
> > > > > manually. The install will automatically install all dependencies.
> > > > 
> > > > However, because of OR dependencies (i.e. using the '|' character), it might 
> > ... snip ...
> > 
> > > > packages", and some combination of dpkg --set-selections, aptitude markauto, 
> > > > and aptitude install should be able to restore them.
> > > 
> > > My suggestion is:
> > > 
> > > # aptitude -F "%p %M" search '~i' |tr -s ' '|sed 's/ A$/+M/' > package-list
> > > 
> > > followed by (without change except for fixing the missing "k" ;-) 
> > > 
> > > # aptitude install $(cat package-list)
> > > 
> 
> [snip]
> 
> > Conclusion: I'm happy with this way of preparing a file that automates
> > the reconstruction of a whole host system. I'll be using it whether or
> > not my nits can be dealt with in some general way.
> 
> 
> can you please provide the steps you need for this
> 
> I have 
> aptitude -F "%p %M" search '~i' |tr -s ' '|sed 's/ A$/+M/' >>
> /var/backups/package-list
> 
> but what about the package config information ??? how do I save that 

This hack is _not_ a full backup system. You need a backup system that
backs up all your personal files _and_ all the system files that you
have configured. The genesis of this thread was the question: what to
do, in addition to that, in order to record what software packages
were installed? For that question, I have heard several suggestions,
e.g. dpkg --get-selections.

Most backups systems that I have looked at don't specify what,
exactly, should be backed-up. I believe that the great bulk of files
in /var are not important to me when I am rebuilding a crashed
system. Or rebuilding a system that I have so messed up, that I have
decided to do a reinstall. So, I think that putting something that is
important to me in /var is not so good an idea. The suggestion to put
packages-list in /etc/apt seems better to me. But, on my systems, I
actually put it into /root/package-list, because I am already doing a
full backup of /root, daily.

For rebuilding, after doing a netinstall, I use
# aptitude install $(cat /db2/<...>/root/package-list )
where <...> is a long string to where the backup files are actually kept.

Then I overwrite /etc with:
# cp -a /db2/<...>/etc/* /etc

This overwrites all the config stuff that was just built by aptitude
with the original config from that file backup on disk /db2

But it doesn't quite work, as was explained earlier.

-- 
Paul E Condon           
pecondon@mesanetworks.net


Reply to: