Ubuntu 12.04 on Xen: blkfront: barrier: empty write xvda op failed

When you run Ubuntu 12.04 VM on XenServer 6.0 (kernel 2.6.32.12) you can get the following errors and your local file systems will mount read-only. Also see Debian #637234 or Ubuntu #824089.

blkfront: barrier: empty write xvda op failed
blkfront: xvda: barrier or flush: disabled

You also won't be able to remount read-write using "mount -o remount,rw /" as this will give you a kernel error like this

EXT4-fs (xvda1): re-mounted. Opts: errors=remount-ro

This problem more or less sporadically affects paravirtualized Ubuntu 12.04 VMs. Note that officially Ubuntu 12.04 is not listed as a supported system in the Citrix documentation. Note that this problem doesn't affect fully virtualized VMs.

The Solution:

  • According to the Debian bug report the correct solution is to upgrade the dom0 kernel to at least 2.6.32-41.
  • To solve the problem without upgrading the dom0 kernel: reboot until you get a writable filesystem and add "barrier=0" to the mount options of all your local filesystems.
  • Alternatively: do not use paravirtualization :-)

This "reboot until you get a

This "reboot until you get a writable filesystem" reminds of "have you tried to turn it off and on again". And then it all ends up in the question: Are talking about Windows, or? No? What? :-)

Save some time

Instead of rebooting over and over, boot to a live CD ISO (Not 12.04, obviously), mount the filesystem and edit etc/fstab directly.

Some corrections and simplification

The mount option is "barrier", not "barriers", and you don't have to reboot. Just remount:


# mount -o remount,rw,barrier=0 -t ext4 /dev/xvda1 /
# vim /etc/fstab #add barrier=0 to local filesystem options
# reboot

RE: Some corrections and simplification

Thanks for the hint. I fixed the typo! I remember remounting didn't work, but it is worth trying...

I also get a read-only issue

I also get a read-only issue in Xen with Debian Wheezy, and the kernel output shows:

blkfront: barrier: empty write xvda op failed
blkfront: xvda: barrier or flush: disabled
end_request: I/O error, dev xvda, sector 20454592
end_request: I/O error, dev xvda, sector 20454592
Buffer I/O error on device xvda1, logical block 2556568
lost page write due to I/O error on xvda1
Aborting journal on device xvda1.
EXT3-fs (xvda1): error: ext3_journal_start_sb: Detected aborted journal
EXT3-fs (xvda1): error: remounting filesystem read-only

and I've tried
sudo mount -o remount,rw,barrier=0 -t ext4 /dev/xvda1 /
[sudo] password for buildbot:
sudo: unable to open /var/lib/sudo/buildbot/0: Read-only file system
mount: cannot remount block device /dev/xvda1 read-write, is write-protected

I've also tried several way to run e2fsck. directly, or with "sudo shutdown -rF now", but it still refuses to mount the disk in r/w modes.

How do you avoid

How do you avoid paravirtualization? I need the write barrier, I don't need very high performance.

RE: How do you avoid

You avoid paravirtualization by not using the Xen kernel and boot using the stock kernel in the VM's boot partition.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

To prevent automated spam submissions leave this field empty.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.