1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ports backup using ZFS

Discussion in 'General' started by kreoso, Dec 15, 2011.

  1. kreoso

    kreoso New Member

    Messages:
    5
    Thanks Received:
    0
    Hello, I'm new to FreeBSD and enjoyed it very much, but I found that uninstallation of a port is not easy, cause of the dependencies. There is also some ports like pkg_cutleaves, but you have to know the dependencies anyway.

    So, I think it is better to make the relevant directories into ZFS subvolumes and snapshotting before & after the installation of a port, and if something goes wrong or you don't need it anymore, restore it from the snapshot.

    My question is, which directories are relevant for this. I believe /var and /usr except /usr/home should be there, but I'm not sure for other directories such as /etc, /bin or /sbin, etc..

    any clues or are there better solution for this job?
     
  2. plamaiziere

    plamaiziere New Member

    Messages:
    184
    Thanks Received:
    39
    Ports are installed in /usr/local, with the exception of linux binairies going in /compat/linux (which is a symlink to /usr/compat on 8.X).

    The ports database is in /var/db/.

    So with a snapshot of /usr and /var you should be able to restore. For /home you may use a /home mountpoint, with zfs that is easy.

    Regards
     
    kreoso thanks for this.
  3. gkontos

    gkontos Active Member

    Messages:
    1,390
    Thanks Received:
    245
    That would be the /usr/local directory. This is were all binaries and configuration files are stored during software installation. Some software will create directories under /var as well.
     
    kreoso thanks for this.
  4. t1066

    t1066 Member

    Messages:
    173
    Thanks Received:
    33
    Some ports like nvidia-driver and virtualbox would also install in /boot/modules.
     
    kreoso thanks for this.
  5. fluca1978

    fluca1978 New Member

    Messages:
    733
    Thanks Received:
    68
    This is how OpenSolaris (and I guess also Solaris) works for a full update. What is done is a kind of full snapshot of the system, the creation of a new boot environment so that you can even change those part of the system that you don't want to remember of, and you can get back in time. So not only you can restore your previous configuration, but you can even boot it and see how it worked without having to touch the final configuration.
    By the way, snapshotting /var and /usr/local should suffice. I would add /etc if you don't already backup diligently configuration files, since usually adding a new program via ports mean you are going to enable some services and/or adjust some firewall rules.
     
    kreoso thanks for this.
  6. gkontos

    gkontos Active Member

    Messages:
    1,390
    Thanks Received:
    245
    There was a relevant project for FreeBSD. I haven't really followed it, therefore I can't express any opinion about it.
     
    kreoso thanks for this.