Mailinglist Archive: opensuse (2912 mails)

< Previous Next >
Re: [SLE] ISO directory chunks--mkisofs--backup and restore
  • From: "Carlos E. R." <robin1.listas@xxxxxxxxxx>
  • Date: Thu, 3 Feb 2005 02:43:40 +0100 (CET)
  • Message-id: <Pine.LNX.4.58.0502030231550.11545@xxxxxxxxxxxxxxxx>

The Wednesday 2005-02-02 at 11:00 -0700, Ted Hilts wrote:

> Using my SuSE 9.1 Pro CD #1 to bring up "rescue mode" in order to create an
> image backup of /dev/hdb2 where Linux is located I could do the following
> steps:
> # mount /dev/some_other_drive /mnt (as a place to store the ISO image)
> # dd if=/dev/hdb2 of =/mnt/image_dir/image_file conv=noerror,sync
> # mkisofs -R -l -L -A "some_label" -o /mnt/image_dir/image_file
> /another_drive/make_cdrom/iso_image
> These 3 steps will create a true image of the entire 80Gig drive when only
> 8Gig of space is used.

Actually, only of the second partition.

> But I do not have the storage capacity to duplicate an
> 80 Gig drive (I have Linux on just one primary partition for the entire drive)
> and I don't want to create a set of DVDs or CDs with nothing on them.

You would need to compress the image, with a pipe, to avoid creating a
large temporary file.

> Apparently "dd" thinks in blocks and not directories and since fragmentation
> might occur I cannot assume all primary directory structures below "/", such
> as "/lib" and "/var" are contiguous and even if there were a way of making
> them contiguous I don't know how to specify the number of blocks for the "dd"
> command (start and end points for each directory chunk).

dd copies everything as is. But there are tools out there to create
directly images (partimage? mondo?). If your partition is not reiser, you
even could use "dump".

> Therefore, I was thinking of doing the following instead (again using the
> rescue mode):
> 1. Using "cp" command I would copy the directory chunks /boot, /var, /etc,
> /dev, /lib and other directories one at a time over to a location on another
> drive (call it "drive" for now with the directory "store_here" holding each of
> the above directories chunks but only one at at time).

Even better, use mkzftree.

> 2. Each time for each directory chunk (example is "/var") I would do:
> # mkisofs -R -l -L -A "some_label" -o /drive/store_here/var
> /another_drive/make_cdrom/iso_image

I use mc to divide the destination compressed tree in chunks that fit into
a CD or DVD, and then create the appropiate iso images.

> NOTE: Apparently in rescue mode there is no mkisofs command available -- only
> when in level 5.
> Anyway, I don't this this will work -- but I don't know why???
> Normally (in my experience) "var" in the directory string
> "/drive/store_here/var" would be a file name (not a directory structure) and
> would be created using "dd". So instead of step 2, if I were to first create
> each of these directory structures into a compressed tar ball and then run
> mkisofs where now -- for example -- "var" is a compressed tarball of the
> directory "/var" I would end up with an ISO file system for each directory
> that I could blast onto one or a few CDs or a single DVD. I should be able to
> decompress and untar the tar ball from the CD ROM and put the contents
> anywhere I want???

As I said, I prefer mkzftree. The result is a compressed cd/dvd that can
be read directly and transparently, with the same file structure as the
origianl: I can pick any single file inmediately from my backup without
resort to tar/gzip tools.

But, as I said, there are tools out there to generate images. Can't
recomend any one personally, but they have been mentioned often in this

Carlos Robinson

< Previous Next >
This Thread