ealwen
February 24th, 2004, 09:17
Just wanted to get everyone's method on this but if you had to upgrade a FreeBSD 4.8 box to FreeBSD 5.2, what method would you use and why? I have tried upgrading in the past and failed miserably (of course this was back when I knew very little) and ended up rebuilding the box.

socomm
February 24th, 2004, 12:10
I'd suggest upgrading via cvsup + make world. Just some advice for you read the handbook (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cutting-edge.html) and back up your /etc/ directory, had to learn that the hardway . :oops:

ealwen
February 24th, 2004, 16:47
I ended up having to reinstall my box (argh!!) :evil:

Maybe someone can tell me what I missed or did wrong so I don't have the same problem next time.

First I am partial to using a CD vs doing a net upgrade. I just like to have the CD around in case something goes wrong with my network connection (since I use to be on dial up for such a long time), nothing more frustrating than being in the middle of an upgrade and not being able to connect out. Anyway I pulled down the 5.2 ISO from FreeBSD's ftp site and burned it.

After burning it I booted up with the CD and attempted the upgrade from the sysinstall menu. I was keeping the partitions the same so I just setup the mount points in the label editor, selected what install I wanted (X-user with all sources), and then went to install. The CD started copying files to the root and then failed into a kernel panic and it rebooted. Thought maybe I did something wrong so I tried it a second time with the same results. So using the CD to upgrade was out.

Next I tried to CVS to upgrade. Pulled down the 5.2 sources, then following the handbook, started doing a make buildworld, etc. This time everything ran normally, no errors at all. After doing all the steps I rebooted and my box came up normal. Logged in as root, uname -r told me I was FreeBSD 5.2. "Sweet!" I thought thinking I was finished but I was wrong. Next I wanted to get my X going again, I had the freebsd gzip on my windows partition. When I attempted to mount my windows partition it gave me an error. I didn't write it down but it was something along the lines of sysctrl being wrong and that I needed to run make world again. I got it again on another command (I forget what) so I thought, maybe I missed something in the buildworld process. So I looked at the handbook and noticed that it said something about running mergemaster in single user mode that I hadn't done the first time. I went through running the mergemaster process and it found alot of stuff where a temporary version was a newer version than the installed version. So of course I went the temporary version since it was newer. Finishing that I thought I was done and ready to use my system, but after a reboot it failed to come up. It would run through the boot up but as soon as it got to a point where the login should pop up, it gave me a bunch of errors about the ttys and would stop. No login prompt and pressing enter would just scroll up the errors with a blank line. I tried to ssh too but didn't get anything. I got frustrated at this point and just stuck in the 5.2 CD and did a new install. :( Any thoughts?

socomm
February 24th, 2004, 18:19
Hehe this is the reason why you should back up your etc directory :). Mergemaster merges configuration files during upgrade and fsckup some of your older configs if you aren't paying too much attention. Anyway the way to upgrade is cvsup your sources and:

[code:1:2d2e43e4e0]
# shutdown now
# fsck -p
# mount -u /
# mount -a -t ufs
# swapon -a

# cd /usr/obj
# chflags -R noschg *
# rm -rf *

# cd /usr/src
# make buildworld
# make buildkernel
# make installkernel
# reboot

# mergemaster -p
# make installworld
# mergemaster
# reboot
[/code:1:2d2e43e4e0]

Easy eh?

ealwen
February 24th, 2004, 19:22
Yeah it looks easy. I didn't see the part about chflags in the /usr/obj directory in the handbook (maybe I missed it) so I didn't do that part. As for the rest, that is what I did with the exception of mergemaster as I explained.

tarballed
February 24th, 2004, 20:22
Hmm, I may be wrong in my thinking here, but i'll take a shot.

You were running a FreeBSD 4.8 box and were trying to upgrade to FreeBSD 5.2. The immediate problem that I can see is that these are two different 'types' of the FreeBSD operating system.

4.8 is the 'production release' and 5.2 is the 'New Technology release'. The layout is different for these two.

To be honest, i've never heard of anyone trying to upgrade from a production release to a new technology release, so im not even sure if it is possible.

I may be wrong though. Maybe someone else can chime in here.

T.

RandomSF
February 25th, 2004, 09:38
It is possible to do that upgrade, but certain parts of the upgrade will not occur, like UFS2, which, from a practical standpoint, requires a fresh install. I think that is part of what tarballed is talking about with "New Technology". In other words, it will work, but if the FreeBSD official position is a clean install, there is probably some sense to doing that.

socomm
February 25th, 2004, 11:07
Umm .... what happened here is that ealwens configuration files were overwritten preventing daemons to properly run at boot up, and perhaps even his/her /etc/master.passwd file was overwritten. In my opinion it had very little to do in upgrading from 4.* to 5.*. This same thing happened to me, not so long ago, the quick fix copy your old configuration files into your new /etc directory.

Just some thoughts.