# ezjail-admin update -u lib32 errors



## nifoc (Dec 24, 2014)

My main machine is currently on 10.1-RELEASE-p3. Ever since p2 I'm seeing the following errors whenever I run `ezjail-admin update -u` to update my jails.


```
The following files will be added as part of updating to 10.1-RELEASE-p3:
/libexec
/libexec/ld-elf32.so.1
/usr/bin
/usr/bin/ldd32
/usr/lib32
/usr/lib32/Scrt1.o
/usr/lib32/crt1.o
/usr/lib32/crtbegin.o
/usr/lib32/crtbeginS.o
/usr/lib32/crtbeginT.o
/usr/lib32/crtend.o
/usr/lib32/crtendS.o
/usr/lib32/crti.o
/usr/lib32/crtn.o

[…]

Installing updates...install: mkdir /usr/jails/newjail//libexec: File exists
install: mkdir /usr/jails/newjail//usr/bin: File exists
install: mkdir /usr/jails/newjail//usr/lib32: File exists
install: mkdir /usr/jails/newjail//usr/lib32: File exists
install: mkdir /usr/jails/newjail//usr/lib32: File exists
install: mkdir /usr/jails/newjail//usr/lib32: File exists
install: mkdir /usr/jails/newjail//usr/libdata: File exists
install: mkdir /usr/jails/newjail//usr/libdata: File exists
install: mkdir /usr/jails/newjail//usr/libexec: File exists
install: /usr/jails/newjail//libexec/ld-elf32.so.1: No such file or directory
install: /usr/jails/newjail//usr/bin/ldd32: No such file or directory
install: /usr/jails/newjail//usr/lib32/Scrt1.o: No such file or directory
install: /usr/jails/newjail//usr/lib32/crt1.o: No such file or directory

[…]

chflags: /usr/jails/newjail//libexec/ld-elf32.so.1: No such file or directory
chflags: /usr/jails/newjail//usr/lib32/libc.so.7: No such file or directory
chflags: /usr/jails/newjail//usr/lib32/libcrypt.so.5: No such file or directory
chflags: /usr/jails/newjail//usr/lib32/librt.so.1: No such file or directory
chflags: /usr/jails/newjail//usr/lib32/libthr.so.3: No such file or directory
done.
```

The update in general (e.g. the updated version of ntpd) is installed correctly, but these lib32 error do not go away.

/usr/jails/newjail/usr/lib32/ (without the second /) is a symlink to /usr/jails/basejail/usr/lib32 and this directory does include most (all?) of the files it complains about.

Maybe this issue is related to how I created the jails:


Create new VPS instance with 10.0 (not sure about the patch level).
Immediately update to 10.1-p0 using freebsd-update.
Create jails using ezjail-admin

So I'm thinking that this might be related to the bug where freebsd-update() accidentally removed lib32?


----------



## paganhobbit (Dec 25, 2014)

I'm seeing the same thing on my machine. I haven't had a chance to dig into it yet.


----------



## derekschrock (Dec 27, 2014)

This appears to be related to /usr/jail/newjail/ and the way base jail symlinks are created by `ezjail-admin`.

/usr/jails/basejail isn't null mounted to /basejail/ so `freebsd-update` can't find anything symlinked to /basejail/ (bin boot lib, ... look at /usr/jail/newjail).

If you create /basejail/ and `mount`  /usr/jail/basejail to /basejail and run `freebsd-update` like `ezjail-admin` will cause the missing files error go away.

$ `sudo mkdir /basejail/`
$ `sudo mount -t nullfs -o ro /usr/jails/basejail/ /basejail/`
$ `sudo /usr/sbin/freebsd-update -b /usr/jails/newjail fetch`

```
Looking up update.FreeBSD.org mirrors... 5 mirrors found.
Fetching metadata signature for 10.1-RELEASE from update3.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

The following files will be updated as part of updating to 10.1-RELEASE-p3:
/libexec
/usr/bin
/usr/lib32
/usr/libdata
/usr/libexec
```

However, the rest of the "will be updated" are symlinks that `freebsd-update` meta data files are expecting to be something else.  In this case the directories listed above are symlinks and `freebsd-update` is expecting them to be real directories.

With that being said:

Should `freebsd-update` not care about file type?

Should `ezjail-admin` be null mounting everything and not create symlinks?
Should `ezjail-admin` not create symlinks to /basejail/... but basejail/...?


----------



## hsw (Jan 15, 2015)

Thanks for these commands that solved my lib32 errors:


derekschrock said:


> .....
> $ `sudo mkdir /basejail/`
> $ `sudo mount -t nullfs -o ro /usr/jails/basejail/ /basejail/`
> $ `sudo /usr/sbin/freebsd-update -b /usr/jails/newjail fetch`
> .....​



It now looks like the jails were updated to 10.1 (from 10.0) but only the binaries; /etc/* still appears to be from 10.0-RELEASE

I forced a new update with:

`env UNAME_r=10.0-RELEASE /usr/sbin/freebsd-update -b /usr/jails/newjail upgrade -r 10.1-RELEASE`
`/usr/sbin/freebsd-update -b /usr/jails/newjail install`
`ezjail-admin update -u`​
Now looking at: /usr/jails/newjail/var/db/etcupdate/current it seems to have the 10.1 /etc files i.e. they all have  $FreeBSD: releng/10.1/…

The actual jails /etc/* are still at 10.0 and none contain do not contain the "current" etc directory tree so I copied it across to one jail:

`rsync -avHxP /usr/jails/newjail/var/db/etcupdate/current /usr/jails/myjail/var/db/etcupdate/`
`etcupdate diff -D /usr/jails/myjail`​
Looks like I will be able to merge these one by one, probably a lot of them will be automatic - time to read etcupdate(8)

I hesitate to run the force update against each jail, but I might just try one to see.

Does anyone know a better solution?

Edit: looks like etcupdate(8) needs /usr/src, so maybe force update is only choice


----------



## junovitch@ (Jan 20, 2015)

The Handbook describes how to use mergemaster(8) both from the host where /usr/src is already available and from inside the jail where /usr/src is nullfs(5) mounted inside the jail.  This is the method I've used in the past when I upgrade my jails.


----------



## hsw (Jan 22, 2015)

Thanks, junovitch, I was hoping to find a way to do the update without having to go the /usr/src + mergemaster(8) route.

I do not recommend trying the method I used in the previous post, it was quite difficult to recover: many of the symlinks in newjail were replaced by actual directories containing just the latest files.  This resulted in creation of new jails by ezjail being broken.

In the end after I had manually merged one jail I gave up and recreated the other jails on that machine (that was when I found the newjail problem just mentioned).

I'll do some more investigation to see any other alternatives - if not then I'll set up /usr/src and use mergemaster(8)


----------



## l33tname (Oct 21, 2015)

hsw did you found a better solution?


----------



## hsw (Oct 21, 2015)

Currently I use iocage and converted my old ezjails to this.  So far the iocage updates have just worked,  even the update from 10.1 to 10.2 using iocage worked first time.
So I have not looked at ezjail for a long time.


----------



## basbebe (Jan 31, 2016)

hsw said:


> Currently I use iocage and converted my old ezjails to this.  So far the iocage updates have just worked,  even the update from 10.1 to 10.2 using iocage worked first time.
> So I have not looked at ezjail for a long time.


How did you convert you jails?


----------



## hsw (Feb 5, 2016)

Mostly I just rebuilt, I use Ansible to create/maintain the servers, so it was just a matter of data backup run Ansible to create new jail then restore.
Since each type of server had a few redundant copies I was able to convert them one at a time without loosing access


----------



## bogong (Apr 28, 2019)

On FreeBSD 12.0 works too. Just solved my problem.


----------

