Question: /var is gone, now what?
Posted by pm on Thu 6 Oct 2005 at 12:16
This is another story to prove that you should have backup of the system burned on removable media. I had installed /var on separate drive and that drive died last night.
Question: is there any smart way to re-create /var structure?
Of course I can create folders hierarchy (/var/log, /var/run, etc.) or I can even copy /var from some other debian system, but how do I re-create /var/lib/dpkg/status to get apt running?
Not to mention all other applications that keep their data under /var. Any hints?
Brgds,Piotr
/admir trakic
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
[ Parent | Reply to this comment ]
Brgds,
Piotr
[ Parent | Reply to this comment ]
( Note: All of my /mnt/* dirs have a NOTHERE file in the directory if nothing is mounted there. To create, simply ' touch /mnt/zippy/NOTHERE ' before mounting anything to that dir. )
BEGIN /root/bin/bkpcrit:
#!/bin/sh
# Backup critical files (hopefully)
stime=`date`
dest='/mnt/zippy'
mount $dest
[ -e "$dest/NOTHERE" ] && echo "$dest NOT MOUNTED" && exit 99
# "If" checking for NOTHERE file...
dest=$dest'/bkpcrit-p500-hda6-knoppix26'
echo $dest = PK
read
mkdir -p -v $dest
# Copy this bkp script to zippy
cp $0 $dest
cp ~/localinfo.dat $dest
cp /etc/fstab $dest
cp /etc/inittab $dest
tar cpvzf $dest/bkp-ETC-debian.tar.gz /etc
tar cpvzf $dest/bkp-DEV-debian.tar.gz /dev
tar cpvzf $dest/bkp-root-debian.tar.gz /root
tar cpvzf $dest/bkp-davesrc-debian.tar.gz /home/dave/src
tar cpvzf $dest/bkp-davebin-debian.tar.gz /home/dave/bin
tar cpvzf $dest/bkp-usr-local-bin-debian.tar.gz /usr/local/bin
#tar cpvzf $dest/bkp-usr-local-src-debian.tar.gz /usr/local/src
tar cpvzf $dest/bkp-var-dpkg-status.tar.gz /var/lib/dpkg
tar cpvzf $dest/bkp-var-dpkg-backups.tar.gz /var/backups
#/var/adm/inst-log
# Dotfiles
cd /root
tar cpvzf $dest/bkp-root-dotfiles--restore-locally.tar.gz .[^.]*
cd /home/dave
tar \
--exclude='.kde/share/thumbnails' \
--exclude='.kde/share/cache' \
--exclude='.opera/cache4' \
--exclude=".mozilla/firefox/*.default/Cache" \
--exclude='.gqview' --exclude='.thumbnails' \
--exclude='.pan/*' \
-cpvzf $dest/bkp-dave-dotfiles--restore-locally.tar.gz .[^.]*
tar cpvzf $dest/bkp-usr-src-cfgs.tar.gz /usr/src/*.cfg
sync
ls $dest -al
df $dest
echo $stime' --> '`date`
exit
[ Parent | Reply to this comment ]