Best way to check and fix corrupt disk?
What is the best way to check for corrupt sector and fix it on
FreeBSD? I check FSCK to see if there is any option but I can
not find one ... maybe I'm wrong. You know like windows
have scandisk with fix option. My little baby press the reset button
on the computer a couple of time and now the system found
an "incorrect block count I=32 ..." I would like to know if there
are any other way to check and fix this beside FSCK.
FSCK should fix those errors. Boot into single user and run just bare "fsck" and wait. Depending on the size of your drive and how you partitioned it, it may take a long time.
I just saved a bunch of money on my car insurance by fleeing the scene of the accident!
Thanks for the reply.
I just google on how to fix corrupt sector in FreeBSD and I got this
in more detail. I just want to share with all the newbie or anyone how need
Boot into Single-user mode
Reboot your machine:
When you see the initial boot menu, select "Boot FreeBSD in single user mode" (option 4). The kernel will boot up as
usual, but instead of starting all the system processes, only a single root shell will be provided. Hit Enter when you see
Enter full pathname of shell or RETURN for /bin/sh:
Now check what filesystems are mounted:
/dev/ad0s1a on / (ufs, local, read-only)
devfs on /dev (devfs, local)
You should see that only "/" (the root filesystem) and the devices under /dev are mounted, and furthermore the root
filesystem is mounted read-only. There are also no virtual consoles and no daemons running. This is the simplest and
safest possible state for the system to be in.
Since the filesystems are not mounted, you can run the filesystem repair tool "fsck" on them (fsck = File System Check).
Its job is to make corrupted filesystems functional again. If individual files have been damaged then they may not be
recoverable, but at least the filesystem will be working again and the other files on it can be accessed.
Firstly, have a look at which partitions are normally mounted; this information is kept in the fie "/etc/fstab"
# cat /etc/fstab
Pick one of these partitions, and run fsck on it. For example, if you decide to check the partition /dev/ad0s1d, then you
# fsck -y /dev/ad0s1d
(The -y flag gives fsck permission to carry out any repairs it suggests). If your filesystem is "clean", that is, it was
unmounted properly at system shutdown, fsck may not do anything. In that case almost certainly it’s not needed, but you
can force it to check the filesystem like this:
# fsck -f -y /dev/ad0s1d
There’s no need to run fsck in single-user mode like this unless during bootup FreeBSD tells you that there’s a filesystem
error which it can’t handle. Make a note of which partition is at fault, reboot into single user mode, and run fsck on that partition only.
back using 5.x I always had to boot single-user to fsck properly
now ( using _7, the last 10 or so times) I just boot normally and
it completes fine. Maybe useful to know.
using /LOOKAT/ with /var/db/pkg files and portmaster/aliases/pipes/find/grep to meteorically speedup port upgrades/installs...
Besides file checking, run this one:
Chances are, when ran a couple of times, that you will implement proper backup|sync procedures
As most of us do, usually we run fsck -y
in the hope evrything gets fixed.
Remember that a hard disk is a table with entries and pointers.
"Formatting" only set those entries as "re-writable".
Proper test is destructive, as most manufacturer's hard drive utilities, but these will actually "zero" your drive, mark bad sectors (in yet another table), eventually give you a report to use for a RMA.
Watch fine prints in the warranty (or browse the manufacturer's site): some drives carry five years (wheter manufacturer's, or national distributor, or local outlet).
I keep a table of serial numbers and dates and test in due time.
da more I know I know I know nuttin'
Last edited by lvlamb; 29th January 2009 at 12:02 PM.
|Thread||Thread Starter||Forum||Replies||Last Post|
|Check this out (funny contest).||fbsduser||Off-Topic||6||4th March 2009 09:48 PM|
|please check my pf.conf||gosha||OpenBSD Security||10||29th January 2009 11:32 PM|
|Disk geometry for Seagate disk||phreud||FreeBSD Installation and Upgrading||5||8th November 2008 09:51 PM|
|check for badblocks||ccc||FreeBSD General||5||30th October 2008 06:00 PM|
|how to check package dependencies?||bsdnewbie999||OpenBSD Packages and Ports||5||31st July 2008 04:05 AM|