Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
profile 17 backup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 396

PostPosted: Wed Dec 06, 2017 7:03 am    Post subject: profile 17 backup Reply with quote

What is the minimum backup required to reset the computer to its initial state before the profile 17 update if something goes wrong?

Full backup is out of questions because of the size and time.

Are the following directories enough to restore the computer to its initial state?
Quote:

/boot
/etc

/var only cache, db, lib

/bin
/sbin

/lib32
/lib64

/usr/bin exclude src, portage

grub boot??
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 6365
Location: almost Mile High in the USA

PostPosted: Wed Dec 06, 2017 7:59 am    Post subject: Reply with quote

If you also don't want to re-emerge anything, all of /usr/lib /usr/share needs to be backed up too; but I think the best is a full image backup...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Maxxx
Guru
Guru


Joined: 12 Jan 2016
Posts: 453
Location: Italia

PostPosted: Wed Dec 06, 2017 8:01 am    Post subject: Reply with quote

I use ""dd" command for clone entire HD.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2340

PostPosted: Wed Dec 06, 2017 8:35 am    Post subject: Reply with quote

Well, you need your world file and our config files at minimum.

But this really isn't a make or break situation. Nothing is just going to stop working. Worst case is a few hours to sort out a couple of emerge failures.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
Irre
Apprentice
Apprentice


Joined: 09 Nov 2013
Posts: 271
Location: Stockholm

PostPosted: Wed Dec 06, 2017 9:44 am    Post subject: Reply with quote

I always take full image backups (from another system):

1) first fill free space in file system with zeroes: dd if=/dev/zero of=/zero; rm /zero
then:
2) dd if=/dev/sdaX | gzip>backupfile

to restore:
zcat backupfile | dd of=/dev/sdaX

backupfile are only between 1 .. 3 Gb for my systems. Userdata, distfiles, portage etc are somewhere else.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 11434

PostPosted: Thu Dec 07, 2017 2:52 am    Post subject: Reply with quote

Irre: shouldn't you remount the filesystem read-only before step 2? Otherwise, the kernel might write to it partway through your copy. Generally, bit-perfect backups are a special-case that should be used only if you need a perfect reproduction of the data (e.g. for data forensics). In most cases, filesystem level backups are a better choice.
Back to top
View user's profile Send private message
Irre
Apprentice
Apprentice


Joined: 09 Nov 2013
Posts: 271
Location: Stockholm

PostPosted: Thu Dec 07, 2017 7:27 pm    Post subject: Reply with quote

Hu wrote:
Irre: shouldn't you remount the filesystem read-only before step 2? Otherwise, the kernel might write to it partway through your copy. Generally, bit-perfect backups are a special-case that should be used only if you need a perfect reproduction of the data (e.g. for data forensics). In most cases, filesystem level backups are a better choice.

Yes, I always run from another system. So it is not mounted. I also use to check "fsck /dev/sdaX" prior to "DD".
Back to top
View user's profile Send private message
mike155
Apprentice
Apprentice


Joined: 17 Sep 2010
Posts: 211
Location: Frankfurt, Germany

PostPosted: Thu Dec 07, 2017 8:08 pm    Post subject: Reply with quote

Code:
dd if=/dev/sdaX | gzip>backupfile

Try zstd instead of gzip. It's faster and gives you a smaller backupfile (better compression).
Quote:
zcat backupfile | dd of=/dev/sdaX

Even if you created your backupfile with gzip, you can use zstd to decompress. It's much faster.
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 4532

PostPosted: Thu Dec 07, 2017 9:22 pm    Post subject: Reply with quote

Bare minimum depends on your filesystem. If possible use a Btrfs/LVM snapshot, it's instant and you only pay for what you use. A tarball is the traditional way to make system backups and will work, but it's very hard to get right - you have to pay close attention to keep xattrs and permissions intact. Cloning the disk is easy but inefficient, and you explicitly said you don't have the space or time for that...
_________________
*.ebuild // /etc/service/*
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 11434

PostPosted: Fri Dec 08, 2017 1:31 am    Post subject: Reply with quote

Irre wrote:
Yes, I always run from another system. So it is not mounted. I also use to check "fsck /dev/sdaX" prior to "DD".
If it isn't mounted, how do you write the file that zero-fills all the data blocks in the filesystem? ;) Your earlier post said "(from another system)", which avoids some of the difficulties with disk-level cloning (in particular, inability to remount read-only due to in-use writable files on a live filesystem), but you still need to mount the filesystem on some system to write the zero file. Your instructions don't mention remounting read-only / unmounting after that, but failing to do so can cause inconsistencies. Similarly, you should flush the zero file to disk before deleting it. In theory, a kernel with sufficient free RAM could defer writing some of (or all of with the right disk / memory ratio) the zero blocks long enough that the file is unlinked, at which point the kernel declares the file to be garbage and discards all pending writes to it. An explicit sync, or an implicit sync through a remount read-only, should force all such writes out, so that the disk is as zero-filled as you intend.

Of course, disk cloning is a usually a bad idea on systems with limited write cycles. It's acceptable but suboptimal on mechanical drives and probably most SSDs.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum