*BSD News Article 62899


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.bhp.com.au!mel.dit.csiro.au!munnari.OZ.AU!news.ecn.uoknor.edu!paladin.american.edu!gatech!newsfeed.internetmci.com!in2.uu.net!news1.digital.com!decwrl!cronkite.cisco.com!iverson
From: iverson@cisco.com (Tim Iverson)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: FS Repair Trick
Date: 24 Feb 1996 03:21:55 GMT
Organization: cisco
Lines: 26
Message-ID: <4gm08j$l3a@cronkite.cisco.com>
Reply-To: iverson@lionheart.com
NNTP-Posting-Host: rottweiler.cisco.com


Many of you probably already know this trick, but I just had cause to use it
again, so I thought I'd mention it here.  If your root FS gets trashed to
the extent that you can't run FSCK from the installation floppies.  You can
still preserve your root FS by installing the auto-installer's mini-root in
the swap area.

  . First, use disklabel to cut your swap in half (or at least by enough to
    hold the installation CPIO files).
  . Then create another slice using the newly free disk space and mark it
    for newfs mounted on /; eg. slice 'e'.
  . Install the CPIO disk to your new root (be sure the installer doesn't
    touch your old filesystems!) and then reboot to the new root.  You'll
    probably have to specify it explicitly, eg. Boot: sd(0,e)/kernel -c.
  . You now have a mini-root with which to fix your real filesystems.

In my case, the only fixing I had to do was specify an alternate
super-block for the fsck of my root.  If you don't know where the alternates
are, you can usually use 'newfs -N /dev/hd0x' to print them out.

Oh yeah, if you keep repair notes, remember to keep them on paper.  ;-)


- Tim Iverson
  iverson@lionheart.com