Server hang : fsck
Michael Powell
nightrecon at hotmail.com
Fri Jan 10 15:27:15 UTC 2014
eras mus wrote:
[...]
>
> As advice by Polytropon burnt alive CD And ran fsck manually.
> # fsck -yfv /dev/ad4s1a
> # fsck -yfv /dev/ad4s1d
>
> are successful.
> But when ran
> # fsck -yfv /dev/ad4s1e
>
> It was messages as in
>
> http://picpaste.com/img3-It4JOaph.jpg
>
I suspect what you may be experiencing is magnetic media failure on your
drive, which means it will need to be replaced with a new one. This can be
verified by using the drive manufacturers diagnostic utility. The bulk of my
experience around IDE/Sata drives is largely centered on Western Digital.
They have a utility called WD Diags, which can be found in a bootable .iso
form which I have on an old CD-RW disk.
When run there is a 'Quick' test and a more thorough in-depth longer one.
The 'Quick' test is non-destructive, but will show you an error if there is
a problem with the drive. The long test can sometimes repair a disk, but
this depends on the drive's remap area being not full. Even though once I
have observed a long test fix a drive and not destroy data, it is expected
that the long test will wipe the drive. The remap zone is a space on the
drive that it uses to map out bad sectors as they develop over time. When
this space fills bad sectors cannot be mapped out any longer and it is time
to buy a new drive.
I would hesitate to simply use dump to backup this drive with the idea of
using restore to copy everything over to a new drive. Should you try it and
there is defective media you will find dump will stop when it hits the bad
spot(s). Your bits are probably already in a damaged state. No amount of
softwares like fsck can fix the underlying problem which is that the hardware
needs to be replaced. If this is truly the case, the manufacturers utility
can/will confirm.
If this is a case of bad media and the drive is up for replacement I would
concentrate on preserving copies of all configuration information. This will
enable you to put in a new drive and manually configure everything in the
new install the same way as the old. Much of this is /etc, and
/usr/local/etc, where /etc will have the base OS's config while
/usr/local/etc has all configs for installed third-party applications.
There is also /var/db/pkg which contains pkg info for installed apps, and
/var/db/ports which holds build config options for ports you have installed.
If the system is very old and you are making a jump from let's say version
6.2 to something like 9.2 release you would only refer to the options for
hints on how to proceed; the ports have changed so much that you can't just
simply copy the /var/db/ports directory over. If the system was the same,
e.g. if the old machine had 9.2 and you were just putting it back to a new
drive you could just copy.
In a case where the magnetic media in the drive has, or is failing, I would
look towards starting over with a fresh install with the new drive. If you
had _known_ good backups from the drive which were not so old as to be
extremely out of date I would just restore these to the new drive. If you do
not, and you have bad spots on the drive you'll find it's too late for that
- dump will error out when it hits the bad spots. A fresh install is a lot
of keyboard time but at the end you get back what you had if you have
preserved all the old configuration details. Confirm the problem is media
going bad, or already has gone bad using the mfr's diagnostic utility. This
will point you in the direction you need to go if such is actually the case.
(Bad media simply cannot be fixed with things like fsck)
-Mike
More information about the freebsd-questions
mailing list