Ports backup using ZFS

General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Ports backup using ZFS

Postby kreoso » 15 Dec 2011, 18:32

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 [FILE]pkg_cutleaves[/FILE], 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 [FILE]/var[/FILE] and [FILE]/usr[/FILE] except [FILE]/usr/home[/FILE] should be there, but I'm not sure for other directories such as [FILE]/etc[/FILE], [FILE]/bin[/FILE] or [FILE]/sbin[/FILE], etc..

any clues or are there better solution for this job?
kreoso
Junior Member
 
Posts: 5
Joined: 14 Nov 2011, 09:24

Postby plamaiziere » 15 Dec 2011, 23:35

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

any clues or are there better solution for this job?


Ports are installed in [FILE]/usr/local[/FILE], with the exception of linux binairies going in [FILE]/compat/linux[/FILE] (which is a symlink to [FILE]/usr/compat[/FILE] on 8.X).

The ports database is in [FILE]/var/db/[/FILE].

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

Regards
plamaiziere
Member
 
Posts: 184
Joined: 04 Jan 2009, 21:37
Location: Rennes, France

Postby gkontos » 16 Dec 2011, 00:09

That would be the [FILE]/usr/local[/FILE] directory. This is were all binaries and configuration files are stored during software installation. Some software will create directories under [FILE]/var[/FILE] as well.
Powered by BareBSD
User avatar
gkontos
Senior Member
 
Posts: 1370
Joined: 09 Dec 2009, 08:36
Location: Polidendri, GR

Postby t1066 » 16 Dec 2011, 00:44

Some ports like nvidia-driver and virtualbox would also install in [FILE]/boot/modules[/FILE].
t1066
Member
 
Posts: 154
Joined: 07 Jun 2010, 16:49

Postby fluca1978 » 16 Dec 2011, 10:41

kreoso wrote:
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.


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 [file]/var[/file] and [file]/usr/local[/file] should suffice. I would add [file]/etc[/file] 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.
fluca1978
Member
 
Posts: 726
Joined: 20 May 2010, 08:53

Postby gkontos » 16 Dec 2011, 12:39

There was a relevant project for FreeBSD. I haven't really followed it, therefore I can't express any opinion about it.
Powered by BareBSD
User avatar
gkontos
Senior Member
 
Posts: 1370
Joined: 09 Dec 2009, 08:36
Location: Polidendri, GR


Return to General

Who is online

Users browsing this forum: sKa and 1 guest