# Upgrade 7.2 to 8.1



## urosgruber (Nov 16, 2010)

Hi,

I'm trying to migrate one server from FreeBSD 7.2 to 8.1 stable. On 7.2 I have own kernel build but only difference from generic is quota option and some drivers are not included. I need to upgrade to 8.1 stable because I use 3ware raid controller and there were some changes in twa driver in 8.1 stable.

I copied whole server in virtual machine to test upgrade process and everything went well till reboot after kernel install. Right after it runs shell I get an error saying 
	
	



```
ld-elf.so can't find right version of libc.so.7
```
 I have compat for 7 in my kernel build and also install compat7x from ports before doing that. 

I reboot with 7.2 kernel and try to installworld but after reboot I have even greater problems. Machine boots but everything else is not working. It looks like some library problems.

I follow this http://forums.freebsd.org/showpost.php?p=53974&postcount=5 but It looks like I need to add something more.

Do you think it's better to upgrade to 7.3 first and from there go to 8.1?


----------



## vand777 (Nov 16, 2010)

Do you have COMPAT_FREEBSD7 option in your kernel configuration file?


----------



## vand777 (Nov 16, 2010)

urosgruber said:
			
		

> Hi,
> Do you think it's better to upgrade to 7.3 first and from there go to 8.1?



It might work better than going from 7.2 to 8.1.

Usually people recommend to update to the latest 7.x first, then to 8.0, then to the latest 8.x (8.1 in your case).


----------



## vand777 (Nov 16, 2010)

urosgruber said:
			
		

> also install compat7x from ports before doing that.



I think that you should do this only after you upgrade the system to 8.x. But maybe I'm wrong.

P.S. When I was migrating from 7.x to 8.0, I recompiled all my ports after the upgrade. Also when I was updating the kernel, I disabled (commented out) all services in /etc/rc.conf (however, I'm not sure that it somehow helped me to have no problems at all).


----------



## urosgruber (Nov 16, 2010)

vand777 said:
			
		

> Do you have COMPAT_FREEBSD7 option in your kernel configuration file?



Yes I have this, but it does not help.

Right now I'm testing with freebsd-update to se if I succeed.


----------



## urosgruber (Nov 17, 2010)

freebsd-update also failed and strange things is happening. I'll go with 7.3 first and I hope from there update will be easier.


----------



## vand777 (Nov 17, 2010)

urosgruber said:
			
		

> freebsd-update also failed and strange things is happening. I'll go with 7.3 first and I hope from there update will be easier.



Yes, go with 7.3 first, then 8.0, and only after that upgrade to 8.1. It might help.

Also try to install compat7x only after you update the system to 8.0.


----------



## Yampress (Nov 17, 2010)

System upgrade 7.2 to 8.1 with freebsd-update. Next, download the source system, compile a new kernel with our options with the old configuration kernel file from the 7.2
*freebsd-update -r 8.1-RELEASE upgrade*
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/updating-upgrading-freebsdupdate.html


----------



## urosgruber (Nov 22, 2010)

Ok, I manage to get machine running with 7.3-STABLE and now I'm preparing to go to 8.1-STABLE. Here is what I did so far:


```
1. cd /usr/src
2. make update
3. make cleanworld && make cleandir
4. make buildworld
5. make buildkernel
6. make installkernel
7. mergemaster -p
8. reboot (go in single user mode)
9. mount -a -t ufs
10. adjkerntz -i
```

I test is awk is working because of my previous errors and it does not. Here is an error I get


```
/libexec/ld-elf.so.1: /lib/libm.so.5: version FBSD_1.0 required by /usr/bin/awk
```

The same error is with */bin/ps* and probably others to. */bin/ln* works ok

I build kernel with options COMPAT_FREEBSD32 _FREEBSD4 _FREEBSD5 _FREEBSD6 _FREEBSD7 

Is there any way I can correct the above error, because make installworld fails becase awk is not working?


```
file /lib/libm.so.5
```

gives me


```
libm.so.5: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), stripped
```

I realy don't know what else to do and I was trying to make it work for whole weekend.


----------



## DutchDaemon (Nov 22, 2010)

Where's your [cmd=]make installworld[/cmd] and second [cmd=]mergemaster[/cmd] and [cmd=]make delete-old / make delete-old-libs[/cmd]? Your kernel and userland need to be in sync, and old libraries need to be removed. Make sure you follow all of the required steps in /usr/src/Makefile.


----------



## urosgruber (Nov 22, 2010)

It looks like I wasn't clear enough. 

I can't continue after step 10 because awk command is not working and because of that

[CMD=""]make installworld[/CMD]

fail big time

I also try to go in single user mode and do everything in there and I manage to do installworld but then It complicates again with

[CMD=""]mergemaster -c[/CMD]

The error I was getting was that It can't cd to /usr/src x(

I found some idea on the internet and copy /bin/ln to /bin/ln.old then 

[CMD=""]make installworld[/CMD]

and after that copy new /bin/ln to /bin/ln.new and revert the /bin/ln.old back to /bin/ln

Then mergemaster was ok. After that I replace /bin/ln back to new version.

Afer that I do reboot and from here nothing works. I can't even go with /bin/sh in single user mode. It crash with error 11 I think. I'm kinda stuck here. Maybe it could help to

[CMD=""]make delete-old / make delete-old-libs[/CMD]

before I do reboot. I realy can't understand what might be so wrong with that system. I already upgrade a bunch of servers that way from 4.x version on. And all of them is running 8.x now. With this server I have no such luck 

Is there any way I can run

[CMD="make delete-old"]make delete-old[/CMD]

in that stage?


----------



## kisscool-fr (Nov 22, 2010)

It will take some time but something like this


```
# cp /usr/share/example/cvsup/standard-supfile ~/standard-supfile
# sed -i '.bak' 's/tag=RELENG_7_2/tag=RELENG_8_1/g' ~/standard-supfile
# csup -h cvsup.us.FreeBSD.org standard-supfile (depending on your country)
```

Then follow the instructions in /usr/src/Makefile or here.

It is highly recommended to rebuild all ports when uprading from one major version to another major version.

You can split your upgrade to something like this 7.2 -> 7.3, 7.3 -> 8.0 and 8.0 to 8.1.


----------



## urosgruber (Nov 22, 2010)

:q Please read above what I did. I have my sources updated and I'm not even close to rebuilding ports. And also. I tried goind version by version. But every path I go It completes with some failure.


----------



## vand777 (Nov 23, 2010)

urosgruber said:
			
		

> Ok, I manage to get machine running with 7.3-STABLE and now I'm preparing to go to 8.1-STABLE. Here is what I did so far:
> 
> 
> ```
> ...



Steps 7 and 8 are not done in the correct order, imho. Can it cause this problem? (I think it is unlikely but it is always safer to follow the instructions.)

This is what I usually do:


```
# cd /usr/src
# make buildworld
# make buildkernel
# make installkernel
# shutdown -r now
```
After installkernel finishes successfully, boot in single user mode. Then run:

```
# adjkerntz -i
# mount -a -t ufs
# mergemaster -p
# cd /usr/src
# make installworld
# mergemaster
# reboot
```


----------



## urosgruber (Nov 23, 2010)

I don't have any more idea what to test so I point the problem to the VM machine and change it. I was using Hyper-V and now I tested the same procedure listed in /usr/src/Makefile and gues what. I have up and running 8.1-STABLE in my VM.

This post can be made RESOLVED

Thanks anyway for your help.


----------

