* [gentoo-user] backup sanity check
@ 2010-08-14 4:12 Adam Carter
2010-08-14 9:07 ` Volker Armin Hemmann
0 siblings, 1 reply; 4+ messages in thread
From: Adam Carter @ 2010-08-14 4:12 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 807 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] backup sanity check
2010-08-14 4:12 [gentoo-user] backup sanity check Adam Carter
@ 2010-08-14 9:07 ` Volker Armin Hemmann
2010-08-15 8:11 ` Adam Carter
0 siblings, 1 reply; 4+ messages in thread
From: Volker Armin Hemmann @ 2010-08-14 9:07 UTC (permalink / raw
To: gentoo-user
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] backup sanity check
2010-08-14 9:07 ` Volker Armin Hemmann
@ 2010-08-15 8:11 ` Adam Carter
2010-08-16 14:47 ` Bill Longman
0 siblings, 1 reply; 4+ messages in thread
From: Adam Carter @ 2010-08-15 8:11 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 844 bytes --]
> 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
[-- Attachment #2: Type: text/html, Size: 1137 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] backup sanity check
2010-08-15 8:11 ` Adam Carter
@ 2010-08-16 14:47 ` Bill Longman
0 siblings, 0 replies; 4+ messages in thread
From: Bill Longman @ 2010-08-16 14:47 UTC (permalink / raw
To: gentoo-user
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!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-16 14:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-14 4:12 [gentoo-user] backup sanity check Adam Carter
2010-08-14 9:07 ` Volker Armin Hemmann
2010-08-15 8:11 ` Adam Carter
2010-08-16 14:47 ` Bill Longman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox