Ubuntu slows terribly on disk access

5,506

There are a lot of things that can impact disk performance. Some older versions of Ubuntu have a known bug related to partition alignment, which can dramatically slow disks with 4k sectors. If that is your problem, you may need to re-align your partition with a rescue disk.

You might also consider running some timing tests, just to see what your throughput really is. For example:

$ sudo hdparm -Tt /dev/sda1

/dev/sda1:
 Timing cached reads:   15940 MB in  2.00 seconds = 7976.89 MB/sec
 Timing buffered disk reads: 324 MB in  3.01 seconds = 107.55 MB/sec

Lastly, check the hardware compatibility wiki to ensure that your motherboard and hard drive are fully supported. For example, my system can't reliably use the built-in USB 3.0 port on my motherboard; bad things happen if I try. If your motherboard or hard drive have unsupported chipsets or flaky hardware, or if dmesg reports disk-related problems, then you at least have a place to start.

Share:
5,506

Related videos on Youtube

new123456
Author by

new123456

I enjoy writing small utilities for various things I do regularly on my Linux boxes - I've cleaned up some of them and placed them as Gists for use. I also have written some small pieces of software - a minimal Xlib window manager as well as a system for managing compiled applications. Check out my GitHub IO Page for a more up-to-date summary of what I've been doing lately.

Updated on September 18, 2022

Comments

  • new123456
    new123456 over 1 year

    I'm very new to Linux systems but not computer systems. I installed Ubuntu on my laptop and it took a little longer to load then I'd like but seemed okay. The problem showed itself more seriously when I untared an eclipse package that was a tiny 120MB. it took a very long time and lagged the entire system till it was done. I realize now that disk access is what slows the system to a crawl. My laptop has 2gb of ram and all I was doing was surfing one website and untaring one file so I believe this is NOT a swapping issue. I'm wondering if it's using the hard drive in some sort of unbuffered mode or something like this. I could use any advice/tips here.

    Also one more thing, im not sure how the system is configured. I installed using Wubi and I am dual booting. I've never installed an OS like this, it appears it did not add an extra partition. When I explore /dev/disk/by-id I see about 5 files that have the hard drive name on them. I'm assuming it's running the file system off these 5 files on the main partition? Idk if this could be causing the speed issue, like an extra emulation step by using the Windows partition or something like this. I'm just kinda talking out loud and telling you guys all I know (or think I know) about the situation.

    I'd really love the help, I want to experiment with Linux but I want a decent experience on my laptop. I run this on VMware on my desktop and it's so much faster.

    • David Schwartz
      David Schwartz almost 12 years
      It sounds like you're emulating a partition with a file in the Windows volume. That's fine for messing around, but if you want performance, you want a dedicated partition for Linux.
    • new123456
      new123456 almost 12 years
      I second @DavidSchwartz. Take some time to add a small (20GB will do) partition to the end of your HDD and install something on it (just try not to interrupt the partition resize - I did this on my laptop and buried its Win7 partition. Not that I regret it ;).