Measure HDD speed with dd

A few months ago I left you an article on how to measure the speed of the HDD with hdparmWell, this time I'll show you how to do the same with: dd

wd-scorpio-black

Measure HDD read and write speed with dd

A single command is enough to know this, the command is as follows:

dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync

Basically what it will do is create and write randoms data to a file (called test), the final weight will be 1024MB, that is, 1GB, and what it will tell us (and what really matters to us) will be the speed with which it fills those 1024MB and the time it took.

Here is a screenshot of a terminal after executing the command:

dd-hdd-speed

As you can see, it took 9 seconds to fill that GB, which means that the speed was 119 MB / s ... not bad 😉

How do I know if my HDD is slow?

To know if your hard drive is slow you just have to know that basically any speed greater than 50 MB / s is acceptable (I repeat, acceptable, not super fast). In case your hard drive does not measure up or you want a faster one or SSD, I recommend that you look in specialized stores where they will advise you when it comes to buy hard drives and asking, they will recommend the hard drive that you really need based on your budget or needs. In my case my desktop PC with a normal HDD gave me 70 MB / s. Of course, if it is an SSD or a RAID and the "acceptable" speed is not the same ????
If you need a hard drive for a server it will always be better to use an SSD, unless it is clear that the server needs a lot of storage capacity so either you have a slower HDD with a lot of capacity or you make an investment buying SSD hard drives and creating a raid.

The end!

Basically this is it, I hope it has been useful to you.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   oscar said

    Very interesting!
    thanks!

    1.    KZKG ^ Gaara said

      Thanks to you for reading us 🙂

  2.   Sli said

    16384 + 0 records read
    16384 + 0 records written
    1073741824 bytes (1,1 GB) copied, 30,227 s, 35,5 MB / s

    I have a problem, this happens to me for using a laptop from years ago with disk at 5200rpm and sata 2

    1.    KZKG ^ Gaara said

      Friend, that HDD seems to be in its last days ... old man old man 🙁

      1.    Paco said

        Well, my laptop is one year old, it came out very cheap for all the features but it reads me at 51MB / s.

        Does that mean they ripped me off?

  3.   Slo said

    Good article KZKG ^ Gaara, what happens when the HDD has more than 80% errors ?, that cannot be repaired with any method, is it the end of the HDD?, With modern technology, it will be possible to get a HDD in IDE of 250 GB or at least 100 GB and how much more or less would the price be?

    1.    KZKG ^ Gaara said

      Thanks ^ _ ^

      250GB IDE HDDs do exist and are for sale, check here: http://www.ebay.com/bhp/250gb-ide-hard-drive

      Another very different thing would be to be able to buy on eBay, have delivery in your country, etc.

      About the other thing you ask me ... I like to say that in computing there is nothing impossible, there are only things that we still do not know how to do. If an HDD has 80% errors, even when you repair them using something like HirensBootCD or similar, in the end that HDD will end up giving you more headaches than problems solved ... you could even use some special data recovery or sector repair equipment (or something like that), and that the HDD is better ... but friend, even doing that, at least I would not put my information at risk on an HDD that had so many problems 😉

      1.    Slo said

        Thanks for the answer KZKG ^ Gaara, Can you trust eBay ?, a "fictitious" page that is not accented under the laws of each country and its parent company is in Luxembourg where some users complain that they have been scammed by scammers.

      2.    KZKG ^ Gaara said

        Ehm, it depends 😀

        eBay is a large international market, the trick to avoid bad experiences is to buy items from sellers who have a really high% satisfaction (more than 95%), and a BIG number of sales. So if you buy from a guy who for example has 98% satisfaction from 50.000 deals done, man, it's highly unlikely that you will have a bad experience with him.

      3.    Slo said

        Hello KZKG ^ Gaara,

        You have left me confused with this!,… .First you say is to buy from those who have a really great degree of satisfaction of more than 95% and a large number in sales, then you tell me that if I buy from the one who has 98% satisfaction from 50.000 deals made, it is highly unlikely, what do you mean by this?

        What has been seen to the same seller with different types of stars,… what happens if the score is fixed in the stars? For example: 5 green stars (99%) positive, 3 yellow stars (10%) neutral, 5 stars red (5%) negative.

        Does the 3 or 5 negatives mean highly unlikely?

        1.    KZKG ^ Gaara said

          Yes, if you buy an item from someone who out of 50.000 sales has a 98% satisfaction rate, it is highly unlikely that you will have a bad experience, that is, it is really difficult to be ripped off 🙂

          For example look this itemIf you look at the right it appears that the seller has an acceptance% of 99,4% of a total of 9362 sales, in fact ... if you click on his name / nick, you will see in more detail his positive and negative votes, neutrals, etc.

      4.    Slo said

        Very good information KZKG ^ Gaara, in that link that you have put the items, although that seller has the Items of 32 negative and 32 neutral, it is seen that he has 99.4% of (9375) positive sales, which means … That seller is not 100% reliable?

        To another question, to be able to buy on eBay, do you necessarily have to register on that page ?, and thus be able to place the order either directly from (eBay) or directly with the seller ?, I imagine there must be a tax for the use of eBay? How long does it take to get the order? For example: I need a HDD in IDE, preferably 250 GB, or at least (120 or 100 GB). I also wanted a processor in Intel (R) Pentium (R) M 780.

        Features of the previous HDD in IDE:

        Model: ATA SAMSUNG HM100JC
        Version of the Firmware: YN100-80
        Capacity: 100 GB

        Processor Features:

        Model: Intel® Pentium® M Processor 780
        Processor Number: 780
        Speed: 533 MHz
        Processor Base Frequency: 2.26 GHz
        Sockets Supported: H-PBGA479, PPGA478
        processor pins: PGA- 478

  4.   Sli said

    I have been testing com porteus that by not loading on the disk only in the usb and at 40MB / s, it is what sata 1 has to be, in the end to make the fool of it I have loaded the porteus 100% in the ram and instead from testing on a partition I have tested on the personal folder, the result is powerful:

    1073741824 bytes (1.1 GB) copied, 1.33319 s, 805 MB / s

  5.   jecale47 said

    Acceptable.

    16384 + 0 records read
    16384 + 0 records written
    1073741824 bytes (1,1 GB) copied, 10,3208 s, 104 MB / s

  6.   Krlos kmarillo said

    16384 + 0 records read
    16384 + 0 records written
    1073741824 bytes (1.1 GB) copied, 28.9431 s, 37.1 MB / s

    I think it's time to buy another hard drive.

  7.   Vicente said

    Hi, I guess this can be done to measure the speed of June to SD or microSD card or not? Should I change the address that accompanies the if to the one on the card or not?
    Thank you

    1.    KZKG ^ Gaara said

      Ehm I don't think so, if you change the if to for example, / dev / mmc2… then what you would do is copy 1GB from the card to a file, and it would give you the speed.

      The problem with doing this is that if I am not mistaken, in the end what you would measure would be reading the card (because you would write with the of on the HDD), and also data would pass through the HDD anyway ... that is, it would not be a test (I think) 100% valid

  8.   Teck said

    Result with Manjaro Kernel 4.1 and SSD

    16384 + 0 records read
    16384 + 0 records written
    1073741824 bytes (1,1 GB) copied, 6,33915 s, 169 MB / s

  9.   HO2Gi said

    Great article KZKG ^ Gaara, do you know if there is a way to know if "gnu / linux" or "linux" (so there is no discord XD) handles the use of ram better, and if there are some better tricks.
    Greetings.

    16384 + 0 records read
    16384 + 0 records written
    1073741824 bytes (1,1 GB) copied, 6,89022 s, 156 MB / s

    1.    KZKG ^ Gaara said

      I'm just looking for good options to do RAM tests desde Linux (I'm lazy writing haha), when I find what I'm looking for don't worry, I'll share it here 😉

    1.    KZKG ^ Gaara said

      Normal thing ... in Taringa they copy everything we put here, I think there is not a single user with originality there ... ¬_¬

  10.   jamin samuel said

    16384 + 0 records read
    16384 + 0 records written
    1073741824 bytes (1,1 GB) copied, 16,9916 s, 63,2 MB / s

    Use XFS file system
    😉

  11.   payuta said

    [payuta @ Manjaro-HP ~] $ dd if = / dev / zero of = test bs = 64k count = 16k conv = fdatasync
    16384 + 0 records read
    16384 + 0 records written
    1073741824 bytes (1,1 GB) copied, 3,57703 s, 300 MB / s
    [payuta @ Manjaro-HP ~] $
    This is my data from the SSD !!!!
    Thx for the tip

    1.    KZKG ^ Gaara said

      A pleasure 🙂

  12.   sandro said

    I would add or point out that in the case of (mechanical) hard drives it is not the same to generate this "test" file in a partition that has its cylinders on the "outer" side (more travel at the same angular speed [rpm] -> more linear speed ~ more MB / s) of the disk than in another that has them in the internal part of it. For example on a laptop with a 5400rpm drive:
    1st NTFS Partition for Windoze:
    1073741824 bytes (1,1 GB) copied, 22,8917 s, 46,9 MB / s
    2nd NTFS Partition for Windoze-GNU / Linux:
    1073741824 bytes (1,1 GB) copied, 28,6148 s, 37,5 MB / s
    4th Partition EXT4 for GNU / Linux Main:
    1073741824 bytes (1,1 GB) copied, 42,1906 s, 25,4 MB / s
    The disk is connected in sata1 mode (1.5 Gb / s):
    / dev / sda:
    Timing cached reads: 3080 MB in 2.00 seconds = 1541.28 MB / sec
    Timing buffered disk reads: 170 MB in 3.03 seconds = 56.04 MB / sec
    And on the other hand, an external usb3 disk connected via usb2 (480Mb / s -> 60MB / s ~ 30MB / s fd):
    1073741824 bytes (1,1 GB) copied, 37,2769 s, 28,8 MB / s cqd.
    Salu2.

  13.   test? said

    What would be the = test? Is there any residue from this test on the disk? I mean ... some file occupying 1 GB that can be deleted

    1.    KZKG ^ Gaara said

      To measure the writing speed it was necessary to create a file called test on the HDD, after completing the test you can delete it 😉

  14.   David L. said

    Nice trick, thanks!

    16384 + 0 records read
    16384 + 0 records written
    1073741824 bytes (1,1 GB) copied, 2,37306 s, 452 MB / s

  15.   novel said

    [root @ fedora file] # dd if = / dev / zero of = test bs = 64k count = 256k conv = fdatasync
    262144 + 0 records read
    262144 + 0 records written
    17179869184 bytes (17 GB) copied, 8,61083 s, 2,0 GB / s

  16.   cyberjames said

    Niiiceeee !!

    16384 + 0 records read
    16384 + 0 records written
    1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.4175 s, 445 MB / s

  17.   87 erives said

    Very interesting, but there you are also measuring the reading time or is it just writing ???

  18.   Garibaldis said

    Today, Oct 26, 2023, this post is very useful to diagnose the HDD disk to know how fast it writes in Linux systems.

    It should be noted that if the sata cable that connects our HDD is defective, this can also cause slowness.

    Greetings.