Re: [gentoo-user] backup restore solution?

2005-07-31 Thread Richard Fish

Jarry wrote:


Hi,

I am now looking for some sort of backup  restore solution which would
help me to get my gentoo-server up and running after fatal disk failure.

I want to burn at regular intervals compressed partition images of disk
on internal dvd/rw/ram (4.5 GB should be enough for archiving the whole
disk, without /home partition).



Well, tar and cpio are good choices because they are available on the 
Gentoo live CD.  If you chose another program, you will just need to 
make sure that you have a static binary of it available at recovery time 
(copying this to your recovery media is the best choice).


I am currently using 'dar' to backup to external USB hard disk.  Dar is 
also useful for backing up to DVD media though, because it has good 
support for creating archive 'slices' that will fit nicely on a DVD, 
just in case you decide to backup /home as well.


It is in portage, but if you are interested, check out 
http://dar.linux.free.fr/


For 'quick-and-easy' restoring, I'm not aware of anything that really 
automates the process.  But generally the steps are:


1. fdisk
2. mkfs
3. mount
4. restore files
5. chroot
6. install boot loader
7. reboot

The difficulty in restoring the files will really depend upon how you 
make your backups (always full, incrementals, differentials, etc).  A 
full backup would always be the easiest, as you only need a single 
piece/set of media and one command to do the restore.


The rest of the steps are pretty much exactly the same as for when you 
installed Gentoo, so there shouldn't be any real surprises there.


One last thing, if you've only got a single CD/DVD drive, you are 
probably going to have an issue to have both the live CD and the backup 
media available, since you can't really eject the live CD to insert your 
backup disk.


-Richard

--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] backup restore solution?

2005-07-31 Thread Jarry

Richard Fish wrote:


I am currently using 'dar' to backup to external USB hard disk.


I thought of this too, but I don't know how to power-off usb-disk
remotelly. On the other side, after burning and unmounting dvd-r,
dvd-drive stops spinning (kind of overheating protection)...


5. chroot, 6. install boot loader


Is it not possible to archive MBR too? That way I could save 5. and
6., and to automate it with some scripts...

One last thing, if you've only got a single CD/DVD drive, you are 
probably going to have an issue to have both the live CD and the backup


Time to look for an old dvd-rom drive...

Jarry
--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] backup restore solution?

2005-07-31 Thread Richard Fish

Jarry wrote:



Is it not possible to archive MBR too? That way I could save 5. and
6., and to automate it with some scripts...



Technically, yes, I guess you could do this.  Although, I don't know if 
I would really recommend it.


If you are using a stage 1.5 with grub, you would need to archive the 
first 63 blocks of the disk (technically fewer than that, but you would 
have to check grub-install's output to be sure of the exact count, and 
63 is the safe number).  This is because grub embeds the stage1.5 loader 
after the mbr (first block) and the start of the first partition.


If you are not using the stage 1.5, or you are using lilo, then you have 
little choice but to reinstall the boot loader.  This is because some 
files in /boot are block mapped into the mbr, and the restore process 
may have changed the layout of these files, so the block map will be 
incorrect.


I think the safest route is to always let the system write a fresh mbr.

-Richard

--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] backup restore solution?

2005-07-31 Thread Bastian Balthazar Bux
Richard Fish wrote:
 Jarry wrote:
 

 Is it not possible to archive MBR too? That way I could save 5. and
 6., and to automate it with some scripts...
 
 
 
 Technically, yes, I guess you could do this.  Although, I don't know if
 I would really recommend it.
 
 If you are using a stage 1.5 with grub, you would need to archive the
 first 63 blocks of the disk (technically fewer than that, but you would
 have to check grub-install's output to be sure of the exact count, and
 63 is the safe number).  This is because grub embeds the stage1.5 loader
 after the mbr (first block) and the start of the first partition.
 
 If you are not using the stage 1.5, or you are using lilo, then you have
 little choice but to reinstall the boot loader.  This is because some
 files in /boot are block mapped into the mbr, and the restore process
 may have changed the layout of these files, so the block map will be
 incorrect.
 
 I think the safest route is to always let the system write a fresh mbr.
 
 -Richard
 

It make sense but is easily bypassable using hda1 as boot partition
AND it's the first on disk, with a little help from fdisk and dd
(## are shell commands # comm.inside fdisk):

 hikky trikky 
##fdisk /dev/hda
#Command (m for help): u
Changing display/entry units to sectors
#Command (m for help): p

Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders, total 78177792 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot  Start End  Blocks   Id  System
/dev/hda1   *  63  979964  489951   83  Linux
#Command (m for help): q

##dd if=/dev/hda of=MBR-boot.backup bs=512 count=489951
 hikky trikky 

MBR-boot.backup now contain your MBR + the boot partition.

now three question:
a) I know noone that use this backup method, is it affidable ?
b) What happen if it need to be restored on another disk
c) HOW do I restore (hint man dd)

Another hint: always try at least one restore after a choice of backup
method, the rule is you never know .

cheers
Francesco
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] backup restore solution?

2005-07-31 Thread Richard Fish

Bastian Balthazar Bux wrote:



  Device Boot  Start End  Blocks   Id  System
/dev/hda1   *  63  979964  489951   83  Linux
#Command (m for help): q

##dd if=/dev/hda of=MBR-boot.backup bs=512 count=489951
 



You missed a few! :-)

The actual number of 512-byte blocks is 979964 - 63 + 1 = 979902.

Fdisk always reports 1k blocks in the Blocks column.  Or if an odd 
number of 512-byte blocks, the number of 1k blocks with a '+' afterwards.


Plus, you want the mbr as well, plus whatever is between blocks 0 and 
63, so better option might be:


dd if=/dev/hda of=parttbl+mbr+boot.backup bs=512 count=979965


-Richard

--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] backup restore solution?

2005-07-31 Thread Bastian Balthazar Bux
Richard Fish wrote:
 Bastian Balthazar Bux wrote:
 

   Device Boot  Start End  Blocks   Id  System
 /dev/hda1   *  63  979964  489951   83  Linux
 #Command (m for help): q

 ##dd if=/dev/hda of=MBR-boot.backup bs=512 count=489951
  

 
 You missed a few! :-)
 
 The actual number of 512-byte blocks is 979964 - 63 + 1 = 979902.
 
 Fdisk always reports 1k blocks in the Blocks column.  Or if an odd
 number of 512-byte blocks, the number of 1k blocks with a '+' afterwards.
 
 Plus, you want the mbr as well, plus whatever is between blocks 0 and
 63, so better option might be:

yay, crossing eyes: s/so better option might be/the right option is/

 
 dd if=/dev/hda of=parttbl+mbr+boot.backup bs=512 count=979965
 
 
 -Richard
 
Otherwise you can simply read the value under End (+1) instead of the
one under Blocks ;)

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] backup restore solution?

2005-07-31 Thread Neil Bothwick
On Sun, 31 Jul 2005 13:48:09 +0200, Richard Fish wrote:

 For 'quick-and-easy' restoring, I'm not aware of anything that really 
 automates the process.  But generally the steps are:
 
 1. fdisk
 2. mkfs
 3. mount
 4. restore files
 5. chroot
 6. install boot loader
 7. reboot

Partition image will handle everything by stage 1 with a single command.
You may need to run the bootloader to set it up,although there is an
option in partimage to backup the MBR.

 One last thing, if you've only got a single CD/DVD drive, you are 
 probably going to have an issue to have both the live CD and the backup 
 media available, since you can't really eject the live CD to insert
 your backup disk.

Doesn't The Gentoo CD have an option to load the compressed filesystem
into RAM, so you can unmount the CD? If it doesn't, plenty of others do.
It doesn't have to be a Gentoo CD, just any live Cd containing the
necessary restore commands.

Another alternative is to include the Live CD components on the DVD, so
you have a full restore from a single bootable disc. This normally
involves copying the contents of the Live CD to the DVD image and using
the mkisofs arguments listed in the isolinux documentation to make it
bootable.


-- 
Neil Bothwick

Did you know that eskimos have 17 different words for linguist ?


pgpjX25DhmRo6.pgp
Description: PGP signature


[gentoo-user] backup restore solution?

2005-07-30 Thread Jarry

Hi,

I am now looking for some sort of backup  restore solution which would
help me to get my gentoo-server up and running after fatal disk failure.

I want to burn at regular intervals compressed partition images of disk
on internal dvd/rw/ram (4.5 GB should be enough for archiving the whole
disk, without /home partition).

But what I also need is fast and reliable restore function, for the case
that all I have is a new replacement-disk, gentoo installation cd, and
dvd/rw/ram with archived partition images (+ restore sw on floppy).
Could you recommend me some software? I checked software in app-backup,
but there is nothing about quick  easy restoring...

Jarry
--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] backup restore solution?

2005-07-30 Thread Neil Bothwick
On Sat, 30 Jul 2005 19:24:06 +0200, Jarry wrote:

 But what I also need is fast and reliable restore function, for the case
 that all I have is a new replacement-disk, gentoo installation cd, and
 dvd/rw/ram with archived partition images (+ restore sw on floppy).
 Could you recommend me some software? I checked software in app-backup,
 but there is nothing about quick  easy restoring...

For restoring entire partitions, backups made with tar or partimage are
good. In either case, a single command is all you need to restore the
partition.


-- 
Neil Bothwick

Like an atheist in a grave: all dressed up and no place to go.


pgpwd9vtm46VK.pgp
Description: PGP signature