YDL Disk Rescue [Long]

Joseph E. Sacco, Ph.D. joseph_sacco at comcast.net
Mon Feb 7 14:53:35 MST 2005


I have successfully "rescued" a YDL-4 disk using:

	* partimage-0.6.4
	* QtParted-0.4.4

========================================================================

The Situation:
---------------
PPC G4 [silver] with two internal 73GB SCSI drives that run Linux. One
drive, /dev/sda, has a clean install of YDL-4 installed on a single
partition, /dev/sda7. The other drive, /dev/sdb, contains my working
system.

The Experiment:
----------------
* capture an image of /dev/sda7, the partition on sda containing YDL-4,
  and store it as a file somewhere on /dev/sdb

* reformat /dev/sda7
  - install an ext3 file system, select a mount point [label]
  ==> destroys [access to] all data in the partition

* restore the partition image
  stored on sdb to /dev/sda7, zeroing out all free blocks.

* test


The tools
----------
Partimage

	http://www.partimage.org/

 is a utility that captures an image of a disk partition.

[from the partimage web page]

        Description: Partition Image is a Linux/UNIX utility which saves
        partitions in many formats (see below) to an image file. The
        image file can be compressed in the GZIP/BZIP2 formats to save
        disk space, and split into multiple files to be copied on
        removable floppies (ZIP for example), ... Partitions can be
        saved across the network since version 0.6.0. 
        
        Partition Image will only copy data from the used portions of
        the partition. For speed and efficiency, free blocks are not
        written to the image file. This is unlike the 'dd' command,
        which also copies empty blocks. Partition Image also works for
        large, very full partitions. For example, a full 1 GB partition
        can be compressed with gzip down to 400MB. 

This utility is something akin to Symantec's Ghost. It can be run from
the command line [making it scriptable] or from a simple cursors-based
UI. It will also work across a wire.

QtParted

	http://qtparted.sourceforge.net/

Is a Qt-based GUI for parted, the GNU disk partition manipulation tool.
The GUI is easy to use, masking some of the complexities of parted.


Creating the partition image
----------------------------
A partition must be unmounted in order to capture its image.  That is
not much of constraint in this experiment because I am running on the
linux system installed on the other disk. It is, however, a fundamental
point to keep in mind when thinking through a process for system
recovery. 

If you have only one system with one internal disk whose OS is beyond
repair, you will need a rescue CD to boot up off a RAM disk.  That
rescue CD must necessarily provide whatever tools are required to
partition a disk, format partitions, and restore partition images that
are stored somewhere else, possibly on removable media.

A clean install of YDL-4 occupies about 7GB. The process of capturing an
image of /dev/sda7 and storing it somewhere on /dev/sdb was uneventful:

        Time Elapsed: 43:33
        Speed:        164.71 MB/min
        Data Copied:  7.01 GB
        Image size:   1.94 GB


Recreating the partition
-------------------------
QtParted is simple to use. The utility alerts you any time it is about
to perform some action that is irreversible.  This is a good thing. When
launched, QtParted probes to find all drives including removable media.
Selecting a disk brings up its partition table *if* it exists. Once a
disk is selected, partitions can be modified, created, or deleted. File
systems of various types, including linux-swap, can be installed on
partitions.  Mount points can be assigned.

I deleted /dev/sda7, recreated it, added an ext3 file system, assigned
'/' as the mount point. I then mounted /dev/sda7 to a directory created
on sdb [the running linux system] just to verify that the partition was
mountable [==> FS OK] and empty. It was, so I unmounted it and rolled
on.

Restoring the partition image
-----------------------------
A partition must be unmounted in order to restore its image. The GUI for
partimage was used to restore the parition image [stored as a file on
sdb] to /dev/sda7. The setup process was straightforward. The option to
zero all free blocks was selected.

The restoration took abut 42 minutes:

        Time elapsed:	41:32
        Speed:		1.62GB/min
        data copied:	67.37GB  <<== reports the partition size
        
Testing
-------
* reboot into linux
  [hit TAB when "boot:" appears to manually enter a selection]

* select the linux system on sda
  [there are multiple entries in /etc/yaboot.conf]

* observe the boot sequence.

It worked!!! System comes up just fine... Life is good.


-Joseph

-- 
joseph_sacco[at]comcast[dot]net



More information about the yellowdog-general mailing list