Converting jail with dedicated disk to directly bootable

I have a jail with its own dedicated disk, which I now want to be able to split away and boot independently.

Complicating things, this is a legacy system with a very old version (9-STABLE), so many things that you could normally do (such as installing or updating packages) will not work.

Method #1, preserve the existing filesystem:

1. Install kernel to jail path (world already present)
2. Partition a new image with the typical partitions (freebsd-boot, freebsd-swap, freebsd-zfs) then copy the entire jail partition to the freebsd-zfs partition on the new image
3. Install bootcode to MBR and freebsd-boot partition on new image
4. Rename jail filesystem to zroot, change mount point, ...??
5. ...??


Method #2, create new file system and install, then copy old files:

1. Install kernel to jail path (world already present)
2. Install FreeBSD 9.3-RELEASE from scratch on new image
3. Copy all jail files, including world, over to new image (except /boot/kernel ?)
4. Cross fingers then reboot new image
5. Recompile and install 9-STABLE world and kernel


Am I on the right track here? Which method do you think might be better? Thanks for any suggestions.
 
There is a reason why the generic kernels have COMPAT_FREEBSD9, COMPAT_FREEBSD10, etc. and we have misc/compat9x, misc/compat10x, etc. So I would just get a brand new 14.3 install, transfer the application and see if you can get it working with those compat options and ports.

Which brings me to the crux of the issue, what the heck are you still using that old system for?
 
There is a reason why the generic kernels have COMPAT_FREEBSD9, COMPAT_FREEBSD10, etc. and we have misc/compat9x, misc/compat10x, etc. So I would just get a brand new 14.3 install, transfer the application and see if you can get it working with those compat options and ports.

Which brings me to the crux of the issue, what the heck are you still using that old system for?
This seems like a really interesting way to provide compatibility for a given binary, but I feel like this is going to break the build process. The source code for the various applications I run does not compile cleanly on a modern compiler, and it does occasionally need some minor updates, which requires a recompile. I guess changing to a 14.x system would effectively freeze the application binaries, because it's not possible to build under 14.x (if it was, I wouldn't need to be running 9.x, right?). So this means I would need to maintain a separate 9.x system in order to update binaries, like a cross compile?
 
The source code for the various applications I run does not compile cleanly on a modern compiler
You actually have source code? Why not fix those compiler issues?

because it's not possible to build under 14.x
I very much doubt that. Sure it might take a bit of effort to fix the code (and/or use some specific compiler options) but I'm sure it can be done. There's a literal crap tonne of old software in the ports tree, some of it hasn't changed in decades, yet they still compile, build and work just fine.
 
You actually have source code? Why not fix those compiler issues?
The application is rather complex, and is written in C++, which I don't understand very well.

It also requires external libraries like boost and openssl which have themselves evolved and made breaking changes over the years, so I have to use older versions - which have similar compile issues.

Even some C code I wrote myself (~2000 LoC) in 2012 errors out when compiling on a 14.x system, including use of flags to force earlier standards. In that instance, the code was relatively easy to fix.

I consider this a legacy system, it's too much work to try to get it working under a current version of FreeBSD. I am going to see if I can at least nudge the major to 10 or maybe 11 :)
 
Back
Top