Xref: utzoo comp.sys.att:9135 unix-pc.general:5125 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!fernwood!portal!cup.portal.com!thad From: thad@cup.portal.com (Thad P Floryan) Newsgroups: comp.sys.att,unix-pc.general Subject: Re: Zapped /etc,/bin,/dev ... how to recover user files? Message-ID: <28413@cup.portal.com> Date: 29 Mar 90 13:11:26 GMT References: <28295@cup.portal.com> Organization: The Portal System (TM) Lines: 47 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@cup.portal.com (OR) ..!sun!portal!cup.portal.com!thad ]