Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto Backup entire Laptop-Harddrive
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
H-Dragon
Guru
Guru


Joined: 22 Oct 2002
Posts: 547

PostPosted: Wed Oct 18, 2006 5:23 pm    Post subject: Howto Backup entire Laptop-Harddrive Reply with quote

Hi!

I need to send in my laptop due to a crooked case...

I therefore have to make a 1:1 copy of my Harddisk including partitions and everything and put it back on the disk afterwards.

What is the best way to do this?

Thanks!!!
_________________
WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup!
Back to top
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Wed Oct 18, 2006 5:41 pm    Post subject: Reply with quote

Hallo!

For my system backup, I use the following commands:

Code:
cd /
rsync -RavH /bin /boot /etc /home /lib /opt /root /sbin /service /usr /var [host:]/<path to>/<image destination directory>
cd /<working directory> [<-- (A directory that has some free space to be used by tar verification process)]
tar -cpvW -f /<tar destination directory>/<File Name> -C /<path to>/<image destination directory>

(If necessary)
cd <tar destination directory>
bzip2 -kzp <tar file>


You can include on the above rsync command any directory you want. /service is a directory used by my MTA which is qmail.

Rsync always verifies the data synced. If you specify a host, the connection will be established through ssh.

To restore your system, you have to do the following:

Code:
1. Boot from live CD, create, format and mount your partitions according to the handbook and your previous settings.
2. Install stage 3 from Gentoo startup disk: tar -xvjpf /<path>/<stage 3 file>
3. Remove the directories included in the tar(.bz2) backup file:
   rm -R -f /mnt/gentoo/bin/* /mnt/gentoo/boot/* /mnt/gentoo/etc/* /mnt/gentoo/home/* /mnt/gentoo/lib/* /mnt/gentoo/opt/* /mnt/gentoo/root/* /mnt/gentoo/sbin/* /mnt/gentoo/service/* /mnt/gentoo/usr/* /mnt/gentoo/var/*
4. Install your backup file : tar -xv(j)pf /<path>/<file> (option j is used only if the file is tar.bz2)
5. Chroot and execute grub-install
6. Exit chroot, reboot and you are ready!


The same procedure a bit simplified goes for my data directories.

Kind regards,
orange_juice


Last edited by orange_juice on Wed Oct 18, 2006 5:51 pm; edited 2 times in total
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Wed Oct 18, 2006 5:48 pm    Post subject: Reply with quote

I would use partimage... booting the laptop with the Gentoo Livecd 2006.1
In addition to partimage, dd should be used to backup the MBR, and sfdisk for the extended partition entries.

http://www.partimage.org/Partimage-manual_Usage


Last edited by lost+found on Wed Oct 18, 2006 5:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
H-Dragon
Guru
Guru


Joined: 22 Oct 2002
Posts: 547

PostPosted: Wed Oct 18, 2006 5:53 pm    Post subject: Reply with quote

well... i would backup to a external usb-disk..... what is the best solution there?

is there no way to keep my partitions (one of them is encrypted) and all that?
_________________
WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup!
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Wed Oct 18, 2006 5:56 pm    Post subject: Reply with quote

:roll:

for the encrypted partition, partimage can't be used I think.

Maybe
Code:
dd if=/dev/encr-dev of=/mnt/usb/partition-backup


Last edited by lost+found on Wed Oct 18, 2006 6:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
H-Dragon
Guru
Guru


Joined: 22 Oct 2002
Posts: 547

PostPosted: Wed Oct 18, 2006 5:59 pm    Post subject: Reply with quote

i don't have a cd-drive (nor an external one) i would use damnsmalllinux on a usbkey...
any problems there?
_________________
WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup!
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Wed Oct 18, 2006 6:02 pm    Post subject: Reply with quote

H-Dragon wrote:
i don't have a cd-drive (nor an external one) i would use damnsmalllinux on a usbkey...
any problems there?


A static binary can be run from anywhere....
Back to top
View user's profile Send private message
H-Dragon
Guru
Guru


Joined: 22 Oct 2002
Posts: 547

PostPosted: Wed Oct 18, 2006 6:05 pm    Post subject: Reply with quote

:oops: and this is why you shouldnt stay up for more than 20h more than 2 days in a row.... you start getting stupid

=)

Thanks lost+found and orange_juice!
_________________
WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup!
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Wed Oct 18, 2006 6:06 pm    Post subject: Reply with quote

Does your laptop have a network connection? The backups could be to big to store on a USB key
Back to top
View user's profile Send private message
H-Dragon
Guru
Guru


Joined: 22 Oct 2002
Posts: 547

PostPosted: Wed Oct 18, 2006 6:08 pm    Post subject: Reply with quote

... well.. i would use a usb-disk with 200gig or so... (will buy one)
or a usb-disk / net-drive

=)

any suggestions there?


also... can i make a backup of a partition with partimage .... even if i am running it from the one i want to backup?
_________________
WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup!
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Wed Oct 18, 2006 6:12 pm    Post subject: Reply with quote

H-Dragon wrote:
y suggestions there?


also... can i make a backup of a partition with partimage .... even if i am running it from the one i want to backup?


no, can't be mounted while using partimage...
Back to top
View user's profile Send private message
H-Dragon
Guru
Guru


Joined: 22 Oct 2002
Posts: 547

PostPosted: Wed Oct 18, 2006 6:24 pm    Post subject: Reply with quote

shoot.... so how do i backup my root-partition?
_________________
WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup!
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Wed Oct 18, 2006 6:34 pm    Post subject: Reply with quote

H-Dragon wrote:
shoot.... so how do i backup my root-partition?


If you boot the laptop from the USB key, then your laptop partitions are not mounted. The partimage binary should be run from the USB key, or a drive not being backupped (The binary can be moved to tmpfs/ramdisk, if there's no space for it on the USB key. I used partimage booting from two 1.44 MB floppies once (1 with the kernel other with busybox+ramdisk).


Last edited by lost+found on Wed Oct 18, 2006 6:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
H-Dragon
Guru
Guru


Joined: 22 Oct 2002
Posts: 547

PostPosted: Wed Oct 18, 2006 6:49 pm    Post subject: Reply with quote

neat...

i'll try to put it on dsl (damn small linux) and have the perfect backup-solution
:D
_________________
WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup!
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Wed Oct 18, 2006 6:53 pm    Post subject: Reply with quote

Good luck!
Back to top
View user's profile Send private message
rmh3093
Advocate
Advocate


Joined: 06 Aug 2003
Posts: 2138
Location: Albany, NY

PostPosted: Wed Oct 18, 2006 7:00 pm    Post subject: Re: Howto Backup entire Laptop-Harddrive Reply with quote

H-Dragon wrote:
Hi!

I need to send in my laptop due to a crooked case...

I therefore have to make a 1:1 copy of my Harddisk including partitions and everything and put it back on the disk afterwards.

What is the best way to do this?

Thanks!!!


for ~$10 US you can get an adapter to convert your laptop ide harddrive to a normal 40/80 wire ide cable and then you can stick it right into another computer if you have one
_________________
Do not meddle in the affairs of wizards, for they are subtle and quick to anger.
Back to top
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Wed Oct 18, 2006 7:02 pm    Post subject: Reply with quote

Yup! Either way you have to practice to get the result!

Kind regards,
orange_juice
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Wed Oct 18, 2006 7:26 pm    Post subject: Re: Howto Backup entire Laptop-Harddrive Reply with quote

rmh3093 wrote:

for ~$10 US you can get an adapter to convert your laptop ide harddrive to a normal 40/80 wire ide cable and then you can stick it right into another computer if you have one


Ditto this, absolutely the fastest solution if you've ever done it before. There are cables that are USB->ide/laptop-ide also if you refuse to shutdown your desktop to plug it in.

For raw images I copy with "dd"
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
H-Dragon
Guru
Guru


Joined: 22 Oct 2002
Posts: 547

PostPosted: Wed Oct 18, 2006 7:35 pm    Post subject: Reply with quote

the adapter sounds great... but i have a s-ata drive...
are there adapters for those?

and what about a lan-drive? can partimage work with these?
(and any suggestion as to which one to choose?)
_________________
WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup!
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Wed Oct 18, 2006 7:41 pm    Post subject: Reply with quote

you have a s-ata laptop drive? (do they exist? what kind of connector is it) or a desktop HD?

For desktop: I was at a computer show last weekend and saw a ~20-30$ usb to combination: laptop pata, pata, sata
It was hard for me not to buy it, but I already have a usb->sata and a ide->laptop-ide (is there a technical term for the laptop-ide connector)?

Sadly I've never used partimage, only "cp -A" for mounted volumes and dd for raw backups so I cannot speak to that.
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Wed Oct 18, 2006 8:02 pm    Post subject: Reply with quote

Let's not forget good old "tar" (cf. orange_juice). Good defragmentation also :-)

The filesystems can be whiped out by
Code:
# rm the files
# dd if=/dev/zero of=/mnt/root/bigfile; sync
# rm /mnt/root/bigfile; sync
etc.
Back to top
View user's profile Send private message
procyon112
n00b
n00b


Joined: 28 Apr 2005
Posts: 16
Location: Seattle, Washington, USA

PostPosted: Thu Oct 19, 2006 1:15 am    Post subject: Reply with quote

coolsnowmen wrote:
you have a s-ata laptop drive? (do they exist? what kind of connector is it) or a desktop HD?


Yes they exist, I have one too.

I don't know if the sata connection on the drive is compatible with desktop sata, as I've never tried anything wonky like that with it, but I can assure you that they exist.
Back to top
View user's profile Send private message
rmh3093
Advocate
Advocate


Joined: 06 Aug 2003
Posts: 2138
Location: Albany, NY

PostPosted: Thu Oct 19, 2006 3:30 pm    Post subject: Reply with quote

procyon112 wrote:
coolsnowmen wrote:
you have a s-ata laptop drive? (do they exist? what kind of connector is it) or a desktop HD?


Yes they exist, I have one too.

I don't know if the sata connection on the drive is compatible with desktop sata, as I've never tried anything wonky like that with it, but I can assure you that they exist.


yup just google "2.5 SATA adapter" --> http://www.addonics.com/products/io/aks218ide.asp
_________________
Do not meddle in the affairs of wizards, for they are subtle and quick to anger.
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
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