Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update base of my pot ? #47

Open
eleutherius opened this issue Oct 4, 2018 · 1 comment
Open

How to update base of my pot ? #47

eleutherius opened this issue Oct 4, 2018 · 1 comment

Comments

@eleutherius
Copy link

Hello.
I have pot with base 11.1, but I want update base to 11.2 of my pot. How can I do that?

@pizzamig
Copy link
Collaborator

Hi.
It's a nice use case. The solution is a bit tricky and I cannot guarantee that everything will work, but it's easy to rollback.
Let's say that I have a pot called mypot111 based on FreeBSD 11.1 and I want upgrade it to FreeBSD 11.2.
First of all, I need an 11.2 base (if not yet available)

pot create-base -r 11.2

Then, that's what I did:

pot mypot111 stop
pot snap -p mypot111
cd /opt/pot/jails/mypot111/conf/

NOTE: /opt/pot is my POT_FS_ROOT configuration value. Check yours via pot config -g fs_root
In the /opt/pot/jails/mypot111/conf/pot.conf file

pot.level=1
pot.type=multi
pot.base=11.1
pot.potbase=
pot.dns=inherit
pot.cmd=sh /etc/rc
host.hostname="mypot111.pizzamig"
osrelease="11.1-RELEASE"
ip4=inherit
vnet=false

I changed pot.base=11.1 in pot.base=11.2 and osrelease="11.1-RELEASE" in osrelease="11.2-RELEASE"
Then, in the /opt/pot/jails/mypot111/conf/pot.conf file

zroot/pot/bases/11.1 /opt/pot/jails/mypot111/m ro
zroot/pot/jails/mypot111/usr.local /opt/pot/jails/mypot111/m/usr/local zfs-remount
zroot/pot/jails/mypot111/custom /opt/pot/jails/mypot111/m/opt/custom zfs-remount

I changed the first line to use the new base:

zroot/pot/bases/11.2 /opt/pot/jails/mypot111/m ro

Now you can restart your pot:

pot run mypot111
uname -r

If you're not happy with the upgrade or the upgrade failed you can revert the changes via:

pot stop mypot111
pot revert -p mypot111

[OPTIONAL] you can also rename your pot via

pot stop mypot111
pot rename -p mypot111 -n mypot112
pot start mypot112

IMPORTANT NOTE: The folders /etc and /var are not updated, because they're a copy of the 11.1 ones. If you're using some new 11.2 features that needs updated configuration files or tree layouts in /etc or /var you have to merge those files manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants