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
    Likes 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
    Likes Received:
    0
    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
     
  3. gkontos

    gkontos Member

    Messages:
    1,385
    Likes Received:
    1
    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.
     
  4. t1066

    t1066 Member

    Messages:
    169
    Likes Received:
    1
    Some ports like nvidia-driver and virtualbox would also install in /boot/modules.
     
  5. fluca1978

    fluca1978 New Member

    Messages:
    733
    Likes Received:
    0
    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.
     
  6. gkontos

    gkontos Member

    Messages:
    1,385
    Likes Received:
    1
    There was a relevant project for FreeBSD. I haven't really followed it, therefore I can't express any opinion about it.