Imre Oolberg wrote:
Hallo!
I would be thankful if somebody comments on the following sequence to
upgrade OpenBSD system. The main purpose is to make an upgrade with as
little downtime as possible and to have a way to return to the last
known working state. Essentially it involves creating temporary
dual-boot environment
1. Computer works and there is one file system big enough to
accomodate whole new system and is not currently actively used,
say /tmp ie /tmp's place is temporarily on / file system. umount
/tmp and mount under /mnt
2. Untar new file sets using 'suf="42.tgz"; for i in etc base comp
man misc; do tar -C /mnt -xzphf ${i}${suf}; done and /bsd kernel
3. Create devices like cd /mnt/dev and ./MAKEDEV all
4. copy/customize /mnt/etc, 'diff -r /etc /mnt/etc' | less (look out
for fstab, motd, hosts, hostname.if etc)
5. chroot /mnt and add extra software using pkg_add and applying patches
6. reboot the system entering at the console boot> prompt with
something like 'boot hd0d:/bsd -a'
7. when new system works ok, empty old filesystems and copy new
contents from working system, say with 'tar cf - /usr | tar -C
/old-usr-mountpoint -xf -' etc and reboot
If fact i tried this one (except chroot and last step) and it seems to
work all right but maybe there is something to look out for? In my case
i also moved from i386 to amd64 and so i had to boot from cd42.iso to
enter 'boot hd0d:/bsd -a' and obiously need in the end install new boot
loading code into MBR.
Best regards
Imre
PS for some reason i had to press enter twice at the end of swap device line
....
dkcsum: sd0 matches BIOS drive 0x80
root device (default sd0d):
swap device (default sd0b):
root on sd0d swap on sd0b dump on sd0b
My way is to use grub.
Has to do with the way OpenBSD default label reads and allocates the
labels in it's default install.
(I never could edit a disklabel correctly).
What I do is to partition the disk to have a second OpenBSD disklabel.
Also, I have my sources and packages(/usr/ports) on yet another slice.
Grub allows me to mark the operating system.
So, a normal entry for OpenBSD would look like
title openbsd_working
root (hd0,1)
chainloader +1
Which I can change for
title openbsd_testing
parttype (hd0,1) 0xB6
parttype (hd0,2) 0xA6
root (hd0,2)
chainloader +1
Uff course, must change amd revert the working instance to:
title openbsd_working
parttype (hd0,1) 0xA6
parttype (hd0,2) 0xB6
root (hd0,2)
chainloader +1
Grub let me hide or unhide partitions (which can be usefull if you try
to install an OS
via Anaconda (RedHats and derivates) which read the 0xA6 to be "active"
ad bortk out.
Will try the hide/unhide method on next fresh install.
Found this method straightforward, foolproof, and not needing to write
any wrappers.