Re: backup of disk image to tape but i need some flexiblity when restoring !
From: Nick Landsberg (hukolau_at_NOSPAM.att.net)
Date: 02/23/04
- Next message: Andreas Janssen: "Re: spamassassin bayes"
- Previous message: Billy O'Connor: "Re: newbie"
- In reply to: Vilmos Soti: "Re: backup of disk image to tape but i need some flexiblity when restoring !"
- Next in thread: John Thompson: "Re: backup of disk image to tape but i need some flexiblity when restoring !"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 23 Feb 2004 17:34:18 GMT
Vilmos makes a very good point, below:
All backups should be done on a quiescent device, i.e.
no writes going on, otherwise you cannot guarantee
that the backup is valid. This also applies to utilities
such as "tar" where the file may change out from
under you as it is being backed up.
The desirement (as opposed to requirement) for the
backup taking "no time" is also questionable.
The "dd" method will read all 36 GB from the disk
and write it to tape using a bit-for-bit image copy.
As Vilmos points out, this may be wasteful, if there
are large chunks on the disk which belong to no current files.
Just reading 36 GB of data from a disk may take on the
order of 10-20 minutes or more. Writing it to tape will
most probably take even longer so that the total time
to do the backup will be dominated by the tape.
Restoring will also take just as long.
Restoring from a "dd" will overwrite the partition
table with that data on the tape. Thus, your
hypothetical future 72 GB drive will become,
de facto, a 36 GB drive unless you do some
"smoke and mirrors" after the restore. (Don't
try this at home, kiddies!) But, if you're restoring
to another 36 GB drive, all should be OK, mostly.
"tar" will only back up the currently existing files,
which will save time if you don't have a full filesystems
on the disk. Restoring from a "tar", tho, will require
you to partition the new disk and mount (!) the partitions
for the restore to work.
Tradeoffs, always tradeoffs!
Either can be automated with a (most-probably) complex
shell script (you choose your own favorite shell).
However, the error checking necessary in that particular
script will probably be 75% of the code in it, and,
even then, it will not be "idiot proof."
(See signature line)
Vilmos Soti wrote:
> "Tom Van Overbeke" <tom.van.overbeke@pandora.be> writes:
>
>
>>I have a few linux servers that i want to be able to restore in no time, so
>>i was thinking of dumping the entire disk contents to tape using dd.
>>sth. like dd if=/dev/sda of=/dev/st0.
>
>
> Don't do it. First, it seems that /dev/sda hosts your root
> partition. How long it would take to backup /dev/sda? Will
> anything change during that time? You will have a corrupt
> backup. If a file is changed, that's one thing. But the
> filesystem metadata will also change, so your backup will be
> problematic. You should use dd to copy a partition/disk only
> if the partition is either not mounted or is mounted readonly.
> Second, this thing will also backup unused space. Say, you had
> a 300MB gzipped file a while ago but you already deleted. Then
> dd, since it doesn't work on the filesystem level, will also
> backup the still existing blocks of this long gone file. It will
> inflate your backup, and it is also hard to compress. Third, if
> your disk has surface errors, then that can also cause problems.
>
> All in all, this is not a good way to backup your data.
>
>
>>the problem with this is: what if the disk to be restored on is different
>>in size.
>>
>>Can i expect that if the disk is bigger, the restore would work without a
>>problem ?
>
>
> No.
>
>
>>The problem being that the servers are serviced by the manufacturer itself,
>>and who nows if they decide a year from now to only provide disks of 72GB
>>instead of currerntly 36GB. Would my 'dd' backup still be of any use ?
>
>
> This is one reason why at work we don't want manufacturers to service our
> machines... We buy the parts, we build it, and we are totally in control.
>
>
>>other question, could i restore these tape contents to an image file, and
>>mount this image file as a virtual disk ?
>
>
> No, since you backup a whole disk and not a partition. You can mount
> a partition image, but not a disk image (unless you make some real
> messing around like extracting the partitions from the image).
>
> Also, since you backed up a life rw filesystem, there *WILL BE*
> errors on the backup. And some will be filesystem metadata which
> means the whole image is unreliable. You might be able to mount it,
> but it won't be what you are looking for. It will have some hidden
> errors which will come back and haunt you in the long run.
>
>
>>lastly,
>>are there other problems or better approaches for what i am trying to do ?
>
>
> If you are not easy writing your own backup solution
> (and maintaining it), then consider buying a commercial backup
> solution which handles these problems. Of course, there are
> also free solutions. I don't know any of such since I wrote
> our own backup program (perl and uses tar) to handle our needs.
>
>
>>how do i get the entire disk contents to fit on one tape. is it safe
>>to pipe the data through gzip before writing them to tape ?
>
>
> If the tape does its own compression, then you don't have to worry
> about compressing. But you might need to enable it. If it is not,
> then you can run it through gzip. However, bzip2 would be a better
> choice since it compresses better, and if for some reason the tape
> becomes corrupted (i.e. one or two blocks become unreadable or
> corrupt) you still can recover things behind it.
>
> Vilmos
-- Ñ "It is impossible to make anything foolproof because fools are so ingenious" - A. Bloch
- Next message: Andreas Janssen: "Re: spamassassin bayes"
- Previous message: Billy O'Connor: "Re: newbie"
- In reply to: Vilmos Soti: "Re: backup of disk image to tape but i need some flexiblity when restoring !"
- Next in thread: John Thompson: "Re: backup of disk image to tape but i need some flexiblity when restoring !"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|