Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Howto] Creation of a Stage 5 archive
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
cfgauss
l33t
l33t


Joined: 18 May 2005
Posts: 688
Location: USA

PostPosted: Wed Aug 22, 2007 2:40 pm    Post subject: Reply with quote

likewhoa wrote:

my method to backup/clone a system for transfering to another system of the same -march is simple..
Code:
tar cvjp --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/stage4.tar.bz2 --file stage4.tar.bz2 /

then simply scp that tarball to your new system,.. untar it, then simply cd into the /mnt/gentoo/dev directory and run
Code:
MAKEDEV generic
[this will create the necessary nodes. after mount proc & dev then finally chroot to it. that's it; you should know the rest.

I tried this and have trouble after chroot when I boot into the new system. udev complains
Code:
Letting udev process events !!
and then e2fsck complains it can't find /dev/hda3 and it throws me into root for a manual fsck. When I look into /dev, I can't find hda3. All that's there is
Code:
console core fd null pts shm stderr stdin stdout tty1
.
Any pointers will be welcomed.
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


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

PostPosted: Wed Aug 22, 2007 5:59 pm    Post subject: Reply with quote

did you recompile your base system?
make sure to compile the kernel and check if you have the require IDE/SATA drivers.
Back to top
View user's profile Send private message
cfgauss
l33t
l33t


Joined: 18 May 2005
Posts: 688
Location: USA

PostPosted: Thu Aug 23, 2007 12:01 am    Post subject: Reply with quote

likewhoa wrote:
did you recompile your base system?
make sure to compile the kernel and check if you have the require IDE/SATA drivers.

I compiled the kernel and rebooted and got the same result. dmesg shows that the hard disk, hda, was detected and prints out the correct partition. But /dev still has only generic nodes and, in particular, hda isn't in there. When I try to mount /boot in the root shell that e2fsck throws me into, mount correctly complains that there is no /dev/hda1.

When do these device nodes get created? Would it work if my source backup included /dev?

Thanks.

[EDIT] Re-emerged udev and all is well. Thanks. [/EDIT]
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


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

PostPosted: Thu Aug 23, 2007 2:25 am    Post subject: Reply with quote

cfgauss wrote:
likewhoa wrote:
did you recompile your base system?
make sure to compile the kernel and check if you have the require IDE/SATA drivers.

I compiled the kernel and rebooted and got the same result. dmesg shows that the hard disk, hda, was detected and prints out the correct partition. But /dev still has only generic nodes and, in particular, hda isn't in there. When I try to mount /boot in the root shell that e2fsck throws me into, mount correctly complains that there is no /dev/hda1.

When do these device nodes get created? Would it work if my source backup included /dev?

Thanks.

[EDIT] Re-emerged udev and all is well. Thanks. [/EDIT]


that's what i meant by did you "emerge your base system". that includes udev.
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1139
Location: Sofia/Bulgaria

PostPosted: Wed Oct 22, 2008 5:43 pm    Post subject: Reply with quote

thank you dear d2_racing your guide worked for me :wink:
_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


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

PostPosted: Wed Oct 22, 2008 7:04 pm    Post subject: Reply with quote

By the way, I saw a little bug inside my current box.

If you have a /boot, before starting your tar command, double check inside /mnt/back/boot if you have something.

If not, run this command :

Code:

# mount -o bind  /boot /mnt/backup/boot


The bind command is only working for a specific partition at once.

So, I had a / for sda8 and a /boot for sda7.
Back to top
View user's profile Send private message
scouter389
n00b
n00b


Joined: 14 Mar 2008
Posts: 22
Location: Chickasha, OK

PostPosted: Thu Oct 30, 2008 7:51 am    Post subject: bare metal recovery trick Reply with quote

Here is how I keep my bare metal backup of my laptop when i transferred my data to a new drive:
WARNING!! WARNING!! WARNING!! This command if mistyped can HOSE the host system! Always triple check the command before pressing enter!
this does require a lot of space on the host system.
I moved my laptop sata drive to my desktop and ran
Code:
 dd if=/dev/sda of=/home/jawall/laptop.bare.img bs=512

after the data was copied I disconnected the old drive and hooked up my new drive and ran
Code:
 dd if=/home/jawall/laptop.bare.img of=/dev/sda bs=512


This command will take several hours to run so don't get impatient over no status updates it IS working.
To explain the command: dd is a command that does binary copying quite well
Code:
if=<filename>
is the source file whether it is a device node or image file
Code:
of=<filename>
is the output file
Code:
bs=512
tells dd to copy the hard drive sector by sector

for more ways to use dd run
Code:
man dd

_________________
I am root. Obey me.
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


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

PostPosted: Thu Oct 30, 2008 11:33 am    Post subject: Reply with quote

This backup the whole HDD and this will recreate the same partition from your old installation.

But if you want to be a little bit more flexible, then the Stage 5 can recover any backup partition from any size.

In fact, I had to backup a 10 Gig of data from /, and then I untar it on a brand new 100 Gig / without any warning or else.

DD is awesome to take an exact copy of a partition or a HDD.
Back to top
View user's profile Send private message
minor_prophets
Apprentice
Apprentice


Joined: 07 Oct 2007
Posts: 281

PostPosted: Fri Nov 14, 2008 7:17 pm    Post subject: Re: [Howto] Creation of a Stage 5 archive Reply with quote

Quote:


The Stage 4 works perfectly in general, but if you are lucky like me, it will crash your Gentoo :evil:



d2_racing,

I'm a little unclear on your statement here. How is it that Stage 4 crashed your Gentoo? Are you implying that running the script destroyed your functional Gentoo system? I've never had any problems with running the script myself. 8O
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


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

PostPosted: Fri Nov 14, 2008 8:26 pm    Post subject: Reply with quote

No, I mean if you restore that Stage, if you have a Framebuffer and other stuff like Gensplash, the Stage 4 doesn't backup at all the /dev directory and other stuff.

With the Stage 5, you don't have this kind of problem.
Back to top
View user's profile Send private message
xmaes
n00b
n00b


Joined: 13 Aug 2008
Posts: 69
Location: Madrid

PostPosted: Sat Jan 03, 2009 11:34 am    Post subject: Reply with quote

thanks it was usefull :-)
Just two questions

Code:
# tar --exclude  stage5.tar.bz2 -cvvjpf stage5.tar.bz2 .


Why is "." so important and why 2 "v" in the tar command.

In your pdf on your website for the stage 5, there are 2 mistakes.

Quote:
L'option bind est fonctionne seulement pour une partition a la fois.


and the command is missing a "-"

Quote:
# tar -exclude stage5.tar.bz2 -cvvjpf stage5.tar.bz2 .


btw when i copy and paste the command i get
Quote:
# tar {exclude stage5.tar.bz2 -cvvjpf stage5.tar.bz2 .

not the minus signs.

Xavier
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


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

PostPosted: Sat Jan 03, 2009 2:47 pm    Post subject: Reply with quote

xmaes wrote:

Code:
# tar --exclude  stage5.tar.bz2 -cvvjpf stage5.tar.bz2 .


Why is "." so important and why 2 "v" in the tar command.



The . is important, because it will tar the current directory, so basically the /mnbt/backup

And the extra v makes the tar command more verbose.
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


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

PostPosted: Sat Jan 03, 2009 2:59 pm    Post subject: Reply with quote

xmaes wrote:

btw when i copy and paste the command i get
Quote:
# tar {exclude stage5.tar.bz2 -cvvjpf stage5.tar.bz2 .

not the minus signs.
Xavier


Hi, can you post this :

Code:

# locale
$ locale


Have you the UTF-8 support, because I don't have your bug right now.
Back to top
View user's profile Send private message
xmaes
n00b
n00b


Joined: 13 Aug 2008
Posts: 69
Location: Madrid

PostPosted: Sat Jan 03, 2009 3:08 pm    Post subject: Reply with quote

here you go

Quote:
# locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=


Quote:
$ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1139
Location: Sofia/Bulgaria

PostPosted: Wed Feb 04, 2009 8:56 am    Post subject: Reply with quote

d2_racing wrote:
By the way, I saw a little bug inside my current box.

If you have a /boot, before starting your tar command, double check inside /mnt/back/boot if you have something.

If not, run this command :

Code:

# mount -o bind  /boot /mnt/backup/boot


The bind command is only working for a specific partition at once.

So, I had a / for sda8 and a /boot for sda7.


Can you add this line to the main guide please :roll:
_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
SlashBeast
Retired Dev
Retired Dev


Joined: 23 May 2006
Posts: 2922

PostPosted: Wed Feb 04, 2009 9:31 am    Post subject: Reply with quote

Imho backup should be from remounted rootfs
Quote:
mkdir /tmp/real_rootfs
mount /dev/root /tmp/real_rootfs


remounted rootfs have not mounted nothing, empty /proc and /sys. /dev with static files, nothing mounted in /mnt or /media.

Quote:
mizore /tmp # mkdir real_rootfs
mizore /tmp # mount /dev/root real_rootfs
mizore /tmp # ls -l /tmp/real_rootfs/dev | wc -l
1467
mizore /tmp # ls -l /dev | wc -l
714
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


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

PostPosted: Wed Feb 04, 2009 12:27 pm    Post subject: Reply with quote

Kollin wrote:
d2_racing wrote:
By the way, I saw a little bug inside my current box.

If you have a /boot, before starting your tar command, double check inside /mnt/back/boot if you have something.

If not, run this command :

Code:

# mount -o bind  /boot /mnt/backup/boot


The bind command is only working for a specific partition at once.

So, I had a / for sda8 and a /boot for sda7.


Can you add this line to the main guide please :roll:


Done :P
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1139
Location: Sofia/Bulgaria

PostPosted: Wed Feb 04, 2009 2:18 pm    Post subject: Reply with quote

d2_racing wrote:

Done :P


Thank you :D
_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
Snake
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2005
Posts: 146

PostPosted: Tue Feb 24, 2009 6:18 pm    Post subject: Reply with quote

I have a problem extracting backup. A few days ago I didn't have any problems, but today I just can't extract bz2 file, some files extract but after some time I get error, something about reiserfs_priv (it is reiserfs partition). Could be the reason that I am using different boot CD that I used a few days ago when extracting went smoothly?
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


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

PostPosted: Tue Feb 24, 2009 6:28 pm    Post subject: Reply with quote

Hi, did you try the latest SystemRescueCD ?

I always use this one when I backup or restore my box.
Back to top
View user's profile Send private message
Snake
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2005
Posts: 146

PostPosted: Tue Feb 24, 2009 7:41 pm    Post subject: Reply with quote

Hi, I am using Gentoo minimal cd to boot, filesystem is made with mkreiserfs. The problem is that a few days ago there were no problems with extraction on the same computer. This is error:
Code:
tar: ./.reiserfs_priv: Cannot mkdir: Permission denied
tar: Error exit delayed from prevoius errors

Edit: it is the same with SystemRescueCD. As I understand reiserfs_priv is hidden folder with filesystem files, which can't be modified. What I can't understand is why I didn't have any problems the first time with the same bz2 file on the same partition .
Back to top
View user's profile Send private message
LoSeR_5150
Guru
Guru


Joined: 20 Mar 2005
Posts: 455
Location: San Francisco, CA

PostPosted: Sat Mar 14, 2009 1:52 am    Post subject: Reply with quote

Thank you d2_racing your guide worked great for me to re-do my raid array from raid1 to raid0 ... I somehow managed to miss my /boot directory (must have forgot to bind it) but installing grub/memtest86 and re-compiling a kernel was super easy. Too me 300min to tar/bzip2 45Gb and 100min to restore. Much better than a full re-install... Thanks again.
_________________
Opteron 1356@2.4Ghz
6GB DDR2 800Mhz
128MB Quadro NVS 210S
640GB Western Digital HD
*Gentoo-x86_64-2.6.30-r1

Opteron175@2.2GHz
2GB DDR 400MHz
256MB Quadro 1400 Go
(2) 80GB Segate HDs: RAID0
*Gentoo-x86_64-2.6.30-r1
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


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

PostPosted: Sat Mar 14, 2009 2:46 am    Post subject: Reply with quote

No problem, thanks for your comment :P
Back to top
View user's profile Send private message
pingpongboss
n00b
n00b


Joined: 16 May 2009
Posts: 1

PostPosted: Sat May 16, 2009 8:46 am    Post subject: Reply with quote

Am I right in assuming that this method of backing up would work in any other distribution?
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


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

PostPosted: Sat May 16, 2009 3:13 pm    Post subject: Reply with quote

In fact, it's universal, I used this method to backup my FreeBSD 7.2 and everything is working #1.

It's the swiss knife for backup :P
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, 4  Next
Page 3 of 4

 
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