Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jul 2004 20:35:55 -0400 (EDT)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        mail63133@telkomsa.net (Livhu Tshisikule)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How can I recover /usr
Message-ID:  <200407270035.i6R0Zto23233@clunix.cl.msu.edu>
In-Reply-To: <200407261445.25612.mail63133@telkomsa.net> from "Livhu Tshisikule" at Jul 26, 2004 02:45:25 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Hi,
> 
> 1. How can I recover /usr, when I boot the system it goes to single user and 
> ask me to run fsck manually but the /usr has a bad block. The machine is a 
> server for diskless machines. 

Well, hopefully you have been making backups.
Put another disk in and boot to single user.  fdisk, disklabel
and newfs space for /usr and restore /usr from backups.   Then
fix /etc/fstab to mount the new space as /usr instead of the
old bad space.

Or you may want to completely replace the disk by making file 
systems on the new disk for everything on the old one and doing
a dump/restore of the still good file systems as well as 
the restore of a /usr from backup.   This is a good idea because
typically if you get a bad block on one filesystem it is a
sign that the disk is on its last legs.   There are built in
fail-over sectors on modern disks and if you see a bad sector
it likely means that it has already used up all the fail-over
sectors.   So, time to replace it, before things really crap out.

If you don't have backups (tsk tsk) then you can try figuring out
a way to direct copy every file except the one with the bad sector
to some new space and then figure out how to recreate the file
that crosses the bad sector.  But, that will take some doing.
If the bad sector is the superblock, you might be able to figure
out how to use an alternate superblock just long enough to copy
files off the disk, but not to keep running.  I have read about
that but never tried it so someone else would have to coach you
on that sort of thing.

Good luck,

////jerry

> 
> Regards
> Livhu  
> 
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407270035.i6R0Zto23233>