0

I bought a Seagate Expansion 5TB external hard drive and I started cloning the git repositories I contributed to.

There is a big git repository (~16GB, 1GB is just the .git directory): after cloning it on my hard drive the HDD started to be really slow. First I thought it is just a formatting issue.

Thanks to warranty services I got a new HDD, exactly the same model.

Now I repeat the whole process and everything was running smoothly (~300MB/sec). Then I cloned this big repository and now all my data on my HDD is potentially lost. I started to copy it from it to my computer but it's very slow (~18kB/sec):

I made sure to take care of the HDD to not break it, but it looks like this repository has the potential to corrupt it.

I'm wondering if it's a hardware issue or not. The guys from warranty service didn't tell me anything about what the problem was. They just sent me a new HDD.

I'm running Ubuntu 15.10. Here the HDD is working, but it's very slow. On Windows machines it doesn't work at all. The whole file explorer crashes.

How can I solve the issue? Can a git repository corrupt such an HDD?

Why is it so slow only after cloning this specific repository? I did copy lots of GBs of data before and it was fast.

14
  • Writing data to a HDD does not corrupt it. I routinely copy 16GB and 1GB files between HDDs over USB.
    – Ramhound
    Feb 28, 2016 at 10:28
  • @Ramhound But why is it so slow now? It was fast before cloning the repository and now it's slow. Feb 28, 2016 at 10:29
  • I have no idea. You didn't ask if why it was slow. I can only indicate that there is no technical reason for your HDD to become "corrupt" by transferring files to it. HDDs are designed to be written to.
    – Ramhound
    Feb 28, 2016 at 10:30
  • @Ramhound OK, I added that to my post. Feb 28, 2016 at 10:32
  • 1
    @ek.bic Then right click to your external hard drive — That's what I'm saying: after a loooong time (10 minutes?) the hard drive appears in My Computer, but by right clicking the entire machine is freezing... Feb 28, 2016 at 17:27

1 Answer 1

1

Not knowing what operating system you have makes this a bit of a guessing game, but in certain cases and filesystems there is a possibility of a read from the drive causing a simultaneous write to the drive while the system updates the "accessed" time of the file.

If the drive has 4k sectors and your filesystem is using 512-byte sectors then there is a performance hit whenever a small write is done to the other 7 512-byte blocks in that "real" sector. Essentially every time any of those 8 logical (filesystem) sectors has to be changed the drive must first read the entire 4kb block, modify it, and then write it back.

Combine this with the last accessed time and you could end up with a lot of time modifying blocks with pointless accounting data rather than actually reading or writing data.

In Linux you can disable this last accessed time by specifying the noatime mount option when mounting the disk.

Example fstab:

/dev/sda7          /chroot          ext2          defaults,noatime          1  2

From http://tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap6sec73.html

6
  • I did mention in my post that I'm running Ubuntu 15.10. Here the HDD is working, but it's very slow. On Windows machines it doesn't work at all. The whole file explorer crashes. Feb 28, 2016 at 11:25
  • I added ` UUID=DE3AEFD13AEFA4AD none ntfs defaults,noatime 0 0` to my /etc/fstab. I mounted it but noatime does not appear in cat /proc/mounts output... Should I specify it using -o defaults,noatime? Feb 28, 2016 at 11:37
  • By running sudo mount /dev/sdb2 /media/$USER/HDD/ -o defaults,noatime it did increase the performance to 30-70 MB/sec which is not bad. Is there anything I can do to make the performance even better? Before it was like 300MB/sec. Anyways, thanks a lot! Feb 28, 2016 at 11:48
  • @IonicăBizău apologies, I missed that line in your question. Specifying -o defaults,noatime should work. As it stands though my answer is only really a guess at what could cause a problem. It's possible that there's a bug in the Linux NTFS module.
    – Mokubai
    Feb 28, 2016 at 11:48
  • @IonicăBizău Your drive is USB3 and as long as you've plugged it into a USB3 port I can't say for certain why it would be that speed. Large (GB sized) files should transfer at the full speed of the drive, but small files will generally transfer slower.
    – Mokubai
    Feb 28, 2016 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.