You are not logged in.

#1 2008-01-24 21:44:17

colbert
Member
Registered: 2007-12-16
Posts: 809

Questions about fsck

Hey guys, I went through the man page for fsck and just so I don't accidentally format or whatever my partition(s), I'd like to know what the commands are to "scan" a drive and fix errors. I'd like to run it on some of my USB drives as they are not copying files properly sometimes and I think there might be bad sectors? Could someone share the proper command to do so-- I believe it's fsck -a /dev/sdX for my sata, but would like to be sure smile Much appreciated folks.

Offline

#2 2008-01-25 01:03:32

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Questions about fsck

The command is safe to use. fsck automatically choses the correct file system check tool (e2fsck, reiserfsck, etc, etc) based on the file system seen on the partition -it does nothing with formating. You can also use the 'badblocks' program for checking for badblocks on the device. I believe it is part of e2fs-tools.

Offline

#3 2008-01-25 17:18:17

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Questions about fsck

Thanks T-Dawg. I ran

fsck -a /dev/sdc1

And it told me to run fsck without -a or -p, "manually." So I did:

fsck /dev/sdc1

And got many of these:

Error reading block 43909378 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan.  Ignore error<y>? yes

Force rewrite<y>? yes

I did that many times and finally got this:

Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
/lost+found not found.  Create<y>? yes

Pass 4: Checking reference counts
Pass 5: Checking group summary information

videobackup: ***** FILE SYSTEM WAS MODIFIED *****
videobackup: 653/32014336 files (6.0% non-contiguous), 60991937/64000944 blocks

So I just want to be sure, did I do it right??

Offline

#4 2008-01-25 17:23:08

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Questions about fsck

You did it correct, it seems like there were quite some errors...

Offline

#5 2008-01-25 17:26:21

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Questions about fsck

Thanks Ramses, and yes, my external drive fell on the floor 2 days ago (thankfully in an enclosure at least), hehe.

Offline

#6 2008-01-26 18:00:19

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Questions about fsck

you may want to grab the ultimate boot cd and test that the hard drive is still good. If the fall damaged it for good, that won't be the last time you get filesystem corrections.

Last edited by T-Dawg (2008-01-26 18:00:52)

Offline

#7 2008-01-26 23:24:26

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Questions about fsck

Okay, I ran:

fsck -y /dev/sdc3

and got tons of errors and finally it ended on its own like this:

Error reading block 14548992 (Attempt to read block from filesystem resulted in short read) while reading inode and block bitmaps.  Ignore error? yes

Force rewrite? yes

Error reading block 14548993 (Attempt to read block from filesystem resulted in short read) while reading inode and block bitmaps.  Ignore error? yes

Force rewrite? yes

Error creating /lost+found directory (ext2fs_link): Ext2 inode is not a directory
e2fsck: aborted
~$

T-Dawg, I downloaded ultimate boot cd. I will reboot soon and give it a shot.

Offline

Board footer

Powered by FluxBB