Hi,
I'm using CentOS 5 on all my computers here (work + home) and I'm very satisfied with it.
Some time ago I purchased a 300 GB external hard drive to store films, music, pictures and documents. Since there's no Windows machine around here (small South French village, town hall and public library use Linux :o)), I replaced the FAT filesystem on the disk by an ext2 filesystem. Now it's already almost full with data.
A few days ago I had a problem with the subdirectory Cinema/ containing a collection of my favourite movies. I wanted to copy them from the disk to my newly purchased laptop (ASUS W6F, already running CentOS 5), when suddenly I got a read error on data. I checked in a Terminal what was going on, and the file ownerships were all curiously set, like missing read flags, no more --x rights on directories, whereas I remember I had set them right in the first place. So I started a series of recursive chmod's on the directory Cinema/... but I got nothing: the command prompt never went back. Unmounting the disk was not responsive neither, so I just shut it off.
When I was performing this, it was a very hot day, almost 40°C. The disk was really very hot, so I wonder if this might have damaged it.
I could retrieve some of the data on the disk (music, pictures, documents), but now, instead of the Cinema/ directory, I have one big file that looks like this: [kikinovak@buzz:/media/disk/Films] $ ls -l total 692996 -rw-r----- 1 678756852 34537972 148381783526817280 avr 28 01:01 Cinema drwxr-xr-x 3 kikinovak kikinovak 4096 mai 9 10:07 Anime drwxrwxrwx 4 kikinovak kikinovak 4096 mai 10 12:25 Series
Notice that the file size is something like petabytes :oD
Is there any way to repair this obviously corrupt data?
Cheers,
Niki Kovacs
Quoting Niki Kovacs contact@kikinovak.net: *snip*
Is there any way to repair this obviously corrupt data?
fsck.ext2 /dev/sda1
Obviously replacing sda1 with your partition and drive for your external device.
On Sat, 2007-08-04 at 07:09 +0200, Niki Kovacs wrote:
[kikinovak@buzz:/media/disk/Films] $ ls -l total 692996 -rw-r----- 1 678756852 34537972 148381783526817280 avr 28 01:01 Cinema drwxr-xr-x 3 kikinovak kikinovak 4096 mai 9 10:07 Anime drwxrwxrwx 4 kikinovak kikinovak 4096 mai 10 12:25 Series
Notice that the file size is something like petabytes :oD
Is there any way to repair this obviously corrupt data?
Looks like a broken inode (or incorrect directory entry). I'd make a backup image of the disk first (if that works without serious errors) with dd. After that, run a badblocks check, and a fsck.
-- Daniel
Daniel de Kok a écrit :
On Sat, 2007-08-04 at 07:09 +0200, Niki Kovacs wrote:
[kikinovak@buzz:/media/disk/Films] $ ls -l total 692996 -rw-r----- 1 678756852 34537972 148381783526817280 avr 28 01:01 Cinema drwxr-xr-x 3 kikinovak kikinovak 4096 mai 9 10:07 Anime drwxrwxrwx 4 kikinovak kikinovak 4096 mai 10 12:25 Series
Notice that the file size is something like petabytes :oD
Is there any way to repair this obviously corrupt data?
Looks like a broken inode (or incorrect directory entry). I'd make a backup image of the disk first (if that works without serious errors) with dd. After that, run a badblocks check, and a fsck.
Argh. Looks like a complete data loss. Well, not complete. Fortunately I had most of it on another PC. I just lost all my films. (Gasp! David Lynch gone, Hitchcock gone, Cronenberg gone...)
Now I reformatted the HD with ext2, and badblocks is currently chugging away for the next few hours probably.
How do broken inodes happen? I'm a bit reluctant - for obvious reasons - to entrust data to that disk again. Can it be that overheating creates read/write errors, without actually corrupting the disk?
Cheers,
Niki
Niki Kovacs wrote:
Daniel de Kok a écrit :
On Sat, 2007-08-04 at 07:09 +0200, Niki Kovacs wrote:
[kikinovak@buzz:/media/disk/Films] $ ls -l total 692996 -rw-r----- 1 678756852 34537972 148381783526817280 avr 28 01:01 Cinema drwxr-xr-x 3 kikinovak kikinovak 4096 mai 9 10:07 Anime drwxrwxrwx 4 kikinovak kikinovak 4096 mai 10 12:25 Series
Notice that the file size is something like petabytes :oD
Is there any way to repair this obviously corrupt data?
Looks like a broken inode (or incorrect directory entry). I'd make a backup image of the disk first (if that works without serious errors) with dd. After that, run a badblocks check, and a fsck.
Argh. Looks like a complete data loss. Well, not complete. Fortunately I had most of it on another PC. I just lost all my films. (Gasp! David Lynch gone, Hitchcock gone, Cronenberg gone...)
Now I reformatted the HD with ext2, and badblocks is currently chugging away for the next few hours probably.
How do broken inodes happen? I'm a bit reluctant - for obvious reasons - to entrust data to that disk again. Can it be that overheating creates read/write errors, without actually corrupting the disk?
Normally, unplugging external drives without unmounting them is the culprit on an external USB device. Also, just powering off the drive without unmount it if it is an externally powered drive. On internally mounted drives, usually turning off the system without shutting it down, loss of a power supply and / or loss of power to a live system.
Sometimes a bad driver can cause problems for certain devices.
I would use an ext3 file system as it has a journal ... and journals can recover data from the journal.
Thanks, Johnny Hughes
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Johnny Hughes Sent: Saturday, August 04, 2007 11:21 AM To: CentOS mailing list Subject: Re: [CentOS] Data corruption on external hard disk
Niki Kovacs wrote:
Daniel de Kok a écrit :
On Sat, 2007-08-04 at 07:09 +0200, Niki Kovacs wrote:
[kikinovak@buzz:/media/disk/Films] $ ls -l total 692996 -rw-r----- 1 678756852 34537972 148381783526817280 avr
28 01:01 Cinema
drwxr-xr-x 3 kikinovak kikinovak 4096 mai
9 10:07 Anime
drwxrwxrwx 4 kikinovak kikinovak 4096 mai
10 12:25 Series
Notice that the file size is something like petabytes :oD
Is there any way to repair this obviously corrupt data?
Looks like a broken inode (or incorrect directory entry).
I'd make a
backup image of the disk first (if that works without
serious errors)
with dd. After that, run a badblocks check, and a fsck.
Argh. Looks like a complete data loss. Well, not complete.
Fortunately I
had most of it on another PC. I just lost all my films. (Gasp! David Lynch gone, Hitchcock gone, Cronenberg gone...)
Now I reformatted the HD with ext2, and badblocks is
currently chugging
away for the next few hours probably.
How do broken inodes happen? I'm a bit reluctant - for
obvious reasons -
to entrust data to that disk again. Can it be that
overheating creates
read/write errors, without actually corrupting the disk?
Normally, unplugging external drives without unmounting them is the culprit on an external USB device. Also, just powering off the drive without unmount it if it is an externally powered drive. On internally mounted drives, usually turning off the system without shutting it down, loss of a power supply and / or loss of power to a live system.
Sometimes a bad driver can cause problems for certain devices.
I would use an ext3 file system as it has a journal ... and journals can recover data from the journal.
I would mount all USB drives with the 'sync' or 'dirsync' option, if they auto-mount via Gnome or KDE then make sure which ever config file stores the default mount options for auto-mount it includes the 'sync' or 'dirsync' option for USB devices.
The 'sync' makes sure all io is done synchronously, the 'dirsync' makes sure that only directory io is done synchronously which should provide more performance than 'sync', but with less integrity assurance.
If you need the performance you can umount the auto-mount and then re-mount it manually without the 'sync' or 'dirsync' options.
Using a file-system that is less prone to corruption (simpler) can also help, that is why most USB storage devices ship with FAT, that and that FAT partitions are pretty much universally compatible.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Johnny Hughes a écrit :
Normally, unplugging external drives without unmounting them is the culprit on an external USB device. Also, just powering off the drive without unmount it if it is an externally powered drive. On internally mounted drives, usually turning off the system without shutting it down, loss of a power supply and / or loss of power to a live system.
Sometimes a bad driver can cause problems for certain devices.
I would use an ext3 file system as it has a journal ... and journals can recover data from the journal.
Well, I reformatted the drive (ext2 first) and did a 'badblock -v' on it. Looks like half of the disk is damaged, so it's clearly a hardware failure. The guy at the store told me that with the actual heat it's not a surprise.
Anyway: thanks to anybody for the detailed advice!
Cheers,
Niki Kovacs