Using fsck to Fix Problems

freebsd.png" align=left>I noticed I had a message that the external HDD was not properly dismounted, so I decided to run fsck to fix any errors:

orr:/var/iso$ sudo fsck -t ufs /dev/da0s1
** /dev/da0s1
** Last Mounted on /25drive
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
UNREF DIR I=7159808 OWNER=richard MODE=40755
SIZE=512 MTIME=Nov 6 09:41 2004
RECONNECT? [yn] y

NO lost+found DIRECTORY
CREATE? [yn] y

DIR I=7159808 CONNECTED. PARENT WAS I=2

UNREF DIR I=5723136 OWNER=richard MODE=40755
SIZE=512 MTIME=Nov 6 11:00 2004
RECONNECT? [yn] y

DIR I=5723136 CONNECTED. PARENT WAS I=2

** Phase 4 - Check Reference Counts
LINK COUNT DIR I=2 OWNER=richard MODE=40755
SIZE=512 MTIME=Nov 6 12:59 2004 COUNT 8 SHOULD BE 5
ADJUST? [yn] y

** Phase 5 - Check Cyl groups
FREE BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? [yn] y

SUMMARY INFORMATION BAD
SALVAGE? [yn] y

BLK(S) MISSING IN BIT MAPS
SALVAGE? [yn] y

8 files, 182839 used, 28196142 free (38 frags, 3524513 blocks, 0.0% fragmentation)

***** FILE SYSTEM MARKED CLEAN *****

***** FILE SYSTEM WAS MODIFIED *****

It is helpful to be familiar with fsck when filesystem errors appear.

Comments

Anonymous said…
Thanks Richard.

Popular posts from this blog

Zeek in Action Videos

MITRE ATT&CK Tactics Are Not Tactics

New Book! The Best of TaoSecurity Blog, Volume 4