How to disable barriers?

6,093

Solution 1

This is an issue with LVM in kernels prior to 2.6.33, where barrier support was completely implemented (the implementation in 2.6.32 was incomplete).

The error message is harmless and can be ignored (presuming your underlying disk array has battery backup or similar write cache protection).

You can also put the nobarrier option in /etc/fstab for this filesystem, which will suppress the message.

Solution 2

I have tried loading the kernel with "mount -o barrier=off"

You've tried whaat?

— barrier's options should be given in /etc/fstab

Solution 3

Mount with the nobarrier option in your fstab instead of defaults.

Share:
6,093

Related videos on Youtube

Gaia
Author by

Gaia

SOreadytohelp

Updated on September 18, 2022

Comments

  • Gaia
    Gaia over 1 year

    It seems impossible to disable barriers. I have tried loading the kernel with "mount -o barrier=off", "mount -o barrier=0", "barrier=off" and "barrier=0". The kernel is Atomic Secure Linux 2.6.32 with CentOS 6.2 (now 6.3). Anywhere from 20 min to 4 hr after reboot I get an "kernel: JBD: barrier-based sync failed on vda1-8 - disabling barriers" in /var/log/messages.

    >cat /etc/fstab
    /dev/mapper/vg_centos62-lv_root  /  ext4  grpquota,usrquota,rw  0  1
    UUID=bb756d7c-5946-4608-bec5-08411daa875e /boot                   ext4    defaults        1 2
    /dev/mapper/vg_centos62-lv_swap swap                    swap    defaults        0 0
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
    
    >cat /etc/mtab
    /dev/mapper/vg_centos62-lv_root / ext4 rw,grpquota,usrquota 0 0
    proc /proc proc rw 0 0
    sysfs /sys sysfs rw 0 0
    devpts /dev/pts devpts rw,gid=5,mode=620 0 0
    tmpfs /dev/shm tmpfs rw 0 0
    /dev/vda1 /boot ext4 rw 0 0
    none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
    /tmp /tmp none rw,bind 0 0
    /var/tmp /var/tmp none rw,bind 0 0
    /home /home none rw,bind 0 0
    

    I was also told that I have a loopback mount listed in /etc/mtab for /home to itself. I dont know if this could be the cause of it or if it is bad at all. This machine is using KVM virtualization and its disks reside on the host as .img files in an LVM.

  • Gaia
    Gaia almost 12 years
    According to this article, you can specify those options in grub.conf
  • poige
    poige almost 12 years
    @Gaia, actually I don't see such an option in linux-stable/Documentation/kernel-parameters.txt. It could mean that it's been handled with custom init-scripts, but that's rather distro-dependent, meanwhile /etc/fstab isn't.
  • poige
    poige almost 12 years
    @Gaia, what's your point regarding that? Do you need your problem solved or the article advertised? )
  • Gaia
    Gaia almost 12 years
    Ok, that makes sense - this machine is running 2.6.32! I will leave barrier=off in the parameters passed to the current kernel. When the kernel is eventually upgraded to 2.6.33 I will set the same parameter in the new kernel.
  • Gaia
    Gaia almost 12 years
    Also worth noting: I was FINALLY able to get a clear idea of whether the parameter is barrier=0 OR barrier=off! The Novell doc states that =off is for use in grub.conf and =0 is for use in /etc/fstab.
  • Gaia
    Gaia almost 12 years
    I need to solve my problem and I would like to disable barriers for the entire machine, not per mounted FS, hence the link to the article. Also, placing the nobarrier option in fstab merely suppresses the message, according to @michael hampton's answer.
  • Gaia
    Gaia almost 12 years
    that's something worth looking in, but according to @Michael Hampton's answer placing the nobarrier option in fstab merely suppresses the message. i want to truly disable barriers, and I'd rather do it for the entire machine not per mounted FS. I guess I have to wait for an upgrade to 2.6.33...
  • poige
    poige almost 12 years
    @Gaia, all that you would have better said before — in your answer. Regarding "just suppression" — it's wrong, AFAIU.
  • Gaia
    Gaia almost 12 years
    Michael, does it suppress the message or does it DISABLE barriers on a <2.6.33 system?
  • Michael Hampton
    Michael Hampton almost 12 years
    The presence of the message means that barriers are already disabled (because they do not work).
  • Gaia
    Gaia almost 12 years
    rephrasing: in a <2.6.33 system, does the nobarrier option in /etc/fstab actually disable barriers OR is the system disabling it after bootup (like it is now) but simply not informing it did so?