FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 08-14-2010, 04:12 AM
Adam Carter
 
Default backup sanity check

This is to backup my laptop from boot cdrom - how does it look?

File systems;
/dev/sda1 - /boot
/dev/sda2 - swap
/dev/sda3 - /

So to backup;
1. Get MBR (grub and partition table): dd if=/dev/sda of=/otherdisk/sda-mbr.bin bs=512 count=1

2. Get /boot: dd if=/dev/sda1 of=/otherdisk/sda1.bin
3. Get /: dd if=/dev/sda3 | gzip | dd of=/otherdisk/sda3.bin.gz

Then too restore onto new disk;
1. Restore MBR: dd if=/otherdisk/sda-mbr.bin of=/dev/sda

*** - no bs or count parameters required?
2. Restore /boot: dd if=/otherdisk/sda1.bin of=/dev/sda1
3. Restore /: dd if=/otherdisk/sda3.bin.gz | gunzip | dd of=/dev/sda3
4. Setup swap partition: mkswap /dev/sda2

5. Boot system

Caveat is the the new disk must be big enough to fit sda1/2/3.
 
Old 08-14-2010, 09:07 AM
Volker Armin Hemmann
 
Default backup sanity check

On Saturday 14 August 2010, Adam Carter wrote:
> This is to backup my laptop from boot cdrom - how does it look?
>
> File systems;
> /dev/sda1 - /boot
> /dev/sda2 - swap
> /dev/sda3 - /
>
> So to backup;
> 1. Get MBR (grub and partition table): dd if=/dev/sda
> of=/otherdisk/sda-mbr.bin bs=512 count=1
> 2. Get /boot: dd if=/dev/sda1 of=/otherdisk/sda1.bin
> 3. Get /: dd if=/dev/sda3 | gzip | dd of=/otherdisk/sda3.bin.gz
>
> Then too restore onto new disk;
> 1. Restore MBR: dd if=/otherdisk/sda-mbr.bin of=/dev/sda
> - no bs or count parameters required?
> 2. Restore /boot: dd if=/otherdisk/sda1.bin of=/dev/sda1
> 3. Restore /: dd if=/otherdisk/sda3.bin.gz | gunzip | dd of=/dev/sda3
> 4. Setup swap partition: mkswap /dev/sda2
> 5. Boot system
>
> Caveat is the the new disk must be big enough to fit sda1/2/3.

why backup mbr? installing grub takes less time then the backup and restore of
the mbr.

And dd for backups? Why wasting space? Why suffering from problems when the new
harddisk has a different size?
Just tar up everything.
 
Old 08-15-2010, 08:11 AM
Adam Carter
 
Default backup sanity check

why backup mbr? installing grub takes less time then the backup and restore of


the mbr.



And dd for backups? Why wasting space? Why suffering from problems when the new

harddisk has a different size?

Just tar up everything.



Ok, so is this correct?

Backup with tar;
1. boot from cd
2. mount /dev/sda1 /mnt/boot
3. cd /mnt/boot
4. tar czf /otherdisk/boot.tar.gz *
5. mount /dev/sda3 /mnt/root
6. cd /mnt/root

7. tar czf /otherdisk/root.tar.gz *

Restore;
1. Boot from cd
2. fdisk /dev/sda
3. mkfs.ext /dev/sda1
4. mkswap /dev/sda2
5. mkreiserfs /dev/sda3
6. mount /dev/sda1 /mnt/boot
7. cd /mnt/boot

8. tar xzf /otherdisk/boot.tar.gz
9. mount /dev/sda3 /mnt/root
10. cd /mnt/root
11. tar xzf /otherdisk/root.tar.gz (should i exclude anything? /proc /sys?)
12. chroot /mnt/boot
13. grub-install --no-floppy /dev/sda

14. reboot
 
Old 08-16-2010, 02:47 PM
Bill Longman
 
Default backup sanity check

On 08/15/2010 01:11 AM, Adam Carter wrote:
> why backup mbr? installing grub takes less time then the backup and
> restore of
> the mbr.
>
> And dd for backups? Why wasting space? Why suffering from problems
> when the new
> harddisk has a different size?
> Just tar up everything.
>
> Ok, so is this correct?
>
> Backup with tar;
> 1. boot from cd
> 2. mount /dev/sda1 /mnt/boot
> 3. cd /mnt/boot
> 4. tar czf /otherdisk/boot.tar.gz *

No, you do not want to use *, you want to use . Remember that the shell
expands "*" and you will be at the mercy of whatever happens to exist in
that directory. Using * you will miss all "dot" files. Here's the
command you want:

tar czf /otherdisk/boot.tar.gz .

> 5. mount /dev/sda3 /mnt/root
> 6. cd /mnt/root
> 7. tar czf /otherdisk/root.tar.gz *

Same as above, use "." not "*".

> Restore;
> 1. Boot from cd
> 2. fdisk /dev/sda
> 3. mkfs.ext /dev/sda1
> 4. mkswap /dev/sda2
> 5. mkreiserfs /dev/sda3
> 6. mount /dev/sda1 /mnt/boot
> 7. cd /mnt/boot
> 8. tar xzf /otherdisk/boot.tar.gz
> 9. mount /dev/sda3 /mnt/root
> 10. cd /mnt/root
> 11. tar xzf /otherdisk/root.tar.gz (should i exclude anything? /proc /sys?)

Yeah, probably, but most times it's just as easy to just delete them
after you've restored them. You're still booted from the CD after all....

> 12. chroot /mnt/boot
> 13. grub-install --no-floppy /dev/sda
> 14. reboot

In the perfect world, you'll be running fine from here. Let us know how
reality compares, though!
 

Thread Tools




All times are GMT. The time now is 07:22 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org