[SlugLUG] When Bad Hard Drives Happen to Good Linuxes

cerise at armory.com cerise at armory.com
Mon Oct 2 12:52:43 PDT 2006


On Mon, Oct 02, 2006 at 12:14:06PM -0700, Eric Carter wrote:
> When I got enough time to deal with the situation with the care and
> compassion that I desire my computers to be dealt with I found that the
> drive boots up and seems fine, but occasionally makes evil noises. The drive
> is on my desk, and I've had no indication of data failure. I'd like to
> salvage all the work I put into getting Ubuntu set up. A new (HUGE!) drive
> is on it's way. What's the easiest way to salvage my Ubuntu install when it
> arrives?

   Put both drives in, dd if=/dev/$olddisk of=/dev/$newdisk conv=noerror, 
reboot, pull the old drive out[1], boot up again, run e2fsck on $newdisk.  That 
ought to effectively duplicate the drive (including the bootsector and 
partitioning).
   I'd follow that up by consistency checking / on /dev/hdb, converting it to
ext2 with tune2fs[2], and using parted to resize (and possibly extend) the 
now-ext2 filesystem.  Add any other partitions you desire, then use tune2fs
to change the / filesystem to an ext3 fs.
   You can speed the process up slightly by dd'ing the first 512 bytes of the
old disk to the new disk and copying only the ext3 partition over since the
swap doesn't matter, but that takes a little more footwork than I'd care to do.
Given the amount of time the dd will probably take, it's probably a negligable
percentage of time that you'll save.
 
-Phil/CERisE

[1] This is a precaution in two respects.  It limits further drive damage and
    keeps you from doing anything stupid to the old drive.  From your 
    description of the sound, I'd guess that one of the heads has gone wrong.
[2] As far as I know, you cannot directly resize ext3 because of its 
    journalling.  As a result, you need to replay the journal and convert it
    to a resizable ext2 fs first.  I could be wrong though.  The way to find
    out would be to see if parted will resize it for you.


More information about the Sluglug mailing list