Saturday, November 28, 2015

Troubleshooting rtorrent: Storage error: [File chunk write error: Invalid argument.]

So I decided to try and improve the performance of one of my VMs that was running torrents.

Instead of using samba to mount the filesystem from inside the guest I went with QEMU / KVM's v9fs.

The filesystem is actually called 9p or Plan 9 File System:

After mounting and figuring out permission issues I started rtorrent and got the error

[File chunk write error: Invalid argument.]

Apparently rtorrent uses mmap and the Plan9 file system kernel module did not support memory mapping. However it was added in a later kernel release. So all I had to do was upgrade my kernel (I was on the default 14.04 LTS kernel):

sudo apt-get install linux-image-generic-lts-vivid linux-headers-generic-lts-vivid

Restarted and used the following mount command it all worked:

mount -t 9p -o trans=virtio,version=9p2000.L,cache=mmap,rw /mount/external /data

Before the cache=mmap did not work (only cache=loose or cache=none)


Anthony Morano said...

Hi, thanks for sharing. This can be useful to me. Once upon a time, I had a problem after installing the torrent. The system displayed an error message dll. file. I've been thinking what to do. As a result, I downloaded DLL hotfix files and replaced it. Maybe someone come in handy. Good luck.

Anthony V. said...

Hi Jeff,

I've been experiencing the same error in my own setup (trying to do exactly the same thing as you - small world, eh?). Unfortunately upgrading the kernel (on both the host and guest) to 3.19 didn't help. I'm going to try a 4.x kernel next.

Did you have to upgrade the kernel in the host or the guest for this to work, by the way? and what version of libvirt do you have installed?



Jeff Tchang said...

I upgraded the kernel inside the VM:

Linux 3.19.0-33-generic #38~14.04.1-Ubuntu SMP Fri Nov 6 18:17:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

When I run mount I see:

/data on /data/media type 9p (rw,trans=virtio,version=9p2000.L,cache=mmap)

$ virsh version

Compiled against library: libvirt 1.2.2
Using library: libvirt 1.2.2
Using API: QEMU 1.2.2
Running hypervisor: QEMU 2.0.0