Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

HOWTO: Easily make a full system backup (stage4)

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
441 posts
  • Page 18 of 18
    • Jump to page:
  • Previous
  • 1
  • …
  • 14
  • 15
  • 16
  • 17
  • 18
Author
Message
NotQuiteSane
Guru
Guru
User avatar
Posts: 492
Joined: Sun Jan 30, 2005 1:28 am
Location: Klamath Falls, Jefferson, USA, North America, Midgarth
Contact:
Contact NotQuiteSane
Website

  • Quote

Post by NotQuiteSane » Fri Mar 27, 2009 10:05 am

is it possible to get an option to use lzma to compress with added to the script?

Thanks
NQS
These opinions are mine, mine I say! Piss off and get your own.

As I see it -- An irregular blog, Improved with new location

To delete French language packs from system use 'sudo rm -fr /'
Top
xnmrphr
n00b
n00b
Posts: 1
Joined: Tue Jul 28, 2009 7:26 pm

  • Quote

Post by xnmrphr » Tue Jul 28, 2009 7:29 pm

Great tool/script :) Thanx.
Top
El_Goretto
Moderator
Moderator
User avatar
Posts: 3195
Joined: Sat May 29, 2004 1:49 pm
Location: Paris

  • Quote

Post by El_Goretto » Thu Sep 03, 2009 4:08 pm

It was the second time I used this script to restore or migrate OS from a machine to another after yeeeaaaars of use for backup.
No problem at all once again.

Still years of use to come :)

And thanks to its author.
-TrueNAS & jails: µ-serv Gen8 E3-1260L, 16Go ECC + µ-serv N40L, 10Go ECC
-Réseau: APU2C4 (OpenWRT) + GS726Tv3 + 2x GS108Tv2 + Archer C5v1 (OpenWRT)
Top
Gibbo_07
n00b
n00b
Posts: 38
Joined: Sun Nov 15, 2009 1:47 pm
Location: Brisbane, AU

  • Quote

Post by Gibbo_07 » Mon Nov 30, 2009 7:22 am

Another thanks to an old but still worthy of praise topic.

Have tuned the script to my needs and works a damn treat has even saved my gentoo install already. I have a question/bug report however if the author/better gifted scripter than myself can work out why when I had set

Code: Select all

# patterns which should not be backed up (like iso files).
# example: default_exclude_pattern="*.iso *.divx"
# These pattern count only for files NOT listed in the $custom_include_list.
default_exclude_pattern="*.iso *.pk4"
I still have .pk4 files being backed up in the archive? They are located in /opt namely the quake4 data files which I don't need to have backed up, I would however like the config files and binary backed up so this is why I am trying to get this function to work rather than adding the dir to the exclude list.

+1 to anyone who can figure this out :)
Top
Gibbo_07
n00b
n00b
Posts: 38
Joined: Sun Nov 15, 2009 1:47 pm
Location: Brisbane, AU

  • Quote

Post by Gibbo_07 » Mon Nov 30, 2009 6:26 pm

I worked around the issue - added /opt/quake4 to the custom include list, and set the custom exclude pattern to match *.pk4. This works, my thinking is the global exclude is broken?

Thanks.
Top
rb34
Guru
Guru
Posts: 361
Joined: Sun Oct 03, 2004 9:34 pm
Location: Rome, italy

  • Quote

Post by rb34 » Sun Dec 06, 2009 9:24 pm

Hi all!
I found that the line

Code: Select all

`find /mnt -mount -name .keep`
should be

Code: Select all

`find /mnt -mount -name .keep`
because if you don't add -mount, find descends the whole directory structure of any mounted partition!!
That "bug" leads to two problems:
* if you, as me, have a partition with many dirs, the old find command takes a lot of time!
* and, if you have a backup made with rsnapshot (with many .keep files) on a mounted partition, the final command sent to "sh -c" can exceed the argument size limit!
Adding "-mount" makes find remain on the same partition, and this is fine, as we need only to find the .keep under /mnt and not on the mounted partitions
rb
Top
Gibbo_07
n00b
n00b
Posts: 38
Joined: Sun Nov 15, 2009 1:47 pm
Location: Brisbane, AU

  • Quote

Post by Gibbo_07 » Mon Dec 07, 2009 3:24 am

rb34 wrote:Hi all!
I found that the line

Code: Select all

`find /mnt -mount -name .keep`
should be

Code: Select all

`find /mnt -mount -name .keep`
because if you don't add -mount, find descends the whole directory structure of any mounted partition!!
That "bug" leads to two problems:
* if you, as me, have a partition with many dirs, the old find command takes a lot of time!
* and, if you have a backup made with rsnapshot (with many .keep files) on a mounted partition, the final command sent to "sh -c" can exceed the argument size limit!
Adding "-mount" makes find remain on the same partition, and this is fine, as we need only to find the .keep under /mnt and not on the mounted partitions
Both lines you posted are identical :oops:

Also I canno't find a line matching that?

edit: my bad I have v3.5 - should have gotten it from authors webpage first time around :)
Top
rb34
Guru
Guru
Posts: 361
Joined: Sun Oct 03, 2004 9:34 pm
Location: Rome, italy

  • Quote

Post by rb34 » Mon Dec 07, 2009 10:56 am

I'm sorry :) : the line

Code: Select all

`find /mnt -name .keep`
should be replaced with

Code: Select all

`find /mnt -mount -name .keep`
rb
Top
johabba
n00b
n00b
Posts: 22
Joined: Sun May 23, 2004 6:39 pm

  • Quote

Post by johabba » Tue Apr 20, 2010 6:09 pm

Gibbo_07 wrote: edit: my bad I have v3.5 - should have gotten it from authors webpage first time around :)
How exactly do you get this script? I tried to copy/paste from the author website but it does not copy the indents cleanly. I also tried "wget 'http://blinkeye.ch/dokuwiki/doku.php/projects/mkstage4'" hoping the script was wrapped in "pre" html flags and I could delete the rest of the html.

Maybe the author can use the "pre" html flag around the script? The "pre" html flag is used around the section starting with "Backup script v3.5". This section works with wget'ing and removing the surrounding html.
Top
Killerchronic
Tux's lil' helper
Tux's lil' helper
Posts: 91
Joined: Tue Apr 24, 2007 3:18 pm
Location: UK

  • Quote

Post by Killerchronic » Wed Dec 22, 2010 12:53 pm

johabba wrote: I tried to copy/paste from the author website but it does not copy the indents cleanly.
Not sure what your doing diff or if this has changed but a simple copy and paste worked fine for me, indents and all.



Thanks for this, been hunting for a backup solution, hopefully this will fill my need, was considering bacula but for 2 computers that are now fully setup i think its a bit much.
Top
kwispy
Tux's lil' helper
Tux's lil' helper
Posts: 82
Joined: Mon Mar 10, 2003 3:26 am
Contact:
Contact kwispy
Website

  • Quote

Post by kwispy » Thu Oct 08, 2015 1:51 pm

I went searching for the maintained mkstage4.sh on Google, as the original download link is broken. I found it on github, which seems to be the most up-to-date version, as it has been re-written a few times. It seems to be in the chymeric overlay.

FYI for anyone who is following in my frustrated tracks, and for continuity's sake.
Top
Astronome
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 148
Joined: Sat Jan 02, 2016 11:28 pm

  • Quote

Post by Astronome » Tue Jan 26, 2016 5:57 am

kwispy wrote:I went searching for the maintained mkstage4.sh on Google, as the original download link is broken. I found it on github, which seems to be the most up-to-date version, as it has been re-written a few times. It seems to be in the chymeric overlay.

FYI for anyone who is following in my frustrated tracks, and for continuity's sake.
Thanks! Works great and runs much faster than it did in 2005 :D
Top
pa1983
Tux's lil' helper
Tux's lil' helper
Posts: 101
Joined: Fri Jan 09, 2004 8:39 pm

  • Quote

Post by pa1983 » Fri Oct 28, 2016 9:44 pm

I just noticed that tar 1.29 seems bugged, found a bug report with the same problem as I have.
Basically -X or the exclude options dont seem to work so in my case it started to archive my external hard drive and well eventually would have tried to compress terabytes of data of my filserver :P

Anyway I was also annoyed by the time it takes to use tar. Single threaded so my 6 core CPU with 12 threads cant realy do much work.
I installed pbzip2 and used that as a compressor instead. This is how I compressed my gentoo install and it was MUCH faster, all 12 threads used to 100%.

tar -I pbzip2 -cvf /mnt/sdc1/voyager-20161028-stage4.tar.bz2 / -X stage4.excl

Anyway have not unpacked it since Im waiting for my new SSD but trying to harnes all the cores on a modern CPU shoukd be a goal and added to the wiki I think.

Anyway I got the info from here, testing it out.
http://stackoverflow.com/questions/1231 ... ompression
Gentoo server: R5 5600G 4.4Ghz, 32GB ram, 8TB SSD, 76TB HDD, NIC: 10Gbit + 2.5Gbit
Top
cv01302
n00b
n00b
Posts: 19
Joined: Sat Jan 08, 2005 11:30 am

  • Quote

Post by cv01302 » Sat Nov 19, 2016 6:05 pm

It's true!
I emerged pbzip2 (I had already installed tar-1.29-r1), modified the initial script to use pbzip2 instead of bz2 , htop shows all cores being used at 100%.
On i7-4771 , 13 GB of data (root partition only) were compressed to 3.5 GB (best option) in under 7.5 minutes. Unedited script did 16 mins so that's about double time (although I expected the difference to be even bigger).
Kudos to pa1983 for this nice tip!
Top
davidbrooke
Guru
Guru
Posts: 341
Joined: Sat Jan 03, 2015 12:31 am

  • Quote

Post by davidbrooke » Sat Nov 19, 2016 7:16 pm

The pbzip2 tip is nice but why not use something that actually works? The --exclude problem is a major road block.
I found fsarchiver
http://www.fsarchiver.org/Main_Page
via
https://wiki.gentoo.org/wiki/Backup
Fsarchiver has pbzip2 with other compression options as well as core / thread setup.
I tried both Fsarchiver and Mkstage4 and Fsarchiver worked better for me.
Top
cv01302
n00b
n00b
Posts: 19
Joined: Sat Jan 08, 2005 11:30 am

  • Quote

Post by cv01302 » Sun Nov 20, 2016 10:43 am

Well, with tar-1.29-r1 exclusions were kept so I guess no bug there as it was stated that existed in 1.29. My file was 3.5GB compressed, if it didn't include the exclusions, my user home partition would be there too, along with my other HDD partitions, file would be way, way larger than 3.5GB .
Just checked the archive too, indeed no file was included from the exclusion list, so I guess it is good to go. Real test would be to restore the image just to check everything works perfectly, this though at a later time.

I went ahead and tried the fsarchiver (with -A flag in order to simulate all conditions as before), used the exact same exclusions as with script, along with -j 8 (all cores) and -z 9 (best compression with lzma when z>7 . However no pbzip2 support as you stated, just lzo, gzip, bzip2 and lzma) results were 3.7GB data at 11 minutes. Changing it to -z 7 (lzma still but without the best compression), results were 3.9GB and an astonishing 3 minutes, so I guess it is a winner. Decompression will be way faster too due to lzma in comparison with pbzip2.
Fsarchiver looks indeed very promising, liked the checksumming of the data, ability to restore corrupt archives, as well as the ability to encrypt data with a password.

Nice tip David, thanks! Fsarchiver is the winner for me
Top
Post Reply

441 posts
  • Page 18 of 18
    • Jump to page:
  • Previous
  • 1
  • …
  • 14
  • 15
  • 16
  • 17
  • 18

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy