Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] backup the / with tar
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
DaNe
Apprentice
Apprentice


Joined: 29 Apr 2006
Posts: 192

PostPosted: Fri Aug 24, 2007 10:03 pm    Post subject: [SOLVED] backup the / with tar Reply with quote

after i finished installing gentoo on my laptop i noticed a big problem, the only way i can install back windows is by dvds of recovery that have good probability of formating the disk where the gnome is installed,
since that i want to backup using tar like "creating" a stage that we use to install gentoo,

the question is what should the command be...

i already searched but i must confirm with someone before i loose to many hours of work
Code:

tar -cvWpf file.tar /mount/point


Last edited by DaNe on Fri Aug 24, 2007 11:24 pm; edited 1 time in total
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 778
Location: Brooklyn, New York

PostPosted: Fri Aug 24, 2007 10:58 pm    Post subject: Re: backup the / with tar Reply with quote

DaNe wrote:
after i finished installing gentoo on my laptop i noticed a big problem, the only way i can install back windows is by dvds of recovery that have good probability of formating the disk where the gnome is installed,
since that i want to backup using tar like "creating" a stage that we use to install gentoo,

the question is what should the command be...

i already searched but i must confirm with someone before i loose to many hours of work
Code:

tar -cvWpf file.tar /mount/point


while in the live system, run the following commands.

Code:
tar cvjp --exclude=/dev --exclude=/sys --exclude=/proc --exclude=/stage4.tar.bz2 --file /stage4.tar.bz2 /


to restore the stage4 tarball from a livecd, just untar it to /mnt/gentoo then perform the following commands.

Code:
cd /mnt/gentoo && mkdir dev proc sys && cd dev && MAKEDEV generic


after just emerge -e system; compile your kernel, then setup your boot loader etc.. that should be all.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54331
Location: 56N 3W

PostPosted: Fri Aug 24, 2007 10:59 pm    Post subject: Reply with quote

DaNe,

Search the forums for a Stage 4.
Thats the name given to what you want to do.

Likewhoa beat me to it
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
DaNe
Apprentice
Apprentice


Joined: 29 Apr 2006
Posts: 192

PostPosted: Fri Aug 24, 2007 11:24 pm    Post subject: Reply with quote

tks
certainly i would forget the
MAKEDEV generic (now i would be fan o stage5 LOL)


Quote:
emerge -e system; compile your kernel,


is this necessary?
the computer wil be the same
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54331
Location: 56N 3W

PostPosted: Fri Aug 24, 2007 11:37 pm    Post subject: Reply with quote

DaNe,

You need not rebuild the kernel provided /boot was mounted when you made the stage 4.
You may need to reinstall grub to the MBR, depending on what happens to the disk space outside of the filesystem.
It will not survive if you reinstall Windows. That will install the Windows boot loader.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
DaNe
Apprentice
Apprentice


Joined: 29 Apr 2006
Posts: 192

PostPosted: Sat Aug 25, 2007 12:22 am    Post subject: Reply with quote

i know that,

tks a lot for the help
Back to top
View user's profile Send private message
bertaboy
l33t
l33t


Joined: 05 Nov 2004
Posts: 604

PostPosted: Sat Aug 25, 2007 1:45 am    Post subject: Reply with quote

I found a nice script that takes care of nearly everything for me. I have a separate /backup partition located on a hard drive from my operating hard drive and store all of my files there.
/backup/backup
Code:
#!/bin/bash
# the configuration file script...run this to make a backup
#
# Author: Stefan Wendler
# email: m.2@cravomat.de
# Copyright(C) 2003
#############################################
# configuration is in backup.cfg

# get config
. /backup/backup.cfg

#set -x

# some helper functions
backupdir()
{
ARCHIVE_NAME=$1-`$dateformat`.tgz
echo "Building $1 archive"
tar cfz $target/$ARCHIVE_NAME /$1 > /dev/null 2>&1 && echo "[got it!]" || echo "[FAILED]"
}

delold()
{
echo "Deleting old backups"
rm $target/*.tgz
}

makebigfile()
{
echo "Create archive of all backups"
tar cf $target/backup-`$dateformat`.tar $target/*.tgz
}

# main script

# do we need to delete old stuff
if [ "$delold" = "yes" ]; then
delold
fi

# backup all needed dirs
for i in $backupdirs
do
backupdir "$i";
done

# make big file, if required
if [ "$bigfile" = "yes" ]; then
makebigfile
fi


/backup/backup.cfg
Code:
# the configuration file script...run this to make a backup
#
# Author: Stefan Wendler
# email: m.2@cravomat.de
# Copyright(C) 2003
#############################################
#
# define which dirs to backup
# backupdirs="bin boot dev etc home lib opt root sbin usr var"
backupdirs="bin boot etc lib opt root sbin usr var"
# define where to store the backup
target="/backup/"
# bigfle yes | no
bigfile=no
# del old backups
# delold yes | no
delold=yes
# dateformat
dateformat="date +%G-%m-%d"


Just run ./backup after setting up the configuration file and you're good to go.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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