Gaining access to disks made inaccessible

Peter K. Hadley phadley at
Thu Jul 21 16:39:25 GMT 2005

I have made my machine unbootable.  I installed FreeBSD on ad0s2, a 
partition of one physical hard drive.  I put most of my working data on 
ad1s2, a partition of another much larger hard drive.  I then created 
links from /home, /etc, and /usr to the second drive.  This worked well 
until the power outages.  The second drive was always sufficiently well 
corrupted that it refused to be mounted.  Because fstab failed, booting 
quit.  This was cured by fsck but I was hoping to run the machine 
headless as good discipline for a real server so I had to grab the 
keyboard from another machine in a geometrically compromised setting and 
use it.

To forestall this problem, I edited fstab to make the second disk 
noauto.  At the very next power outage, it started booting and did quite 
well at it until it tried to grab a terminal from /usr.  This was linked 
to the now unmounted disk.  I had no obvious way of getting a command 
prompt to mount the disk.  I stumbled on the Fixit disk and it was fun 
but after fsck it could find only lost+found on the drive and never 
could mount the first drive (bad superblock).  I couldn't even fsck it.  
Is there some way to get at either /etc/fstab or to rearrange all those 
links so that I can get everything?  All I want is access to / on the 
first disk.  From there I should be able to rearrange things so the 
machine is usable and then I can mess it up in a new way.

I think in the future, I'll have /usr in the directory where I mount the 
second drive.  That way it will be there until I place the new one over 
it.  If that doesn't work, I think I'll just have only /home on the 
second drive and live with it.

Thank-you for listening and I thank you for any advice, especially 
advice that works.

More information about the freebsd-questions mailing list