CRUX : Home

Home :: Documentation :: Download :: Development :: Community :: Wiki :: Ports :: Bugs :: Links :: About

Back to wiki start page Categories: Install

How to upgrade CRUX with minimum downtime

Author

20081231 Clemens Koller
Status:
20090106 Initial release, please verify and report bugs/suggestions.
20091011 Update for CRUX v2.5 -> v2.6; replace version numbers as necessary.

Description

Sometimes, there is no possiblitity to insert a CD or plug an USB-Memory into a machine or boot from any media since the machine is i.e. a hosted server. Nevertheless it would be nice to install and use CRUX on this machine by doing a live-migration or live-update of the system without going offline for a long time. This idea is somehow similar to a plain network-install. We just take the packages from the .ISO by mounting the image, chroot into, unsquashfs, update/install in the working system or right next to the working system on a separate partition.

Notes:

Instructions

Download and verify the latest CRUX .iso Image:

  $ wget ftp://code-monkey.de/pub/crux/latest/iso/crux-2.5.iso
  $ md5sum crux-2.5.iso
  54e68aa01011d98cc13ae01a11b62bff  crux-2.5.iso

mount the .iso image:

  $ mkdir /mnt/iso
  $ mount -o loop crux-2.5.iso /mnt/iso
  $ ln -s /mnt/iso /cdrom

unsquash the squashfs in the .iso image:

  $ cd /mnt
  $ unsquashfs iso/crux.squashfs

copy (or link?) the content of crux to the squashfs:

  $ cd /mnt/squashfs-root
  $ mkdir cdrom
  $ cp -a ../iso/crux cdrom

or for CRUX v2.4 -> v2.5:

  $ mkdir -p cdrom/crux && mount --bind ../iso/crux cdrom/crux

and for CRUX v2.5 -> v2.6 (thanks to Pedja for reporting this):

  $ mkdir -p media/crux && mount --bind ../iso/crux media/crux

chroot into it:

  $ mount --bind /dev /mnt/squashfs-root/dev
  $ mount --bind /tmp /mnt/squashfs-root/tmp
  $ mount -t proc proc /mnt/squashfs-root/proc
  $ mount -t sysfs none /mnt/squashfs-root/sys
  $ chroot /mnt/squashfs-root/ /bin/bash

mount target root to /mnt and run CRUX setup:

  $ mount /dev/hda1 /mnt
  $ setup

Setup should work nicely... finishing with:

  * CRUX 2.4 -> 2.5 setup-helper
  Package removed:  mktemp
  Package removed:  hotplug
  Package removed:  inetd
  Package removed:  netkit-ftp
  Package removed:  netkit-telnet
  Package removed:  slocate
  Package injected: inetutils
  Package injected: libpcre
  Package injected: libgmp
  Package injected: libmpfr
  Package injected: mlocate
  Package injected: sqlite3

Then, leave the chroot and run rejmerge to upgrade the config files etc.:

  $ exit
  $ rejmerge

Run revdep to to find any broken packages/libraries and fix them by recompiling them in proper order according to their dependencies:

  $ revdep
  apache
  apr
  rrdtool
  subversion

Cross fingers and - reboot.