Page 1 of 18 12311 ... LastLast
Results 1 to 10 of 172

Thread: HOWTO: Tweak your ext3 filesystem for a performance boost

  1. #1
    Join Date
    Apr 2005
    Location
    Stockholm, Sweden
    Beans
    331
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    HOWTO: Tweak your ext3 filesystem for a performance boost

    I'm using an old 900MHz Toshiba Laptop and these below changes changed my system quite noticable. You should feel an increase in video, image or audio usage.

    Linux has several choices of filesystems. Two quite known filesystems are ext3 and ReiserFS. This following howto works for both those two filesystems.

    The ext3 filesystem provides more journaling which makes it "safer" and recovery of files in case of a crash is more likely. This has its price in performance thou. ReiserFS is a faster filesystem but with less safety. The default for ubuntu systems is ext3.

    Ext3 & ReiserFS has three kinds of journaling methods:
    1) Journal Data Writeback
    2) Journal Data Ordered
    3) Journal Data

    I don't want to explain them to much here but the difference of the three is when the actual data is written to the filesystem in relation to the metadata and its entrance into the journal.

    By default the the 2nd method is used.

    To speed things up we will make it use method 1. The price to pay is that it may allow old data to appear in files after a crash and journal recovery. That is the last things you wrote or did prior a crash isn't recovered. (I can live with that, since I the most recent things I often have in my head and can reproduce)


    How to make ext3 or reiserfs use journal data writeback

    Code:
    sudo kate /etc/fstab
    Add the thing marked in bold to your fstab root mount line.
    Code:
    /dev/hda1 / ext3 defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid,nouser,data=writeback 0 1
    Save that file and change the following file
    Code:
    sudo kate /boot/grub/menu.lst
    Change the following two lines by adding the following marked in bold
    Code:
    # defoptions=quiet splash rootflags=data=writeback
    # altoptions=(recovery mode) single rootflags=data=writeback
    Now run
    Code:
    sudo update-grub
    and the added flags will automatically be added to the kernel line and stay there in case of kernel update(thank you reet for this method)

    (There have been reports of problems when rebooting if the following is not done) Note! tune2fs only works for ext3. Reiserfs can't change the journal method on the fly.
    Before rebooting change the filesystem manually to writeback.
    Code:
     sudo tune2fs -o journal_data_writeback /dev/hda1
    Check that it is running
    Code:
     sudo tune2fs -l /dev/hda1
    That's it. However I have one more thing I would recommend changing.


    Remove update of access time for files

    Having the modified time change I can understand but having the system updating the access time every time a file is accessed is not to my liking. According to the manual the only thing that might happen if you turn this off is that when compiling certain things the make might need that info. (I haven't seen a compilation that needs it yet and if I somehow come across it I will change this back or look into that then, but it is such a rare case)

    To change this do the following:
    Code:
     sudo kate /etc/fstab
    add the following marked in bold(not that you might have the switch that enables it)
    Code:
    /dev/hda1 / ext3 defaults,errors=remount-ro,noatime,auto,rw,dev,exec,suid,nouser,data=writeback 0 1
    Now reboot and enjoy a much faster system
    Last edited by GoldBuggie; August 9th, 2006 at 08:34 AM.

  2. #2
    Join Date
    Dec 2005
    Beans
    49

    Re: HOWTO: Tweal your ext3 filesystem for a performance boost

    Cool howto, but I use reiserfs.

    I wonder if there is anyway to speed up reiserfs?
    When things are bad, ask yourself what Gandalf would do.
    But when things get just right plain weird, then you need to ask: What would Skooby Dooby do?

  3. #3
    Join Date
    Sep 2005
    Location
    Canada
    Beans
    86
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Tweal your ext3 filesystem for a performance boost

    You can apply the noatime option to your reiserfs partitions in fstab.

  4. #4
    Join Date
    Apr 2005
    Location
    Stockholm, Sweden
    Beans
    331
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Tweal your ext3 filesystem for a performance boost

    Well...I didn't want to mention to much about reiserfs since I haven't tried anything on it yet. I'll install it in about 2 weeks. But according to the documentation of reiserfs kernel 2.6.X the above howto should work and make it faster as well.

    Not that I have not tried it but I would be happy to see someone try it before me and report back here. Then I'll change the howto so that it includes both popular filesystems.

  5. #5
    Join Date
    Jan 2005
    Beans
    Hidden!

    Re: HOWTO: Tweal your ext3 filesystem for a performance boost

    Looks cool. Ill use this on non-system (storage) drives.

  6. #6
    Join Date
    Apr 2005
    Location
    Stockholm, Sweden
    Beans
    331
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Tweal your ext3 filesystem for a performance boost

    Looks cool. Ill use this on non-system (storage) drives.
    Enjoy the ride!

  7. #7
    Join Date
    Dec 2005
    Beans
    49

    Re: HOWTO: Tweal your ext3 filesystem for a performance boost

    Quote Originally Posted by reet
    You can apply the noatime option to your reiserfs partitions in fstab.
    Looked it up, yeah shouldn't cause any trouble and perhaps increase
    performance.
    When things are bad, ask yourself what Gandalf would do.
    But when things get just right plain weird, then you need to ask: What would Skooby Dooby do?

  8. #8
    Join Date
    Oct 2005
    Location
    Fribourg,Switzerland
    Beans
    1,749

    Re: HOWTO: Tweal your ext3 filesystem for a performance boost

    Thanks a lot, GoldBuggie...amazing difference on my system!
    Happy New Year.

  9. #9
    Join Date
    Oct 2005
    Location
    Helsinki, Finland
    Beans
    1,351

    Re: HOWTO: Tweal your ext3 filesystem for a performance boost

    Whoa, I knew I had damn small linux on a usb-stick for a reason.

    System no more booted and gave errors "read only filesystem". Got it back running by undoing the changes but I couldn't find any typos or anything in either fstab or in menu.lst. Unless the fstab line for the filesystem needs more options than these?
    /dev/hda3 / ext3 defaults,errors=remount-ro,noatime,data=writeback 0 1
    Last edited by kaamos; December 28th, 2005 at 01:09 PM.

  10. #10
    Join Date
    Nov 2004
    Location
    Melbourne
    Beans
    631
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Tweal your ext3 filesystem for a performance boost

    I had the same problem.

    Another way to rescue is to reboot into recovery mode, when it gets you to the CLI type:

    mount -o remount,rw /dev/hdXX /

    hdXX being your hard drive partition. This will allow you to edit the fstab and menu.lst to undo the chnages.

    Now if I could just work out what's going wrong, time for bed me thinks...leave it until tomorrow.

Page 1 of 18 12311 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •