Author Topic: Some questions about fsck  (Read 567 times)

Offline agmg

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1916
  • Certified Windows Hater
Some questions about fsck
« on: October 07, 2012, 05:05:49 AM »
I have a Toshiba 500GB USB2.0 external drive which started misbehaving in the last few days.
I got some corrupted files and some delays during file operations.
So I suspect bad sectors.

I'm going to use fsck -f -c -c /dev/sdc5 (read-write) or fsck -f -c /dev/sdc5 (read-only).

Should I perform a read-write check or read-only should be sufficient to mark bad blocks?
If I interrupt fsck before completion, will it add found bad blocks to inode so it will skip them next time?
Or is it advised to let it finish in one pass?

Edit: I should add that the drive contains two partitions: the first one is NTFS (50GB) for sharing files with Windows computers and has been checked with chkdsk for bad sectors (it's clean). The second one is formatted with ext4 and I used it for backing up my files. The drive is currently empty and fresh formatted.

Code: [Select]
Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7ff5863c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *          63   102398309    51199123+   7  HPFS/NTFS
/dev/sdc2       102398310   976768064   437184877+   5  Extended
/dev/sdc5       102398373   976768064   437184846   83  Linux
« Last Edit: October 07, 2012, 05:36:01 AM by agmg »
For the whole world, you are someone.
For someone, you are the whole world.

Online Yankee

  • Hero Member
  • *****
  • Posts: 1489
  • In theory, theory=practice, in practice ???
Re: Some questions about fsck
« Reply #1 on: October 08, 2012, 03:04:50 PM »
The second one is formatted with ext4 and I used it for backing up my files. The drive is currently empty and fresh formatted.

It has to be unmounted and looks like this in the terminal:

[root@local user]# e2fsck /dev/sda6
e2fsck 1.42 (29-Nov-2011)
LINUX-DATA-2: clean, 11/3301376 files, 253241/13183332 blocks

If not "clean" it will clean and fix it.    Bad blocks would be the -c -f option
afterwords.   Those run automatically every 100 days or so  BTW.

regards,

FF
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE