![]() |
|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
Hi folksss,
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. Thanks folks. |
|
|||
![]()
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! |
|
|||
![]()
cajunman4life,
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 this info. Boot into Single-user mode Reboot your machine: # reboot 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 this message: Enter full pathname of shell or RETURN for /bin/sh: Now check what filesystems are mounted: # mount /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. Filesystem repairs 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 would type # 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.
__________________
FreeBSD 13-STABLE |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Check this out (funny contest). | fbsduser | Off-Topic | 6 | 4th March 2009 10:48 PM |
please check my pf.conf | gosha | OpenBSD Security | 10 | 30th January 2009 12:32 AM |
Disk geometry for Seagate disk | phreud | FreeBSD Installation and Upgrading | 5 | 8th November 2008 10:51 PM |
check for badblocks | ccc | FreeBSD General | 5 | 30th October 2008 07:00 PM |
how to check package dependencies? | bsdnewbie999 | OpenBSD Packages and Ports | 5 | 31st July 2008 04:05 AM |