Files getting corrupted

$ uname -a
Linux darksun 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:45 UTC 2014 i686 athlon i686 GNU/Linux

My files are getting corrupted on a frequent basis.

$ sudo fdisk -l /dev/sda

Disk /dev/sda: 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 / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0002377b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   969215997   484606975   83  Linux
/dev/sda2       969215998   976771071     3777537    5  Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5       969216000   976771071     3777536   82  Linux swap / Solaris

At first I thought the HD was the culprit, but then, it's "only" about 4 years old.

Is there a possibility that other devices, as the RAM, are corrupting my data? Or can I be sure that buying a new HD will solve the issue?

Please post the dmesg output. Do you see any IO errors there ?.

1 Like

Shouldn't you be using fdisk -l /dev/sda , seeing as /dev/sda1 is itself a partion ?

1 Like

The dmesg output is huge, how can I grep only the necessary?

---------- Post updated at 01:55 PM ---------- Previous update was at 01:54 PM ----------

You are right, edited the post to reflect it correctly.

To start with

dmesg | grep -I error

@linuxmanju I presume you meant to write

dmesg | grep -i error
1 Like

Yes, thanks.

Here are some of the dmesg errors:

BMDMA stat 0x24o services enabled
failed command: READ DMA
status { DRDY ERR.0 }
I/O error, dev sda, sector 404664
failed command: READ DMA

Bid fare well to hard disk and get a new one.

Is it possible that other parts of the system are contributing to corrupt the HD? My fear is that I buy a new HD and it gets corrupted too after a while.

Most likely culprits are HDD or connectors IMHO. If its some critical server I would try replacing both.

1 Like