ea23 Ports backup using ZFS - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

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

Reply
 
Thread Tools Display Modes
  #1  
Old December 15th, 2011, 19:32
kreoso kreoso is offline
Junior Member
 
Join Date: Nov 2011
Posts: 5
Thanks: 5
Thanked 0 Times in 0 Posts
Default Ports backup using ZFS

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?
Reply With Quote
  #2  
Old December 16th, 2011, 00:35
plamaiziere plamaiziere is offline
Member
 
Join Date: Jan 2009
Location: Rennes, France
Posts: 174
Thanks: 1
Thanked 39 Times in 29 Posts
Default

Quote:
Originally Posted by kreoso View Post

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?
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

Last edited by DutchDaemon; December 16th, 2011 at 01:32. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
The Following User Says Thank You to plamaiziere For This Useful Post:
kreoso (December 16th, 2011)
  #3  
Old December 16th, 2011, 01:09
gkontos's Avatar
gkontos gkontos is offline
Senior Member
 
Join Date: Dec 2009
Location: Polidendri, GR
Posts: 1,266
Thanks: 42
Thanked 218 Times in 164 Posts
Default

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.
__________________
Powered by BareBSD
Reply With Quote
The Following User Says Thank You to gkontos For This Useful Post:
kreoso (December 16th, 2011)
  #4  
Old December 16th, 2011, 01:44
t1066 t1066 is offline
Member
 
Join Date: Jun 2010
Posts: 142
Thanks: 3
Thanked 25 Times in 24 Posts
Default

Some ports like nvidia-driver and virtualbox would also install in /boot/modules.
Reply With Quote
The Following User Says Thank You to t1066 For This Useful Post:
kreoso (December 16th, 2011)
  #5  
Old December 16th, 2011, 11:41
fluca1978 fluca1978 is offline
Member
 
Join Date: May 2010
Posts: 670
Thanks: 27
Thanked 62 Times in 59 Posts
Default

Quote:
Originally Posted by kreoso View Post

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 /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.
Reply With Quote
The Following User Says Thank You to fluca1978 For This Useful Post:
kreoso (December 21st, 2011)
  #6  
Old December 16th, 2011, 13:39
gkontos's Avatar
gkontos gkontos is offline
Senior Member
 
Join Date: Dec 2009
Location: Polidendri, GR
Posts: 1,266
Thanks: 42
Thanked 218 Times in 164 Posts
Default

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
Reply With Quote
The Following User Says Thank You to gkontos For This Useful Post:
kreoso (December 21st, 2011)
Reply

Tags
ports, snapshot, zfs

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Backup and restore configurations from ports minimike Installation and Maintenance of FreeBSD Ports or Packages 9 September 26th, 2011 01:40
[Solved] ZFS: backup snapshots with tar? uisge General 2 January 15th, 2011 11:16
System Backup (ZFS) embeddedbob Userland Programming & Scripting 0 October 5th, 2010 13:55
[Solved] zfs backup script for backup to disk jbeez General 3 September 10th, 2010 12:33
Creating a consistent ZFS backup olav General 7 June 4th, 2010 00:02


All times are GMT +1. The time now is 22:31.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0