Zapped /etc,/bin,/dev ... how to recover user files?

Thad P Floryan thad at cup.portal.com
Thu Mar 29 23:11:26 AEST 1990


Just a quick note (before I forget all the details (since I'm about to fall
asleep at the keyboard)) re: the zapped HD's /dev, /bin, and /etc.

After looking at his system during the Users' Group meeting, several fsck's
cleared up the anomaly.  The cause of the problem was interesting: apparently
he mounted the HD onto a directory of the same HD, then wrote a cpio archive
into it ... three directories (/etc, /bin, /dev) became files.

On a "stock" UNIXPC/3B1/PC7300 hard disk, there are three partitions:

/dev/{r}fp000  --  boot loader
/dev/{r}fp001  --  swap area
/dev/{r}fp002  --  first (or only) filesystem area

The person who actually did the dirty deed was an ex-Motorola FE (Field
Engineer) running su'd (capability needed on a stock Moto 6300, 6350, 6600 to
mount a floppy) who entered the command (after being given an incorrect
device name due to having no docs):

	mount /dev/fp002 /mnt

then pumped a cpio archive out to it, then unmounted /dev/fp002.  "/mnt" was
already a directory on /dev/fp002, so you can imagine what this did to the
filesystem.  As one can NOW see, one shouldn't mount a device onto a portion
of itself, and this shows one need for the proper docs for any given computer
system.

For the record, the correct way to mount a floppy on the UNIXPC (or the Moto
6300, for that matter) is:

	mount /dev/fp021 /mnt

Also for the record: after the fsck's (and it showing circular directory links
and 968MB files and other oddities), only the /dev, /mnt and /etc directories
were clobbered, and those we initially restored from the floppy systems and
will (shortly) be restored in their entirety from the Foundation Set disks
(since now the HD boots again).  No "user" files were lost (to everyone's
relief!).  One of the important "clues" came from using df (and fsck) which
had to be copied onto a special floppy-filesystem disk we created during the
User Group meeting.

After all the above, I'm still amazed at the robustness of the UNIX filesystem.

Thanks to everyone for their postings and e-mail offering guidance and moral
support; another example of the Usenet community helping others!

Thad Floryan [ thad at cup.portal.com (OR) ..!sun!portal!cup.portal.com!thad ]



More information about the Comp.sys.att mailing list