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 13 of 18
    • Jump to page:
  • Previous
  • 1
  • …
  • 11
  • 12
  • 13
  • 14
  • 15
  • …
  • 18
  • Next
Author
Message
Ejunkie
n00b
n00b
Posts: 58
Joined: Fri Jan 07, 2005 10:32 pm
Location: 127.0.0.1

  • Quote

Post by Ejunkie » Mon Nov 14, 2005 2:00 am

Sheepdogj15 wrote:actually hey BlinkEye, i wonder if there's a way to set it up to save your kernal .config file even if you don't save your sources. that if you have to dokernel recomplies later on you don't have to try to remember all the settings you had. i'm sure it's doable, i just don't know enough about bash scripting to try to customize it in :?
put it under "custom_include_list"

like so

Code: Select all

custom_include_list="
/usr/src/linux/.config
or
/usr/src/linux-`uname -r`/.config
"
Top
-valheru-
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 125
Joined: Wed Oct 26, 2005 11:37 am

  • Quote

Post by -valheru- » Mon Nov 14, 2005 2:41 pm

To be on the safe side I am repeating the restore process and will advise. Portgage is syncing right now. :P

EDIT: I noticed before and I'm sure I will again after the portage syncs that these commands:
10. mkdir /mnt/gentoo/proc
11. mount -t proc none /mnt/gentoo/proc
12. mkdir /mnt/gentoo/dev
Don't do anything because the proc and dev directories are already there. Does this only apply for someone who does the interactive, FULL, backup?

Thanks
Last edited by -valheru- on Mon Nov 14, 2005 6:28 pm, edited 1 time in total.
Top
BlinkEye
Veteran
Veteran
Posts: 1046
Joined: Tue Oct 21, 2003 7:13 pm
Location: Gentoo Forums

  • Quote

Post by BlinkEye » Mon Nov 14, 2005 3:58 pm

Ejunkie wrote:
Sheepdogj15 wrote:actually hey BlinkEye, i wonder if there's a way to set it up to save your kernal .config file even if you don't save your sources. that if you have to dokernel recomplies later on you don't have to try to remember all the settings you had. i'm sure it's doable, i just don't know enough about bash scripting to try to customize it in :?
put it under "custom_include_list"

like so

Code: Select all

custom_include_list="
/usr/src/linux/.config
or
/usr/src/linux-`uname -r`/.config
"
hmm, i had this very line in the custom_include_list myself. must have dropt out while customizing the script.
-valheru- wrote:To be on the safe side I am repeating the restore process and will advise. Portgage is syncing right now. :P

EDIT: I noticed before and I'm sure I will again after the portage syncs that these commands:
10. mkdir /mnt/gentoo/proc
11. mount -t proc none /mnt/gentoo/proc
12. mkdir /mnt/gentoo/dev
13. mount -o bind /dev /mnt/gentoo/dev
Don't do anything because the proc and dev directories are already there. Does this only apply for someone who does the interactive, FULL, backup?

Thanks
well, you mount a partition onto /mnt/gentoo in step 6. if you have a /dev and /proc directory still remaining on that partition you do not need to mkdir them (just to be sure - you don't extract the stage4 onto a partition/harddisk where you had a running (gentoo) linux installation, do you? if so, "delete" all the files by recreating a filesystem for example).
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Top
-valheru-
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 125
Joined: Wed Oct 26, 2005 11:37 am

  • Quote

Post by -valheru- » Mon Nov 14, 2005 4:04 pm

This was installed upon a freshly formated hard drive. I had guessed it was due to the my doing a full interactive backup. Since I used fdisk to delete and then re-create the filesystems, those directories should not have existed correct? Does doing the full, interactive backup save those directories? Thanks again.

EDIT: this happened 2x actually. Any ideas?
Top
Ejunkie
n00b
n00b
Posts: 58
Joined: Fri Jan 07, 2005 10:32 pm
Location: 127.0.0.1

  • Quote

Post by Ejunkie » Mon Nov 14, 2005 5:57 pm

-valheru- wrote:This was installed upon a freshly formated hard drive. I had guessed it was due to the my doing a full interactive backup. Since I used fdisk to delete and then re-create the filesystems, those directories should not have existed correct? Does doing the full, interactive backup save those directories? Thanks again.

EDIT: this happened 2x actually. Any ideas?
are the maps /mnt/gentoo/proc and /mnt/gentoo/dev/ are those maps empty if thay do just mount then else clear the partition again.
or do "dd if=/dev/zero of=/dev/hda2" ow where else you want to install gentoo.
Top
-valheru-
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 125
Joined: Wed Oct 26, 2005 11:37 am

  • Quote

Post by -valheru- » Mon Nov 14, 2005 6:10 pm

The hard drive the backup is being restored to is a freshly partitioned file system so there is not an existing proc or dev directory. I'll try "dd if=/dev/zero of=/dev/hdaX" and see what happens. I guess that clears or formats the drive?

I'll let you know what happens. I just thought the backup script backed up my existing proc and dev if I did the full, interactive backup telling it to backup everything. No biggie.

EDIT: I reviewed the script. Seems it does backup the proc and dev folders. So no problem then. Thanks. See below:

Code: Select all

# these files/directories are always excluded. don't add trailing slashes. 
# don't touch it unless you know what you are doing! 
# /var/db and /var/cache/edb are intentionally added here. they are listed 
# in $default_include_folders 
default_exclude_list=" 
/dev 
/lost+found 
/mnt 
/proc 
/sys 
/tmp 
/usr/portage 
/usr/src 
/var/log 
/var/tmp 
/var/db 
/var/cache/edb 
$stage4Location 
`echo $CCACHE_DIR`" 

# files/devices/folders, which need to be backed up (preserve folder structure). 
# don't touch it unless you know what you are doing! no recursive backup of folders. 
# use $default_include_folders instead. 
default_include_files=" 
/dev/null 
/dev/console 
/home 
/mnt 
/proc 
/sys 
/tmp 
/usr/portage 
/usr/src 
/var/log/emerge.log" 
Top
BlinkEye
Veteran
Veteran
Posts: 1046
Joined: Tue Oct 21, 2003 7:13 pm
Location: Gentoo Forums

  • Quote

Post by BlinkEye » Mon Nov 14, 2005 10:59 pm

i made some minor changes to the howto and the script itself. i tried to include all the tips given since the last time. i inserted a new link at the beginning of the first post - i've put the howto into my wiki as it's far easier to maintain and to read.
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Top
-valheru-
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 125
Joined: Wed Oct 26, 2005 11:37 am

  • Quote

Post by -valheru- » Tue Nov 15, 2005 3:38 pm

Cool. What is the link to your wiki?

EDIT: Nevermind, followed the link in your signature to the other forum which has a link to your WIKI. THANKS :P

EDIT: YOU PLACED my name in your WIKI-------WHHOOOOOHOOOOOOOOO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

:lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:
Top
paulb787
Apprentice
Apprentice
Posts: 250
Joined: Mon Nov 14, 2005 1:56 pm

  • Quote

Post by paulb787 » Fri Nov 18, 2005 7:52 am

i dont understand steps 10 and 11 under restore? are these steps nessacary if u have done a full(everything) backup. because i have /proc direstory?

10. mount -t proc none /mnt/gentoo/proc
11. mount -o bind /dev /mnt/gentoo/dev
Top
-valheru-
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 125
Joined: Wed Oct 26, 2005 11:37 am

  • Quote

Post by -valheru- » Fri Nov 18, 2005 2:17 pm

well you still have to MOUNT them, just not MKDIR them.
Top
b8zs
n00b
n00b
Posts: 11
Joined: Wed Oct 26, 2005 12:08 am

  • Quote

Post by b8zs » Wed Nov 23, 2005 4:27 am

If I have /dev/md1 as /
and /dev/md0 as /boot

Would I be able to use this script to backup my machine?

I'm thinking just make it copy over my raidtab file, but will I run into any snags with a software raid0?
Top
Ejunkie
n00b
n00b
Posts: 58
Joined: Fri Jan 07, 2005 10:32 pm
Location: 127.0.0.1

  • Quote

Post by Ejunkie » Wed Nov 23, 2005 12:08 pm

b8zs wrote:If I have /dev/md1 as /
and /dev/md0 as /boot

Would I be able to use this script to backup my machine?

I'm thinking just make it copy over my raidtab file, but will I run into any snags with a software raid0?

yes for so var i know you can use it.
Top
zigver
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 87
Joined: Fri May 09, 2003 5:12 am

  • Quote

Post by zigver » Fri Nov 25, 2005 4:09 am

Not really a problem with the script but has anyone noticed that 'uname -r' for the latest gentoo-sources doesn't report what is in /usr/src? It's easily fixed with a link but an odd issue. Has this always been the case and I just didn't notice?
Top
satanskin
Guru
Guru
Posts: 353
Joined: Mon Apr 25, 2005 1:37 am

  • Quote

Post by satanskin » Sun Nov 27, 2005 4:07 am

Ok, not sure if this has been mentioned before or not but it seems that no matter what I do, the integrity check at the end always fails. I get this at the end:

Code: Select all

* stage4 is done
* umounting boot
* Checking integrity
* Integrity check failed. Re-run the script and check your hardware.
thor satanskin # 
I'm not sure why it would fail so many times when nothing should be wrong. Any ideas?
Top
BlinkEye
Veteran
Veteran
Posts: 1046
Joined: Tue Oct 21, 2003 7:13 pm
Location: Gentoo Forums

  • Quote

Post by BlinkEye » Sun Nov 27, 2005 2:15 pm

this integrity check happens to fail for me too sometimes. i'm not yet sure why this happens - because i'm almost confident the stage4 is intact anyway.

do you still have suche a "broken" stage4 ? please run the following command and post the output:

Code: Select all

gzip --test  stage4.tar.gz
or

Code: Select all

bzip2 --test  stage4.tar.bz2
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Top
satanskin
Guru
Guru
Posts: 353
Joined: Mon Apr 25, 2005 1:37 am

  • Quote

Post by satanskin » Mon Nov 28, 2005 3:40 am

Yes, it still says that it is failing. In regards to the command you suggested:

Code: Select all

thor satanskin # bzip2 --test /mnt/tyr/stage4/thor-stage4-2005.11.23-custom.tar.bz2_a
bzip2: /mnt/tyr/stage4/thor-stage4-2005.11.23-custom.tar.bz2_a: data integrity (CRC) error in data

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

thor satanskin # 
Top
BlinkEye
Veteran
Veteran
Posts: 1046
Joined: Tue Oct 21, 2003 7:13 pm
Location: Gentoo Forums

  • Quote

Post by BlinkEye » Mon Nov 28, 2005 10:27 am

ah, you use a splitted stage4. could you please post the output of:

Code: Select all

cat stage4.bz2_* | bzip2 --test
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Top
satanskin
Guru
Guru
Posts: 353
Joined: Mon Apr 25, 2005 1:37 am

  • Quote

Post by satanskin » Tue Nov 29, 2005 2:01 am

Code: Select all

thor satanskin # cat /mnt/tyr/stage4/thor-stage4-2005.11.23-custom.tar.bz2_* | bzip2 --test
bzip2: (stdin): data integrity (CRC) error in data

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

thor satanskin # 
Top
BlinkEye
Veteran
Veteran
Posts: 1046
Joined: Tue Oct 21, 2003 7:13 pm
Location: Gentoo Forums

  • Quote

Post by BlinkEye » Tue Nov 29, 2005 9:06 am

ok, I think this really is a tar/gzip/bzip2 (or for that matter a hardware) issue and AFAIK has nothing to do with my script.

http://www.gzip.org/#faq1
http://mail-index.netbsd.org/current-us ... /0012.html (very old)

I suggest you try to contact a tar/bzip2 users list, maybe you find the problem. did you ever extract such a faulty stage4? have you tried on a different box?
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Top
satanskin
Guru
Guru
Posts: 353
Joined: Mon Apr 25, 2005 1:37 am

  • Quote

Post by satanskin » Fri Dec 02, 2005 5:23 am

no, haven't tried extracting it yet, but perhaps i can try it in a few days. Thanks for trying though man and thanks for the nice script!
Top
-valheru-
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 125
Joined: Wed Oct 26, 2005 11:37 am

  • Quote

Post by -valheru- » Sat Dec 03, 2005 5:07 pm

I too get errors trying to bz2 with a file over 2.5 gigs. File intergrity error.

gz is fine though.
Top
carpman
Advocate
Advocate
Posts: 2202
Joined: Thu Jun 20, 2002 2:42 pm
Location: London - UK

  • Quote

Post by carpman » Sat Dec 03, 2005 5:39 pm

-valheru- wrote:I too get errors trying to bz2 with a file over 2.5 gigs. File intergrity error.

gz is fine though.
i have a 5gb backup that is fine!
Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb
Top
bingobob
Apprentice
Apprentice
User avatar
Posts: 296
Joined: Mon Apr 05, 2004 10:07 am
Location: Hertfordshire, UK

  • Quote

Post by bingobob » Sat Dec 03, 2005 7:05 pm

This script is great. One thing though. I would like to run it each week from a cron script. How can i make it non-interactive?
Top
amaroc
Tux's lil' helper
Tux's lil' helper
Posts: 99
Joined: Sun Nov 13, 2005 11:57 am

  • Quote

Post by amaroc » Sun Dec 04, 2005 5:45 pm

BlinkEye,

great script, really easy to use.

I'm doing the minimal-tgz-backup to my Buffalo-LinkStation via WLAN. The ftp-backupdrive is mounted via lufs

Code: Select all

lufis fs=ftpfs,host=my_host,username=foo,password=bar,ftpactive /mnt/backups/ 
and it works flawlessly.

Thanks!

PS: I did not modify the script to handle /home, /usr/src, etc. according to my needs. Such directories will be backuped using krusader's built-in ftp- and archive-capabilities.
Top
andrewd18
Guru
Guru
User avatar
Posts: 364
Joined: Sun Apr 11, 2004 4:21 pm
Location: Wisconsin, USA

  • Quote

Post by andrewd18 » Mon Dec 05, 2005 12:11 am

I'm getting an issue - it can't pass the integrity check...

Code: Select all

StubbornAesthetics ~ # ./mkstage4.sh


Backup script v3.6
==================

What do you want to do? (Use CONTROL-C to abort)

Fast (tar.gz):
 (1) Minimal backup
 (2) Interactive backup


Best (tar.bz2):
 (3) Minimal backup
 (4) Interactive backup

Please enter your option: 3

* mounting boot

Do you want to continue? (y/n) y
* creating directory /media/IOMEGA_HDD/Backups/stage4

* Please wait while the stage4 is being created.

sh: line 1:  2708 Broken pipe             /usr/bin/find /* -path /dev -prune -o -path /lost+found -prune -o -path /mnt -prune -o -path /media -prune -o -path /proc -prune -o -path /sys -prune -o -path /tmp -prune -o -path /usr/portage -prune -o -path /usr/src -prune -o -path /var/log -prune -o -path /var/tmp -prune -o -path /var/db -prune -o -path /var/cache/edb -prune -o -path /media/IOMEGA_HDD/Backups/stage4 -prune -o -path /home/andrew -prune -o -path /home/lost+found -prune -o -path /usr/src/linux-2.6.14-gentoo-r2 -prune -o -print
sh: line 1:  2663 Done(141)               ( /usr/bin/find /var/db; echo /usr/src/linux-2.6.14-gentoo-r2/.config; echo /var/log/emerge.log; echo /usr/src; echo /usr/portage; echo /tmp; echo /sys; echo /proc; echo /media; echo /mnt/floppy/.keep; echo /mnt/cdrom/.keep; echo /mnt/.keep; echo /mnt; echo /home; echo /dev/console; echo /dev/null; /usr/bin/find /* -path /dev -prune -o -path /lost+found -prune -o -path /mnt -prune -o -path /media -prune -o -path /proc -prune -o -path /sys -prune -o -path /tmp -prune -o -path /usr/portage -prune -o -path /usr/src -prune -o -path /var/log -prune -o -path /var/tmp -prune -o -path /var/db -prune -o -path /var/cache/edb -prune -o -path /media/IOMEGA_HDD/Backups/stage4 -prune -o -path /home/andrew -prune -o -path /home/lost+found -prune -o -path /usr/src/linux-2.6.14-gentoo-r2 -prune -o -print )
      2665 Broken pipe             | /bin/tar --bzip2 --preserve-permissions --create --absolute-names --totals --ignore-failed-read --file /media/IOMEGA_HDD/Backups/stage4/StubbornAesthetics-stage4-2005.12.04-minimal.tar.bz2 --no-recursion -T -

* stage4 is done
* umounting boot
* Checking integrity
* Integrity check failed. Re-run the script and check your hardware.
Suggestions? Same problem funkoolow had, but there was no answer posted to his inquiry.

~~ Andrew D.
Keep Your Toolchain Stable! - emwrap.sh

There's no place like ::1
Top
Post Reply

441 posts
  • Page 13 of 18
    • Jump to page:
  • Previous
  • 1
  • …
  • 11
  • 12
  • 13
  • 14
  • 15
  • …
  • 18
  • Next

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