Upgrading Slackware in chroot environment
by xj25vm from LinuxQuestions.org on (#6NYC3)
Hi all. I am trying to figure out a way to run a Slackware upgrade in a chroot environment. The plan would be something along these lines (bear in mind this is a server):
1. Make a copy of the entire file system (minus application data) in /chroot_sysupgrade
2. Setup the chroot environment by mounting /sys, /proc and /dev inside the /chroot_sysupgrade dir
3. Chroot into /chroot_sysupgrade
4. Run the upgrade
5. Check everything is working fine - at least everything I can check - such as starting upgraded packages
6. Exit chroot, move all files (minus data) from / to /old_install - or similar
7. Move the upgraded install from /chroot_sysupgrade directly into /
I am trying to figure out though which parts of the system I need to preserve from the old install. So far I have identified the following locations which need keeping from the old install, in the state they were before the upgrade:
1. /srv (I keep all the server data there)
2. /var - except for:
a. /var/lib/slackpkg
b. /var/log/packages
c. /var/log/removed_packages
d. /var/log/removed_scripts
all of which are modified during the upgrade
I assume most of /var from the old install needs keeping - as I would like the up to date logs of the running system, plus dhcp/dns state files and other similar data. Are there any other locations under /var which a Slackware system upgrade will modify - and should consider bringing over from the upgraded tree, instead of keeping from the old filesystem as it was before the upgrade?
Any hints of other things I might have missed would be greatly appreciated
The point of the above is to be able to test the upgrade and have an easy way back, but also to keep the server running during the upgrade and reconfiguration process - which can take quite a few hours.
1. Make a copy of the entire file system (minus application data) in /chroot_sysupgrade
2. Setup the chroot environment by mounting /sys, /proc and /dev inside the /chroot_sysupgrade dir
3. Chroot into /chroot_sysupgrade
4. Run the upgrade
5. Check everything is working fine - at least everything I can check - such as starting upgraded packages
6. Exit chroot, move all files (minus data) from / to /old_install - or similar
7. Move the upgraded install from /chroot_sysupgrade directly into /
I am trying to figure out though which parts of the system I need to preserve from the old install. So far I have identified the following locations which need keeping from the old install, in the state they were before the upgrade:
1. /srv (I keep all the server data there)
2. /var - except for:
a. /var/lib/slackpkg
b. /var/log/packages
c. /var/log/removed_packages
d. /var/log/removed_scripts
all of which are modified during the upgrade
I assume most of /var from the old install needs keeping - as I would like the up to date logs of the running system, plus dhcp/dns state files and other similar data. Are there any other locations under /var which a Slackware system upgrade will modify - and should consider bringing over from the upgraded tree, instead of keeping from the old filesystem as it was before the upgrade?
Any hints of other things I might have missed would be greatly appreciated
The point of the above is to be able to test the upgrade and have an easy way back, but also to keep the server running during the upgrade and reconfiguration process - which can take quite a few hours.