Some files are corrupted when copying  a lot of files

Posted on 2006-04-19
Last Modified: 2013-12-16

When copying large number of files, some source files differ from target ones, size is the same, but cmp shows that files are different. The files are really damaged,


- Hardware: Celeron 400, 396 MB RAM, 512 MB swap two ATA disks, Fedora Core 4, kernel 2.6.16-1.

- Test example: 148 MB in 138 JPG files
Some files copies will be corrupted. I can re-copy them one by one without problems. I can copy a group of some 20-30 files without problems.

- problem appears even when copying within the same disk and the same partition

- problem appears with different file managers and shell

- problem appears for both vfat and ext3 partitions

- when booted the same computer with Windows XP, I can copy files on vfat patrtitions without any problems.

- no errors in /var/log/messages

- mounts look like

/dev/hda1 on / type ext3 (rw)
/dev/hdc2 on /mntpoint type vfat (rw,noexec,nosuid,nodev,uid=500,gid=500)

Many thanks in advance for your help!!!

dmesg |grep hd
    ide0: BM-DMA at 0xd000-0xd007, BIOS settings: hda:pio, hdb:pio
    ide1: BM-DMA at 0xd008-0xd00f, BIOS settings: hdc:pio, hdd:pio
hda: SAMSUNG SP4002H, ATA DISK drive
hdb: CD-540E, ATAPI CD/DVD-ROM drive
hdc: Maxtor 6E040L0, ATA DISK drive
hda: max request size: 128KiB
hda: 78242976 sectors (40060 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(33)
hda: cache flushes supported
 hda: hda1 hda2 hda3 hda4 < hda5 >
hdc: max request size: 128KiB
hdc: 80293248 sectors (41110 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(33)
hdc: cache flushes supported
 hdc: hdc1 hdc2 hdc3
hdb: ATAPI 40X CD-ROM drive, 128kB Cache, UDMA(33)
hdd: ATAPI 63X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache, UDMA(33)
SELinux: initialized (dev hda1, type ext3), uses xattr
EXT3 FS on hda1, internal journal
SELinux: initialized (dev hda3, type vfat), uses genfs_contexts
SELinux: initialized (dev hdc2, type vfat), uses genfs_contexts
SELinux: initialized (dev hdc3, type vfat), uses genfs_contexts
SELinux: initialized (dev hda5, type vfat), uses genfs_contexts
Adding 522104k swap on /dev/hda2.  Priority:-1 extents:1 across:522104k
SELinux: initialized (dev hdd, type udf), uses genfs_contexts
Question by:dub082097
    LVL 15

    Expert Comment

    Assuming that you copy TO FAT partition, try adding "sync" and "dirsync" to mount options for /dev/hdc2.
    LVL 15

    Expert Comment

    does the problem appear both when you copy from hda to hda  and when you copy from hdc to hdc?

    did you try booting with ide=nodma kernel option and see if the problem persists?
    LVL 15

    Accepted Solution

    Actually, the more I think about it the more it looks like hardware problem - I'd check memory, CMOS IDE/UDMA settings, IDE controller and IDE wires going to disks, in that order. Also, check the current settings using hdparm and see if setting the drives to lower udma level takes care of it.
    LVL 8

    Expert Comment

    I agree with the hardware problem diagnosis.  You could start testing with memtest86.

    Author Comment

    Thanks a lot for you feedback, it may take some days to check everything since this is my home PC, I'll come back.

    Author Comment

    I run memtest86 and found several errors within one DIMM. Probably, I should remove it and then check again.

    I also found that some options in BIOS are disabled, I'll try enabling them, especially the first one...

    Memory Parity ECC Check
    IDE prefetch Mode
    IDE HDD Block Mode
    UDMA for all IDE devices
    LVL 8

    Expert Comment

    You would only want to enable the 1st one if you do in fact have memory with parity.  (Unless it's a server setup, it's unlikely.)

    Author Comment


     Many thanks to slow1000 for memtest86. I found that one DIMM makes some errors and replaced it. However, the problem did not disappear until resetting BIOS to default values. Thanks to m1tk4 for the solution.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
    I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now