Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Easily make a full system backup (stage4)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... , 16, 17, 18  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
neophyte46
Apprentice
Apprentice


Joined: 16 Mar 2004
Posts: 171
Location: Australia

PostPosted: Fri Nov 10, 2006 4:11 pm    Post subject: Reply with quote

Just wanted to say thanks for an awesome script.

My installation was originally on an ide drive. I unpacked it onto an sata raid array and it worked nicely.

I've got this backing up my raid 5 server to an external drive as well.

I just tried it on my desktop and it worked flawlessly except my gnome logs half way in and jusst sits there before it finishes. I haven't been able to solve this issue so i'm going to try and re-emerge gnome to see if it can fix whatever the problem is.
_________________
Acer Aspire 1690; Pentium M 1.73Ghz, 1gig DDRII 533mhz dual channel, ATI 128mb x700 PCIE,
Athlon 64 X2 3800+ @ 2.5Ghz, 2gig DDR 400, 4x120gig sata raid, A8N-SLI, ASUS 256mb 7800GTX Extreme
http://codelines.net.au - Software design and development
Back to top
View user's profile Send private message
DEP3
n00b
n00b


Joined: 11 Nov 2006
Posts: 1

PostPosted: Sat Nov 11, 2006 4:16 am    Post subject: Reply with quote

thanks alot. very useful...
_________________
http://www.dep3.com
Back to top
View user's profile Send private message
pacho2
Developer
Developer


Joined: 04 Mar 2005
Posts: 2582
Location: Oviedo, Spain

PostPosted: Tue Nov 28, 2006 12:06 pm    Post subject: Reply with quote

It doesn't work properly for me :-(, it only creates a tiny 50 mb file.

I have downloaded the script from ftp://blinkeye.ch/gentoo/mkstage4.sh

This is the script I am using:
Code:

#!/bin/bash
# Backup script for Gentoo Linux
# mkstage4s.h is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# mkstage4.sh is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# Copyright: Reto Glauser aka blinkeye
# Mailto: stage4 at blinkeye dot ch
# Homepage: http://blinkeye.ch
# Forum post: http://forums.gentoo.org/viewtopic-t-312817.html
# Date: 2005-11-14

version=v3.6
basename=`basename $0`

find=/usr/bin/find
tar=/bin/tar

# these are the commands we actually need for the backup
command_list=(cut date echo $find grep hostname mount sh split $tar umount uname which)

# verify that each command we use exists. if one can't be found use $PATH and make a suggestion if possible.
for command in ${command_list[@]}; do
        if [ ! -x "`which $command 2>&1`" ]; then
                echo -e "\nERROR: $command not found! "
                base=`basename $command`
                if [ "`which $base 2>&1 | grep "no \`basename $command\` in"`" != "" ]; then
                        echo -e "ERROR: $base is not in your \$PATH."
                fi
                exit -1
        fi
done

help="\nUsage:\n\nsh `basename $0` [[-v]|[--verbose]] [[-s]|[--split]] \n\nTo run the script NOT in verbose mode comes in handy if you want to see only the errors that occur during the backup.\n"

# Defaults to creating one tarball
tar_output="--file"

# split command
split_options="--suffix-length=1 --bytes=700m"

# options for the tar command
tarOptions=" --preserve-permissions --create --absolute-names --totals --ignore-failed-read"

# where to put the stage4
stage4Location=/mnt/backups/stage4

# name prefix
stage4prefix=`hostname`-stage4-`date +\%Y.\%m.\%d`

# 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=""

# 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
/mastercd
/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
`find /mnt -name .keep`
/proc
/sys
/tmp
/usr/portage
/usr/src
/var/log/emerge.log
/usr/src/linux-`uname -r`/.config"

# folders, which need to be backed up recursively on every backup.
# don't touch it unless you know what you are doing! the reason for this
# variable is that some users add /var to the $default_exclude_list. here
# we ensure that portage's memory is backed up in any case.
default_include_folders="
/var/db"

# IMPORTANT: A minimal backup will EXCLUDE files/folders listed here. A custom backup will
# include/exclude these files/folders depening on your answer.
custom_include_list="
/home/*
/usr/src/linux-`uname -r`"

# add files/folders here which are subfolders of a folder listed in $custom_include_list which should NOT
# be backed up. eg.
#custom_exclude_list="/home/foo/mp3 /home/foo/downloads /home/foo/.*"
custom_exclude_list=""

# Only files/folders within the $custom_include_list are checked against these patterns
# custom_exclude_pattern="*.mp3 *.iso"
custom_exclude_pattern=""

# the find_command
find_command="$find /*"

# don't backup anything which matches pattern listed in $default_exclude_pattern
for pattern in $default_exclude_pattern; do
        find_command="$find_command -not -name $pattern"
done

# assemble the find_command
function find_files()
{
        for folder in $default_exclude_list; do
                find_command="$find_command -path $folder -prune -o"
        done

        find_command="$find_command -print"

        for i in $default_include_files; do
                find_command="echo $i; $find_command"
        done

        for i in $default_include_folders; do
                if [ -d $i ]; then
                        find_command="$find $i; $find_command"
                else
                        find_command="echo $i; $find_command"
                fi
        done
}

# check the exclude/include variables for non-existing entries
function verify()
{
        for i in $1; do
                if [ ! -e "`echo "$i" | cut -d'=' -f2 | cut -d'*' -f1`" -a "$i" != "/lost+found" -a "$i" != "$stage4Location" ]; then
                        echo "ERROR: `echo "$i" | cut -d'=' -f2` not found! Check your "$2
                        exit 0
                fi
        done
}

# check input parameters
while [ $1 ]; do
        case  $1 in
        "-h" | "--help")
                echo -e $help
                exit 0;;
        "-v" | "--verbose")
                verbose=$1;;
        "-s" | "--split")
                tar_output="--split";;
        "");;
        *)
                echo -e $help
                exit 0;;
        esac
        shift
done

echo ""

# check folder/files listed in $default_exclude_list exist
verify "$default_exclude_list" "\$default_exclude_list"

# check files listed in $default_include_files exist
verify "$default_include_files" "\$default_include_files"

# check folder listed in $default_include_folders exist
verify "$default_include_folders" "\$default_include_folders"

#check folder listed in $custom_include_list exist
verify "$custom_include_list" "\$custom_include_list"

#check folder listed in $custom_exclude_list exist
verify "$custom_exclude_list" "\$custom_exclude_list"

# print out the version
 echo -e "\nBackup script $version"
 echo -e "=================="

# how do you want to backup?
echo -e "\nWhat do you want to do? (Use CONTROL-C to abort)\n
Fast (tar.gz):
 (1) Minimal backup
 (2) Interactive backup


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

while [ "$option" != '1' -a "$option" != '2' -a "$option" != '3' -a "$option" != '4' ]; do
        echo -en "Please enter your option: "
        read option
done

case $option in
[1,3])
        stage4Name=$stage4Location/$stage4prefix-minimal.tar;;

[2,4])
        stage4Name=$stage4Location/$stage4prefix-custom.tar

        for folder in $custom_include_list; do
                echo -en "\nDo you want to backup" `echo "$folder" | cut -d'=' -f2`"? (y/n) "
                read answer
                while [ "$answer" != 'y' -a "$answer" != 'n' ]; do
                        echo -en "Do you want to backup" `echo "$folder" | cut -d'=' -f2`"? (y/n) "
                        read answer
                done
                if [ "$answer" == 'n' ]; then
                        find_command="$find_command -path $folder -prune -o"
                else
                        custom_find="$find $folder"
                        for i in $custom_exclude_pattern; do
                                custom_find="$custom_find -name $i -o"
                        done
                        for i in $custom_exclude_list; do
                                custom_find="$custom_find -path $i -prune -o"
                        done
                        find_command="$custom_find -print; $find_command"
                fi
        done ;;
esac

# add $custom_include_list to the $default_exclude_list as we assembled
# $custom_find with $custom_include_list already.
default_exclude_list="$default_exclude_list $custom_include_list"

case $option in
[1,2])
        stage4postfix="gz"
        zip="--gzip";;

[3,4])
        stage4postfix="bz2"
        zip="--bzip2";;
esac

# mount boot
echo -e "\n* mounting boot"
mount /boot >/dev/null 2>&1

# find the files/folder to backup
find_files
find_command="($find_command)"

# create the final command
if [ "$tar_output" == "--file" ]; then
        tar_command="$find_command | $tar $zip $tarOptions $verbose --file $stage4Name.$stage4postfix --no-recursion -T -"
else
        tar_command="$find_command | $tar $zip $tarOptions $verbose --no-recursion -T - | split $split_options - "$stage4Name.$stage4postfix"_"
fi

if [ "$verbose" ]; then
        echo -e "\n* creating the stage4 in $stage4Location with the following command:\n\n"$tar_command
fi

# everything is set, are you sure to continue?
echo -ne "\nDo you want to continue? (y/n) "
read answer
while [ "$answer" != 'y' ] && [ "$answer" != 'n' ]; do
        echo -ne "Do you want to continue? (y/n) "
        read answer
done

if [ "$answer" == 'y' ]; then
        # check whether the file already exists.
        if [ "$tar_output" == "--split" ]; then
                overwrite="`ls "$stage4Name.$stage4postfix"_* 2>&1 | grep -v 'No such file'`"
        else
                overwrite="$stage4Name.$stage4postfix"
        fi

        if [ -a "`echo "$overwrite" | grep "$overwrite" -m1`" ]; then
                echo -en "\nDo you want to overwrite $overwrite? (y/n) "
                read answer
                while [ "$answer" != 'y' ] && [ "$answer" != 'n' ]; do
                        echo -en "Do you want to overwrite $overwrite? (y/n) "
                        read answer
                done
                if [ "$answer" == 'n' ]; then
                        echo -e "\n* There's nothing to do ... Exiting"
                        exit 0;
                fi
        fi

        # if necessary, create the stage4Location
        if [ ! -d "$stage4Location" ] ; then
                echo "* creating directory $stage4Location"
                mkdir -p $stage4Location
        fi

        echo -e "\n* Please wait while the stage4 is being created.\n"

        # do the backup.
        sh -c "$tar_command"

        # finished, clean up
        echo -e "\n* stage4 is done"
        echo "* umounting boot"
        umount /boot >/dev/null 2>&1

        # Integrity check
        echo -e "* Checking integrity"
        if [ "$zip" == "--gzip" ]; then
                zip="gzip"
        else
                zip="bzip2"
        fi

        if [ "$tar_output" == "--split" ]; then
                if [ "`cat "$stage4Name.$stage4postfix"_*"" | $zip --test 2>&1`" != "" ]; then
                        echo -e "* Integrity check failed. Re-run the script and check your hardware."
                        exit -1
                fi
        else
                if [ "`$zip --test  $stage4Name.$stage4postfix 2>&1`" != "" ]; then
                        echo -e "* Integrity check failed. Re-run the script and check your hardware."
                        exit -1
                fi
        fi

        # everything went smoothly"
        echo -e "* Everything went smoothly. You successfully created a stage4."

else
        echo -e "\n* There's nothing to do ... Exiting"
fi


It runs the following command:
Code:

* creating the stage4 in /mnt/backups/stage4 with the following command:

(/usr/bin/find /var/db; echo /usr/src/linux-2.6.18-gentoo-r3/.config; echo /var/log/emerge.log; echo /usr/src; echo /usr/portage; echo /tmp; echo /sys; echo /proc; echo /mnt/.keep; echo /mnt; echo /home; echo /dev/console; echo /dev/null; /usr/bin/find /bin /boot /cdrom /cdrom2 /celestia /dev /emul /etc /floppy /home /lib /lib32 /lib64 /lost+found /mandriva /mastercd /media /mnt /opt /proc /root /sbin /sys /tmp /usr /var /windows -path /home/marga -prune -o -path /home/Mi disco -prune -o -path /home/osorio -prune -o -path /home/osorio-mdv -prune -o -path /home/osorio-suse -prune -o -path /home/osorio-ubu -prune -o -path /home/pacho -prune -o -path /home/pacho-mdv -prune -o -path /home/pacho-suse -prune -o -path /home/pacho-ubu -prune -o -path /home/pati -prune -o -path /home/peter -prune -o -path /home/pipo -prune -o -path /home/rey -prune -o -path /home/test -prune -o -path /usr/src/linux-2.6.18-gentoo-r3 -prune -o -path /dev -prune -o -path /lost+found -prune -o -path /mnt -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 /mastercd -prune -o -path /var/cache/edb -prune -o -path /mnt/backups/stage4 -prune -o -path /var/tmp/ccache -prune -o -path /home/marga -prune -o -path /home/Mi disco -prune -o -path /home/osorio -prune -o -path /home/osorio-mdv -prune -o -path /home/osorio-suse -prune -o -path /home/osorio-ubu -prune -o -path /home/pacho -prune -o -path /home/pacho-mdv -prune -o -path /home/pacho-suse -prune -o -path /home/pacho-ubu -prune -o -path /home/pati -prune -o -path /home/peter -prune -o -path /home/pipo -prune -o -path /home/rey -prune -o -path /home/test -prune -o -path /usr/src/linux-2.6.18-gentoo-r3 -prune -o -print) | /bin/tar --gzip --preserve-permissions --create --absolute-names --totals --ignore-failed-read -v --no-recursion -T - | split --suffix-length=1 --bytes=700m - /mnt/backups/stage4/belkin2-stage4-2006.11.28-custom.tar.gz_

Do you want to continue? (y/n)


This is my df output:
Code:

/dev/hda1             58635388  31885940  26749448  55% /
udev                   1029976       244   1029732   1% /dev
/dev/hda5             20008280  13171428   6836852  66% /home
shm                    1029976         0   1029976   0% /dev/shm


Thanks a lot
Back to top
View user's profile Send private message
pacho2
Developer
Developer


Joined: 04 Mar 2005
Posts: 2582
Location: Oviedo, Spain

PostPosted: Fri Dec 01, 2006 11:00 am    Post subject: Reply with quote

Nothing? :(
Back to top
View user's profile Send private message
pacho2
Developer
Developer


Joined: 04 Mar 2005
Posts: 2582
Location: Oviedo, Spain

PostPosted: Sat Dec 02, 2006 12:00 am    Post subject: Reply with quote

This is the end of the tarball created:
Code:
........
     30 -rw-r--r--  root/root Sep  5 12:51 2006 /var/db/pkg/games-rpg/bass-1.2/RDEPEND
     20 -rw-r--r--  root/root Sep  5 12:51 2006 /var/db/pkg/games-rpg/bass-1.2/CBUILD
     27 -rw-r--r--  root/root Sep  5 12:51 2006 /var/db/pkg/games-rpg/bass-1.2/CFLAGS
    800 -rw-r--r--  root/root Sep  5 12:51 2006 /var/db/pkg/games-rpg/bass-1.2/bass-1.2.ebuild
     45 -rw-r--r--  root/root Sep  5 12:51 2006 /var/db/pkg/games-rpg/bass-1.2/DEPEND
      0 drwxr-xr-x  root/root Nov 28 10:31 2006 /var/db/webapps/
      0 drwxr-xr-x  root/root Oct 20 13:12 2006 /var/db/webapps/mediawiki/
      0 drwxr-xr-x  root/root Oct 20 13:09 2006 /var/db/webapps/mediawiki/1.6.8/
      1 -rw-------  root/root Oct 20 13:09 2006 /var/db/webapps/mediawiki/1.6.8/installs
      0 drwxr-xr-x  root/root Oct 20 13:41 2006 /var/db/webapps/mediawiki/1.7.1/
      0 -rw-r--r--  root/root Oct 20 13:41 2006 /var/db/webapps/mediawiki/1.7.1/.keep_www-apps_mediawiki-1.7.1
     52 -rw-------  root/root Oct 20 13:41 2006 /var/db/webapps/mediawiki/1.7.1/installs
      0 -rw-r--r--  root/root Nov 28 10:31 2006 /var/db/webapps/.keep_app-admin_webapp-config-0
  39579 -rw-r--r--  root/root Nov 28 11:06 2006 /usr/src/linux-2.6.18-gentoo-r3/.config
5888766 -rw-rw----  portage/portage Nov 29 22:00 2006 /var/log/emerge.log
      0 drwxr-xr-x  root/root Nov 28 12:52 2006 /usr/src/
      0 drwxr-xr-x  portage/portage Nov 28 11:54 2006 /usr/portage/
      0 drwxrwxrwt  root/root Nov 29 22:04 2006 /tmp/
      0 drwxr-xr-x  root/root Nov 29 22:12 2006 /sys/
      0 dr-xr-xr-x  root/root Nov 29 22:12 2006 /proc/
      0 -rw-r--r--  root/root Mar  4 16:28 2005 /mnt/.keep
      0 drwxr-xr-x  root/root Jul 16 19:04 2006 /mnt/
      0 drwxr-xr-x  root/root Nov 21 20:05 2006 /home/
  5   1 crw-------  root/tty Nov 29 21:13 2006 /dev/console
  1   3 crwxrwxrwx  root/root Oct 22 01:01 2000 /dev/null


The same script works fine on my notebook, but not in my desktop computer (it worked 15 days ago, but now it doesn't work)

Thanks
Back to top
View user's profile Send private message
sfragis
Tux's lil' helper
Tux's lil' helper


Joined: 24 Mar 2005
Posts: 95
Location: RE < IT < Europe

PostPosted: Sat Dec 02, 2006 3:08 pm    Post subject: Reply with quote

Hi BlinkEye, thanks for the script.
Starting from an idea of a friend of mine, time ago I did a small script, not much different from your.
For those who are interested, you can download it from here.
The goal of my script was to provide a certain safety against data corruption.
While the base logic is quite the same (use find to create the list of files, use exclusion patterns), the tools I used change:

  • afio instead of tar because it's more suitable for data recovering (given two offset you can always extract the relative content from the archive).
  • par2 (app-arch/par2cmdline in portage) which creates parity files and can be useful to recover damaged data (according with the chosen protection level).
  • md5sum to checksum the archives and detect data corruption or loss.

Feel free to use part or all of the code if it can be useful to improve your script.
_________________
Regards
Fabio Strozzi
Back to top
View user's profile Send private message
pacho2
Developer
Developer


Joined: 04 Mar 2005
Posts: 2582
Location: Oviedo, Spain

PostPosted: Wed Dec 06, 2006 11:03 am    Post subject: Reply with quote

The problem persists, script stops without make a properly backup :-(
Back to top
View user's profile Send private message
hirakendu
Guru
Guru


Joined: 24 Jan 2007
Posts: 386
Location: san diego

PostPosted: Sat Feb 03, 2007 4:06 am    Post subject: Reply with quote

frankly, i dont understand why so much effort. i do understand that the intricacy is only because it is being done from inside the working gentoo? what i do is boot using a live cd and simply do tarring along with gzip/bzip2/lzma on the root partition. and a simple extraction on a freshly formatted drive is enough for restoring.

so, for creating image :
$ cd /gentoo/ ( /gentoo/ being the mounted root partition containing bin, boot, usr, etc after booting with a livecd.)
$ tar -cvps --atime-preserve * | lzma e -si -so > /data/gentoo-img.tar.lzma (for a lzma archive)
(or)
$ tar -cvzps --atime-preserve -f /data/gentoo-img.tar.gz * (for gzip archive)

and for restoring from image :
$ mkreiserfs /dev/sdaX
$ mount /dev/sdaX /gentoo
$ cat /data/gentoo-img.tar.lzma | lzma d -si -so | tar -xps --atime-preserve -C /gentoo/ ( from lzma archive)
(or)
$ tar -xvzps --atime-preserve -f /data/gentoo-img.tar.gz -C /gentoo/ (from gzip archive)

and after that, the usual (re)installation of grub and editing some configs (fstab, grub.conf, net , hostname, xorg.conf) to one's liking, just as is done in case of stage3.

btw, i created an archive of a system buit with cflags "o2, prescott" for cpu's with sse3 +. and the image works fine on all machines, inlcuding athlon 64x2's. (yeah all those performance loss fundaes dont work - its 'the' same - atleast with tests like openssl and superpi. ~infinite uptimes, no crashes, stable , fast and responsive.)

my system is about 5.0gb and it takes 15 minutes with gzip and 1hour,30mins with lzma to compress. while decompressing, gzip takes 15 minutes while lzma takes 7 minutes (flat!). btw, gzip compresses it to about 1.6 gb while lzma does it to about 1.1 gb. (this is on a athlon 64x2 3800+ with sata drive @ 67 MB/s (hdparm -tT) and a 16x dvd drive.)

hirakendu.
_________________
Helium Sources || Gentoo Minimal Livecd
Back to top
View user's profile Send private message
vicaya
n00b
n00b


Joined: 26 Jun 2004
Posts: 57

PostPosted: Wed Feb 07, 2007 6:18 pm    Post subject: Reply with quote

hirakendu wrote:
frankly, i dont understand why so much effort. i do understand that the intricacy is only because it is being done from inside the working gentoo? what i do is boot using a live cd and simply do tarring along with gzip/bzip2/lzma on the root partition. and a simple extraction on a freshly formatted drive is enough for restoring.

frankly, i don't understand why do you need to post this, as you already understand the overwhelming advantage of the script: you can backup your system without downtime, and regardless of your partition scheme! I have all my system on lvm2. Thanks to his script, I can do weekly system backup (and daily incremental rsync of /home) without downtime.

Quote:
btw, i created an archive of a system buit with cflags "o2, prescott" for cpu's with sse3 +. and the image works fine on all machines, inlcuding athlon 64x2's. (yeah all those performance loss fundaes dont work - its 'the' same - atleast with tests like openssl and superpi. ~infinite uptimes, no crashes, stable , fast and responsive.)

Huh, how can you have ~infinite uptime, when you have to do the backup in livecd all the time?
Back to top
View user's profile Send private message
hirakendu
Guru
Guru


Joined: 24 Jan 2007
Posts: 386
Location: san diego

PostPosted: Wed Feb 07, 2007 7:40 pm    Post subject: Reply with quote

k, now i get it - that its if you have whatever funky setups. thanks.

just wanted to reflect on the stability. wonder why you take it literally ;-).
_________________
Helium Sources || Gentoo Minimal Livecd
Back to top
View user's profile Send private message
eduardo451
Apprentice
Apprentice


Joined: 29 Apr 2005
Posts: 173
Location: Indianapolis, IN

PostPosted: Thu Mar 15, 2007 3:47 am    Post subject: Reply with quote

Does it have to be the LiveCD, or will it work with the minimal install CD? I don't have enough RAM to docache the LiveCD.
_________________
"The difference between genius and stupidity is that genius has its limits." Albert Einstein
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Thu Mar 15, 2007 3:54 am    Post subject: Reply with quote

eduardo451 wrote:
Does it have to be the LiveCD, or will it work with the minimal install CD? I don't have enough RAM to docache the LiveCD.


The minimal CD will be just fine :)
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
eduardo451
Apprentice
Apprentice


Joined: 29 Apr 2005
Posts: 173
Location: Indianapolis, IN

PostPosted: Fri Mar 16, 2007 2:50 am    Post subject: Reply with quote

Thanks! Just completed using the script to repartition my drive to get rid of Windows (don't need at all now) and give Gentoo the full drive. Am typing this from my restored system. Thanks to the script I was able to easily accomplish this in one evening and preserve my system of two years. Great work!
_________________
"The difference between genius and stupidity is that genius has its limits." Albert Einstein
Back to top
View user's profile Send private message
jsporring
n00b
n00b


Joined: 08 Sep 2004
Posts: 24

PostPosted: Mon Jun 04, 2007 7:42 am    Post subject: Fix for missing eth0 after restore with mkstage4.sh Reply with quote

Dear all,

This is a nice script. I used it to install 2 out of 3 identical systems. However, I met the following problem: "missing eth0" after having copied a fresh install of machine 1 onto machine 2 and 3. It appears that udev gave a conflict, in any case removing /etc/udev/rules.d/70-persistent-net.rules solved the problem. Maybe a check should be added to the script. I would also recommend adding /opt to the list of directories to be backed up.

Best, Jon
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Mon Jun 04, 2007 7:14 pm    Post subject: Reply with quote

If you want to tansfert a HDD to an another. maybe you should use the Stage 5.
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
fidel
Guru
Guru


Joined: 16 Jul 2004
Posts: 390
Location: CH

PostPosted: Thu Jul 05, 2007 7:18 pm    Post subject: Reply with quote

GREAT!!! I've been looking for ages for a solution to get a consistent backup of a running system! I was just way to scared to screw things up (forget to exclude /proc and you're really screwed, what about /dev and needed nodes in order to boot and so on...).
--> THANKS for that great script! I will definitely use it!
One little feature request: In times of low prices of storage, I would love to see an option to backup to a none compressed archive, just tar, even without gz compression. It would speed up the backup even more and save cpu usage as well.

Another point: This script rocks that hard, that I would like to see it in portage!..
Code:
#emerge mkstage4

:D
Back to top
View user's profile Send private message
koo
n00b
n00b


Joined: 06 Jul 2007
Posts: 1

PostPosted: Fri Jul 06, 2007 6:06 pm    Post subject: Reply with quote

that is useful
Back to top
View user's profile Send private message
shazam75
Guru
Guru


Joined: 18 Mar 2006
Posts: 562
Location: Brisbane, Australia

PostPosted: Thu Jul 12, 2007 3:02 am    Post subject: Reply with quote

pacho2 wrote:
The problem persists, script stops without make a properly backup :-(


What is the actual error message if there is any ?
_________________
answer an unanswered post:
http://forums.gentoo.org/search.php?search_id=unanswered
Back to top
View user's profile Send private message
ozman
n00b
n00b


Joined: 26 Aug 2007
Posts: 10

PostPosted: Fri Sep 14, 2007 2:56 pm    Post subject: error Reply with quote

Hi,

Before emerging world mkstage.sh script worked fine, but now i have error and created backup file has only 73MB.

Code:

* Please wait while the stage4 is being created.

/usr/bin/find: ścieżki muszą poprzedzać wyrażenie: of
Składnia: /usr/bin/find [-H] [-L] [-P] [-Opoziom] [-D help|tree|search|stat|rates|opt|exec] [ścieżka...] [wyrażenie]
/bin/tar: /var/log/emerge.log: Uwaga: Nie można open: Brak dostępu
Licza zapisanych bajtów: 73041920 (70MiB, 2,4MiB/s)

* stage4 is done
* umounting boot
* Checking integrity
* Everything went smoothly. You successfully created a stage4.
Back to top
View user's profile Send private message
Phlogiston
Veteran
Veteran


Joined: 27 Jan 2004
Posts: 1925
Location: Europe, Swizerland

PostPosted: Thu Oct 18, 2007 7:30 pm    Post subject: Reply with quote

sfragis wrote:
Hi BlinkEye, thanks for the script.
Starting from an idea of a friend of mine, time ago I did a small script, not much different from your.
For those who are interested, you can download it from here.
The goal of my script was to provide a certain safety against data corruption.
While the base logic is quite the same (use find to create the list of files, use exclusion patterns), the tools I used change:

  • afio instead of tar because it's more suitable for data recovering (given two offset you can always extract the relative content from the archive).
  • par2 (app-arch/par2cmdline in portage) which creates parity files and can be useful to recover damaged data (according with the chosen protection level).
  • md5sum to checksum the archives and detect data corruption or loss.

Feel free to use part or all of the code if it can be useful to improve your script.


I think the link is broken. Anyone has that script or could the author please upgrade it?
_________________
Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3057
Location: Redmond, WA

PostPosted: Thu Jan 31, 2008 8:57 am    Post subject: Reply with quote

Phlogiston wrote:
sfragis wrote:
Hi BlinkEye, thanks for the script.
Starting from an idea of a friend of mine, time ago I did a small script, not much different from your.
For those who are interested, you can download it from here.
The goal of my script was to provide a certain safety against data corruption.
While the base logic is quite the same (use find to create the list of files, use exclusion patterns), the tools I used change:

  • afio instead of tar because it's more suitable for data recovering (given two offset you can always extract the relative content from the archive).
  • par2 (app-arch/par2cmdline in portage) which creates parity files and can be useful to recover damaged data (according with the chosen protection level).
  • md5sum to checksum the archives and detect data corruption or loss.

Feel free to use part or all of the code if it can be useful to improve your script.


I think the link is broken. Anyone has that script or could the author please upgrade it?


Even if it's a bit late getting to you. The author compressed the file now by default
http://fstrozzi.web.cs.unibo.it/safebackup.sh.bz2
Back to top
View user's profile Send private message
Phlogiston
Veteran
Veteran


Joined: 27 Jan 2004
Posts: 1925
Location: Europe, Swizerland

PostPosted: Thu Jan 31, 2008 1:06 pm    Post subject: Reply with quote

slycordinator wrote:


Even if it's a bit late getting to you. The author compressed the file now by default
http://fstrozzi.web.cs.unibo.it/safebackup.sh.bz2


Thanks a lot. I will look into that.
_________________
Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor
Back to top
View user's profile Send private message
diloo
n00b
n00b


Joined: 08 Jul 2007
Posts: 10
Location: France

PostPosted: Sat May 03, 2008 8:42 am    Post subject: How to create my own stage3 Reply with quote

Hi,

I would like to re-install Gentoo, but if I'm not satisfied with my new configuration I want to be able to restore my old system.
So, I want to create my own stage3, e.g. an archive which I'll be able to untar on my / to get my old system back.
I think just one tar command will do it but I don't know which options I must use to do it properly.

Thanks.
_________________
DiloO
Gentoo Linux 2007.0
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Sat May 03, 2008 8:56 am    Post subject: Reply with quote

What you are looking for is usually called a "stage4" backup or install. There are various howto's on the topic around here somewhere. The method that I have used successfully in the past is here: Stage4 Howto
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Sat May 03, 2008 2:26 pm    Post subject: Reply with quote

merged above two posts here.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3 ... , 16, 17, 18  Next
Page 17 of 18

 
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