How to recover /usr and /home directory

Gayn Winters gayn.winters at
Mon Apr 3 14:17:50 UTC 2006

> [mailto:owner-freebsd-questions at] On Behalf Of 
> Edwin D. Vinas
> Sent: Sunday, April 02, 2006 10:43 PM
> To: freebsd-questions at
> Subject: How to recover /usr and /home directory
> Hi,
> I have a previous 40GB HDD which crashed during power outage 
> and now no
> longer repairable. Before I installed a new HDD, I can still see the
> contents of that defective hard disk when booting from a 
> single user mode.
> Now, I set it up as slave and installed a new FreeBSD on the 
> new master HDD.
> But then, when I mounted the old hard disk, I can no longer 
> see any content
> in my /usr and /home directories. These directories are the 
> ones with "hard
> error reading" blocks which made FreeBSD not to continue 
> booting due to
> unending and irrepariable fsck commands on this filesystem. 
> All my website
> files and programs are on that old HDD especially in the /usr 
> directory.
> Does the new setup master/slave have somehow caused those 
> files hidden? How
> do I mount even the fragmented blocks? Any suggestion on how 
> I can recover
> my files? Why is FreeBSD so susceptible to fragmentations 
> when suddenly
> turned off or when there is a power outage?
> This is what I don't like with FreeBSD; it does not care too 
> much on data!
> Even the fsck doesn't tell you that the hard disk is no 
> longer usable as it
> will still prompt you to do fsck over and over again. And 
> now, my /usr and
> /home suddenly disappeared when mounted. I can still see these two
> directories last week but now it seems they're gone.
> Thanks.
> Edwin

I assume your old /usr and /home are (or were) partitions.  Check
/etc/fstab and your disklabels for accuracy now.  If bsdlabel can't find
the partitions on your old disk, then you can try using
/usr/ports/sysutils/scan_ffs to rebuild your disklabels if necessary.
You'll then need to rerun fsck to see what you can salvage.

Regarding fsck itself, I suppose one could add intelligence for fsck to
issue ever increasingly stern and obnoxious warnings to backup your data

Good luck on your recovery effort,


Bristol Systems Inc.

More information about the freebsd-questions mailing list