Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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...

share|improve this question
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 '12 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 '12 at 11:40
    
Can you check your logfiles if something is written everytime this process goes on? –  Nanne Mar 8 '13 at 14:48
    
What is the output of free -m when disk is being used? –  Salem Apr 20 '13 at 18:41

5 Answers 5

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.

share|improve this answer
2  
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. –  Mihai Capotă Apr 24 '13 at 13:24
    
@MihaiCapotă And we are back to the reason why I love hanging out in askubuntu. Thanks for the info Mihai. –  Luis Alvarado Apr 24 '13 at 15:43
  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.

share|improve this answer
    
hdparm -B uses the old APM command and is unrelated to SMART –  psusi Sep 11 '13 at 22:42

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?

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer
    
Seems like a good hint, but it would be useful to know what this does ... –  piedro Aug 19 '12 at 3:45
1  
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 '12 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 '13 at 14:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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