20

I am having problems on Ubuntu 12.04 x64 "fresh" installed on ext4 partition on primary HDD. When not in use every 5 to 10 seconds HDD is active for about 10 seconds an writing no mater what application is turned on or running. I used iotop and found that jbd2 is constantly writing to the HDD. The noise of the HDD is driving me crazy, at this rate disk will not last long. On the same HDD I have Windows 7 (dual boot Grub2) and everything works OK, the disk is turned off when not in use, and the computer is silent. Everything else is working fine (just little problems with Skype and the webcam, but that is tolerable), but fear from losing disk and noise is untolerable since I have computer turned on for 10 hours a day...

I tried manually to lower the frequency of journalling, but no solution found on web helped me so far, disk is grinding at same rate.

Any solution of this problem? If not I think I will stop using Ubuntu, no HDD will last long at this rate of use and the noise from HDD is not tolerable...

4
  • 1
    Not sure with Ubuntu, but on Kubuntu Nepomuk file indexer starts after installation. Depending on the amount of files this can take a while, but once indexing is done the excessive disk IO stops.
    – jippie
    May 23, 2012 at 8:57
  • PC was running for several hours, file indexing should stop by that time. Problem is ext4 and jbd2 journaling working continously...
    – Dejan Grum
    May 23, 2012 at 11:40
  • Can you check your logfiles if something is written everytime this process goes on?
    – Nanne
    Mar 8, 2013 at 14:48
  • What is the output of free -m when disk is being used?
    – Salem
    Apr 20, 2013 at 18:41

5 Answers 5

7

This are rare cases where the Hard Drive activity is above the normal use and the user is not using it that much. It has only happened to me twice in all of my years with Ubuntu. On one time I solved the issue by doing a fsck on the disk.

For example, if your HDD is /dev/sdb1 then do the following:

sudo fsck /dev/sdb1

In that case it said that I had booted the hard drive more than 200 times without checking. I actually did not count how many times but 200 is a lot in my book.

Anyway, when started checking, at some point it started finding problems and fixing them. A lot of them actually. After that I rebooted and problem was gone.

In the second case, it was because I edited the /etc/fstab and incorrectly passed a parameter to the hdd. The solution was to remove that parameter from it.

I would also have to say that adding noatime to the hard drive lessens the amount of write operations. For example this is my HDD in the fstab file:

# / was on /dev/sda2 during installation
UUID=38673e00-ecc8-4e11-85d2-58af72999e5b /               ext4    noatime,errors=remount-ro 0       1

with the noatime parameter, the disk activity is less. Although, if using a version of the kernel 2.6.30 or greater, relatime is much better.

My suggestion for this would be:

  • Run fsck on the drive with the problem. It might detect many problems or it might not, but checking it will make sure the information is good and the hard drive has no file system problems.

  • In the Desktop run the disks utility. It shows the status of the drive and the SMART information about it. This can give you further information about it, specially if it has a hardware problem.

  • Type dmesg and look at the last lines. If there is something every 10 seconds it will show there. It can also show in cat /var/log/syslog or cat /var/log/kern.log

  • Lastly add the noatime parameter to your fstab file to save some access time writings.

2
  • 5
    There's no need to use noatime. relatime prevents unnecessary writes and it's been part of the default mount flags since kernel 2.6.30. Apr 24, 2013 at 13:24
  • @MihaiCapotă And we are back to the reason why I love hanging out in askubuntu. Thanks for the info Mihai. Apr 24, 2013 at 15:43
6
+100
  1. If you are seeing a lot of activity when nothing much is running, check if any of the logs are getting a lot of updates. See if any of the files grow when you run this ...

    ls -lS /var/log/*log | head
    
  2. You can reduce spindowns, if your hard disc supports SMART, with

    hdparm -B 255 /dev/sdX
    

    where sdX needs to be changed to a valid partition.

  3. Check your fstab for noatime.

  4. From the last link below someone claims he solved it with a forced check of the partition.

    touch /forcecheck
    

    and a reboot will confirm if this is the case for you.


Also have a look at this topic:

ext4 jbd2 journaling active even on empty filesystem


This is more than likely a kernel problem (and not specifically related to Ubuntu). In 2010 both Ubuntu and Arch users had the same problem. It might be worth it posting it as a bug on launchpad against the kernel you are using.

3
  • hdparm -B uses the old APM command and is unrelated to SMART
    – psusi
    Sep 11, 2013 at 22:42
  • Is there any drawbacks of reducing spin-down? I'm not sure what the effects are. Could you tell me what the term is about concisely?
    – Wolverine
    Jan 19, 2015 at 11:01
  • Less spindows meass less electrical usage and less heat so it icreases the lifespan of a disk. But harddisks tend to die more during a restart of the disk (due to the increased mechanical activity I assume). So it is a trade off. Most of the discussions on the web is conjecture though; nobody has rock solid evidence.
    – Rinzwind
    Jan 19, 2015 at 13:07
0

I had this issue with a Lenovo/Thinkpad and I tried everything but in the end I found it was a Toshiba drive. The Toshiba drives have a problem with the park option and it goes haywire and continiously tries to park the drive and that is the noise you are hearing.

http://disablehddapm.blogspot.com.au/2011/12/disabling-hard-disk-drive-advanced.html

The solution is to disable the power management, although that will decrease battery life. This worked for my drive but as you haven't told us what drive you have this solution might not work and needs a different parameter set.

-1

1) try surface tests. may be there are bad blocks/sectors somewhere.

2) try another version of ubuntu (xubuntu, lubuntu)

3) try to uninstall unused applications... may some of them are doing bad?

-2

Add on /etc/fstab file, the following string at the end of mount options for your filesystems on HDD:

,commit=600

For example:

UUID=cc614fb7-fbdc-4b6d-af3c-a3fda4f699a0 /   ext4    defaults,commit=600    0       2

reboot and enjoy

man mount says:

commit=nrsec     Sync all data and metadata every nrsec seconds. The default value is 5 seconds. Zero means default.

3
  • Seems like a good hint, but it would be useful to know what this does ...
    – piedro
    Aug 19, 2012 at 3:45
  • 3
    So, with this setting, is the user potentially going to lose the last 10 minutes of work instead of the last 5 seconds in case of a power failure or a forced reboot, even if the user clicked Save button in, say, a text editor they were worked in?
    – Sergey
    Sep 17, 2012 at 0:15
  • I would advice against this for the reasons @Sergey offers. Apart from that, this is more damage control then it is fixing a problem?
    – Nanne
    Mar 8, 2013 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .