On Tuesday 27 January 2004 16:10, Eric Sammons wrote:
> So if I am reading your email correctly, for the duration of an major
> update I would first "basically" update my master (as it is rw for
> everything). �Then each guest allocate a /usr filesystem that is throw
> away. �Mount that /usr as rw during the cloned guests updates. �After the
> updates I can simply unmount the rw throw away copy of /usr and mount the
> masters /usr as ro, which has already been updated? �Is this correct?

Almost. The disk that the one guest is writing to must not be one that
is mounted r/o on any other system or you get major data corruption.
Strictly speaking, there is not even a 'master' system, just one that
does the update first.

Note that your also should mount the new r/o /usr before unmounting
the rw copy.

An example session could look like this:

[ First guest ]
# mount
/dev/root on / type ext3 (rw)
/dev/dasd/1000/part1 on /home type ext3 (ro)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
# dd if=/dev/dasd/1000/part1 of=/dev/dasd/1001/part1
# mount -o rw /dev/dasd/1001/part1 /usr
# apt-get update ; apt-get dist-upgrade
...
# mount -o remount,ro /dev/dasd/1001/part1 ; sync
# cp /etc/fstab /etc/fstab.1000
# cat /etc/fstab.1000 | sed -e s:1000:1001:g > /etc/fstab

[ Any other guest ]
# mount
/dev/root on / type ext3 (rw)
/dev/dasd/1000/part1 on /home type ext3 (ro)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
# dd if=/dev/dasd/1000/part1 of=/dev/dasd/1002/part1
# mount -o rw /dev/dasd/1002/part1 /usr
# apt-get update ; apt-get dist-upgrade
...
# mount -o ro /dev/dasd/1001/part1
# cp /etc/fstab /etc/fstab.1000
# cat /etc/fstab.1000 | sed -e s:1000:1001:g > /etc/fstab
# /etc/init.d/xxx restart # ( whatever accesses dasd 1002 )
# umount /dev/dasd/1002/part1 || /sbin/reboot

Here, dasd 1000 is the old /usr, 1001 is the new /usr and 1002
is the scratch disk that is reused on every guest. Next time,
1001 and 1000 are swapped. Obviously, you could use some other
method for cloning the disk instead of dd, and use rpm/urpmi/...
instead of apt-get.

        Arnd <><

Reply via email to