1

I have several legacy FreeBSD VMs made by ex-sysadmin who did some strange trick to save hypervisor storage space: he installed one VM from iso, the set it up a bit, installed needed software, then deleted ports tree and all package management related dirs (so basically the VM was stripped down for 1-2 Gb), then cloned this VM and changed some settings as needed.

Now as software versions become older and security updates should be considered I face the problem I simple can not do anything to these VMs.

No documentation left, nor this person is known to understand FreeBSD in depth so I doubt he did surgery-like thin work while deleting dirs - at least, no pkg or freebsd-upgrade cam handle the missing parts of filesystem.

Is there any way to run iso as “install upgrade” mode (like Windows installer can be used) so the FreeBSD installed fix the missing files?

P.S. I can only think of setting the same VM from scratch and copy configs from that “stripped” VMs but this quite time-consuming approach, so maybe it can be fixed with different approach?

Thank you!

5
  • 1
    Packages and ports can be reinstalled easy enough. If you have pkg you can do pkg update (I think) to reinstall packages. Can you can do portsnap? All of this is outlined in the Handbook.
    – Rob
    May 2, 2021 at 9:46
  • 1
    And the base can probably be fixed with freebsd-update IDS.
    – arrowd
    May 2, 2021 at 10:11
  • @Rob I'd like to say yes, but neither 'portsnap' nor 'pkg update' acually works. su: "portsnap: command not found" and "No active remote repositories configured." are reply from system.
    – Kevin M
    May 2, 2021 at 21:22
  • Do you have `/etc/pkg/FreeBSD.conf?
    – Rob
    May 2, 2021 at 21:58
  • 1
    See man pkg.conf and use the first example near the bottom if you don't.
    – Rob
    May 2, 2021 at 22:13

1 Answer 1

0

You can download the base tar from here:

https://download.freebsd.org/ftp/releases/amd64/amd64/13.0-RELEASE/base.txz

(Be sure to select the appropriate release and architecture, this is just a sample url using the latest release and amd64 architecture)

You should be able to download it using fetch, then untar it in /, but be sure to save config files in /etc/ such as rc.conf, passwd, master.passwd, group, etc. before hand.

This should get you the missing parts of the system back, so you will have freebsd-update, etc.

From there, you should be able to use the bootstrap pkg (/usr/sbin/pkg) to install the complete version of pkg. See this page:

https://docs.freebsd.org/en/books/handbook/ports/#pkgng-intro

for more detail.

Unless you need customization of packages, you should be able to use pre-built packages instead of building them yourself from ports. If you need customization, then you'll need to build from ports. You can find more details here:

https://docs.freebsd.org/en/books/handbook/ports/#ports-using

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.