0

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
  • 1,777
  • 4
  • 32
  • 58

3 Answers3

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

poige
  • 9,171
  • 2
  • 24
  • 50
  • According to this [article](http://www.cyberciti.biz/faq/rhel-fedora-debian-ubuntui-linuxjbd-barrier-sync-failed/), you can specify those options in grub.conf – Gaia Aug 01 '12 at 17:10
  • @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 Aug 01 '12 at 17:14
  • 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... – Gaia Aug 01 '12 at 17:29
  • @Gaia, all that you would have better said before — in your answer. Regarding "just suppression" — it's wrong, AFAIU. – poige Aug 02 '12 at 01:32
2

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.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • 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 Aug 01 '12 at 17:18
  • Also worth noting: I was FINALLY able to get a clear idea of whether the parameter is barrier=0 OR barrier=off! The [Novell](http://www.novell.com/support/kb/doc.php?id=3907838) doc states that =off is for use in grub.conf and =0 is for use in /etc/fstab. – Gaia Aug 01 '12 at 17:20
  • Michael, does it suppress the message or does it DISABLE barriers on a <2.6.33 system? – Gaia Aug 02 '12 at 19:30
  • The _presence_ of the message means that barriers are _already_ disabled (because they do not work). – Michael Hampton Aug 02 '12 at 19:32
  • 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? – Gaia Aug 02 '12 at 19:37
1

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

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • Why 'instead of'(?), options just can be appended to `defaults` – poige Aug 01 '12 at 17:11
  • According to this [article](http://www.cyberciti.biz/faq/rhel-fedora-debian-ubuntui-linuxjbd-barrier-sync-failed/), you can specify those options in grub.conf – Gaia Aug 01 '12 at 17:11
  • @Gaia, what's your point regarding that? Do you need your problem solved or the article advertised? ) – poige Aug 01 '12 at 17:16
  • 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 Aug 01 '12 at 17:25