[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Dup Linux HD + 2 linux books online
Hi,
Regarding the discussion about duplicating a Linux HD
I've just read Linux Gazette N17: The Answers Guy Section:
And it includes a few ways to do it, may be you are interesting to see
them here in Attouchment
or from http://www.ssc.com/lg/issue17/answer.html#duplic
The other things that may have a use for you are the following online
Linux books:
Red Hat Linux Unleashed:
http://www.mcp.com/sams/books/30962-9/httoc.htm
Running a Perfect Internet Site with Linux :
http://www.mcp.com/que/et/intlinux/tc-05141.htm
Regards,
-------------------------------------------------------------------------------
Stas Bekman sbekman@iil.intel.com.il [ WebMaster at Intel Corp. ]
Address: Aba Silver 12/29, Haifa, 32694, Israel
Phones: [w] 972-(0)4-865-5188, [h] 972-(0)4-828-2264/3020
Home Page: http://techunix.technion.ac.il/~ofelix
Resource Center http://www.mardanit.co.il/Center (CGI, PC, Security, Linux)
Linux-il Home: http://www.linux.org.il/
Duplicating a Linux Installed HD
From: Mohammad A. Rezaei, rezaei@tristan.TN.CORNELL.EDU
I just read your response to duplicating a hard drive using dd. I think using dd limits the
uses of this technique too much.
I absolutely agree. I wonder where I suggested 'dd' without expressing my misgivings.
Please consider quoting little portions of my posting when making references to them -- I write
alot and can't remember past postings without some context.
I have more than once installed/transfered entire hard drives using tar. simply
put both drives in the same machine, mount the new drive in /mnt and do something like
tar -c -X /tmp/excludes -f / | (cd /mnt; tar xvf -)
The file....
/tmp/excludes should contain:
/mnt
/proc
and any other non-local, mounted drives, such as nfs mount points.
There are better ways to do this. One way is to use a command like:
find ... -xdev -type f | tar cTf - - | \
(cd ... && tar xpf - )
Another is to use:
find ... | cpio pvum /new/directory
... which I only learned after years of using
the tar | (cd ... && tar) construct.
In both of these cases you can use find parameters to include just the files that you want. (Note:
with tar you *must* prevent find from printing any directory names by using the -type f (or more
precisely a \! -type d clause) -- since tar will default to tar'ing any directories named in a
recursive fashion).
The -T (capital "tee") option to GNU tar means to "Take" a list of files as an "include" list. It is
the complement to the -X option that you list.
You can also pipe the output of your find through grep -v (or egrep -v) to filter out a list of files
that you want to exclude.
finally, one has to install the drive onto the new machine, boot from floppy and
run lilo. The disks don't have to be identical. the only disadvantage is having to run lilo,
but that's takes just a few minutes.
The only message I can remember posting about 'dd' had an extensive discussion of
using tar and cpio for copying trees. Am I forgetting one -- or did you only get part of my
message?
Hope this helps.
Hopefully it will help some readers. The issues of copying file trees and doing differential
and incremental backups is one that is not well covered in current books on system administration.
When I do a full backup I like to verify that it was successful by extracting a table of contents or
file listing from the backup media. I then keep a compressed copy of this. Here I use tar:
tar tf /dev/st0 | gzip > /root/tapes.contents/.....
.... where the contents list is named something like:
antares-X.19970408
.... which is a hostname, a volume (tape) number and a date in YYYYMMDD format (for proper
collation -- sorting).
To do a differential I use something like:
find / -newer /root/tape.contents/.... \
| egrep -v "^(/tmp|/proc|/var/spool/news)" \
| tar czTf - /mnt/mo/diff.`date +%Y%m%d`.tar
... (actually it's more complicated than that since I build the list and compute the size -- and do
some stuff to make sure that the right volume is on the Magneto Optical drive -- and mail
nastygrams to myself if the differential won't fit on that volume -- if the volume is the most recent
one (I don't overwrite the most recent -- I rotate through about three generations) -- etc).
However this is the core of a differential backup. If you wanted an incremental -- you'd supply a
different file to the -newer switch on your find command.
The difference between differential and incremental is difficult to explain briefly (I spent about a
year explaining it to customers of the Norton Backup). Think of it this way:
If you have a full -- you can just restore that.
If you have a full, and a series of differentials, you can restore the most recent full, and the most
recent differential (any older fulls or differentials are unneeded)
If you have a full and a series of incrementals you need to restore the most recent full, and each
subsequent incremental -- in order until the most recent.
It's possible (even sensible in some cases) to use a hybrid of all three methods. Let's say you have
a large server that takes all day and a rack full of tapes to do a full backup. You might be able to do
differentials for a week or two on a single tape per night. When that fills up you might do an
incremental, and then go back to differentials. Doing this to a maximum of three incrementals
might keep your all day backup marathons down to once a month. The restore must go through
the "hierarchy" of media in the correct order -- most recent full, each subsequent incremental in
order, and finally the most recent differential that was done after that.
(Personally, I avoid such complicated arrangements like the plague. However they are necessary
in some sites.)
-- Jim