You are not logged in.

#1 2007-09-18 06:54:38

ristretto
Member
Registered: 2007-07-06
Posts: 50

Recovering with a Backup

Suppose I had backups of the following dirs

bin  boot  etc  home  lib  lost+found  media  opt  root  sbin  srv  usr  var

And my machine became totally unstuck.  Once I the machine is repaired (let's assume
it was a hardware problem), should I do the following

1.  Install Arch
2.  Replace all the dirs above on the fresh install with these dirs
3.  Reboot?

Or, should I be backing up something else, or following a different procedure?

Offline

#2 2007-09-18 12:55:18

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,961

Re: Recovering with a Backup

The folders you are likely to have customized files/settings are : /home /etc and /boot .
These should be backupped, although you may want to select specific /etc subfolders only.

The content of /bin , /lib , opt , /sbin and /usr is likely to change after almost any pacman -Syu .
Don't bother.

/var : most of this changes frequently , but there are 2 things that might be handy to backup once in a while :
  installed packages  in /var/cache/pacman/pkg
  logs in /var/log

/media is used to access temporarily mounted devices like cd and dvd.
Don't backup.

/srv : not sure what this holds, it's empty on my pc's.

/root : home folder for root-user. If you do a lot of work as root it can be useful to backup this.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2007-09-18 18:24:38

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: Recovering with a Backup

Also, /var/lib/pacman/local is essential to back up. If you don't have it, pacman doesn't know what packages are installed.

Offline

#4 2007-09-18 21:43:24

ristretto
Member
Registered: 2007-07-06
Posts: 50

Re: Recovering with a Backup

I'm hoping to backup enough, so as the minimize recovering time.

If I don't backup /bin, /lib, /opt, /sbin and /user, what would be the
recovery steps?

1.  Install Arch
2.  Recover personal data only /home, /etc, /boot, and /var/cache/pacman/pkg, /var/lib/pacman/local
3.  Run pacman -Syu
4.  Reinstall all my other apt into /opt
.  Reboot

(I put app I install not through pacman in /opt.  So, to rebuild fast, I shoudl probably back it up.)

thoughts?

Offline

#5 2007-09-21 10:50:25

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Recovering with a Backup

Hello,

I am in a similar situation. I have to clone my arch-system onto a new computer, on witch a minimal, outdated arch voodoo is installed. I have never done so, but following this Thread I will do it by the following steps.
1.  Install minimal Arch (done already)
2. Twinkle around to get net working
3. Run pacman -Suy (to get a recent version of the minimal system)
4. Recover personal data only /home, /var/cache/pacman/pkg, /var/lib/pacman/local , but not /boot or /etc. Since I put apps I install not through pacman in /usr/local, I will recover that too. (Btw. these stuff shouldn't be put to /opt, because of reasons you encounter now!)
5. Reinstall my stuff in /usr/local (or maybe put it away)
6. pacman -Suy (for the rest of the system, hoping the restored packages will be recognized)

If you are not in a hurry, you can wait till I can post my experiences here. I hopefully will perform these tasks on this weekend.

But I have a question: Can tar be told not to overwrite existing files?

Offline

#6 2007-09-21 11:40:11

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: Recovering with a Backup

just thinking out loud here, but if you installed a base system and do not intend to restore /usr, /bin and /lib, how wise would it be to replace /var/lib/pacman/local in the fresh install with the one from the install you're trying to restore?

Wouldn't this mean that pacman thinks you have a lot more packages installed then are actually there?


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#7 2007-09-21 12:01:12

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Recovering with a Backup

klixon wrote:

just thinking out loud here, but if you installed a base system and do not intend to restore /usr, /bin and /lib, how wise would it be to replace /var/lib/pacman/local in the fresh install with the one from the install you're trying to restore?

Wouldn't this mean that pacman thinks you have a lot more packages installed then are actually there?

You are right in pointing that out vfor /usr! The point is also valid for /opt.
But what is living in /bin and /lib ? Anything besides the stuff that gets installed with base?

Offline

#8 2007-09-21 12:43:24

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: Recovering with a Backup

The package-versions might differ on the pacman/local from the system you're trying te restore...
pacman -Su would reinstall those...
which in turn might give some .pac{new,save} files...
Also, if file-locations or -names changed, that might give problems with the uninstall-step of the upgrade process, but that might be a complete non-issue...

Last edited by klixon (2007-09-21 12:45:09)


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#9 2007-09-21 13:57:00

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Recovering with a Backup

klixon wrote:

The package-versions might differ on the pacman/local from the system you're trying te restore...
pacman -Su would reinstall those...
which in turn might give some .pac{new,save} files...
Also, if file-locations or -names changed, that might give problems with the uninstall-step of the upgrade process, but that might be a complete non-issue...

Thank you, Iwill keep that in mind!

Offline

#10 2007-09-22 07:56:10

mico
Member
From: Slovenia
Registered: 2004-02-08
Posts: 247

Re: Recovering with a Backup

I did it this way:

backup existing important stuff:
/boot/grub/menu.lst
/etc
/var/cache/pacman/pkg
/var/abs/local
/usr/local/bin
custom installed openoffice dictionaries in /opt/openoffice/share/dict/ooo
/home
also check if you want backup of some things in /var/lib like mysql database files, ...
or to be safe you could backup everything except /proc and decide later what you really want to preserve

pacman -Q >installed-pkgs.old

install only base new archlinux from ftp install cd

cp /mnt/dvd/pkg/* /var/cache/pacman/pkg
pacman -Q >install packages.new
install all missing packages that are in installed-pkgs.old but not in installed-pkgs.new
install any local stuff I had: custom packages built in /var/abs/local, stuff in /usr/local, OOo dictionaries that are not in repos

Now the hard work: compare old and new versions of /boot/grub/menu.lst and /etc with diff -ur and make appropriate changes.
If you have the same hardware and want same config you could probably just overwrite. Unlike with my old install, I chose encrypted filesystems so I wanted to make sure I don't overwrite anything by mistake.

Offline

#11 2007-09-22 08:50:30

robertp
Member
From: Warszawa, Poland
Registered: 2007-09-11
Posts: 123

Re: Recovering with a Backup

There is really no need  to install ArchLinux. There is easier and more correct way.

Just run Linux from bootable cd (may be ArchLinux install cd), mount partitions, uncompress backed up system directories (create /tmp, /proc, /sys if needed).
Then install GRUB/LILO (when using GRUB you may get away without this step). Usually this is done by chrooting into /myrootdirectory and running lilo or grub install program.

Offline

#12 2007-09-22 09:42:50

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: Recovering with a Backup

mico wrote:

install all missing packages that are in installed-pkgs.old but not in installed-pkgs.new
install any local stuff I had: custom packages built in /var/abs/local, stuff in /usr/local, OOo dictionaries that are not in repos.

That works to install all packages you had installed. The problem is that now every package is installed as "explicit", ie. dependencies are not installed as dependencies. Which means you can no longer 'pacman -Rs' to remove a package _and_ all it's dependencies, because the dependecies are no longer installed as such.


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#13 2007-09-22 10:04:57

mico
Member
From: Slovenia
Registered: 2004-02-08
Posts: 247

Re: Recovering with a Backup

True, I forgot about that. Actually I browsed the diff output and installed only the pkgs I need. Then I ran pacman -Q again and browsed the new diff output to see if I missed something. It was time consuming but since I went through effort of encrypting all partitions and making backups of everything, I thought I might also reinstall everything and get a fresh and clean system.

Offline

Board footer

Powered by FluxBB