4

I've got an rdiff-backup setup that backs up a largeish sql dump (1.6GB) over a network. The server it's backing up to (Ubuntu 10.10 server) has a small local disk (4GB, 1GB free) but has a cifs mount to a large nas (plenty of free space). I've a softlink set up from a user account's home dir to the NAS cifs mount, and the rdiff-backup job initiated from the client is writing to that directory.

Recently, the job has been failing. The logfile says:

Sun Oct 24 21:20:14 2010 Sending back exception [Errno 28] No space left on device of type type 'exceptions.IOError'

I've run the job manually with watch df running on the server, and I can see the 1GB of free space on the local drive diminishing until it hits zero. Then the job fails. To be clear, disk space is not an issue on the NAS.

So, for some reason, rdiff-backup is using somewhere on the local disk as a temp working directory rather than the actual directory where the backups are stored, on the NAS device, as I'd expect. However, I can't find which dir it's using so I can mount that separately with its own blob of space. Doing du -sx on / while the job is running reveals the total filesize of / remaining constant at 3.0GB, even though df says / is full.

If I list the file handles open by the rdiff process, I get a few sockets and some files on NAS mount. Nothing obvious on the local disk.

What's going on? Why does df say / is full, but du -sx say there's 1GB free? Why is rdiff-backup filling up the local disk when it should be using the cifs mount? What's it actually writing to?

  • 1
    Do you see anything in /tmp ? By default, /tmp is on the hard disk, not a ramdisk. Could switch it to a ramdisk if you have enough ram for that. – maco Nov 1 '10 at 17:32
8

As maco already mentioned in comments, /tmp is the problem.

With rdiff-backup you can configure temp directory location with parameter

--tempdir path
          Sets  the  directory  that  rdiff-backup  uses for temporary files
          to the given path. The environment variables TMPDIR, TEMP, and TMP
          can also be used to set the temporary files directory. See the 
          documentation of the Python tempfile module for more information.

If you set tempdir to that CIFS mount, problem should go away. (We had same problem, and that fixed it, you may have something else too)

0

I noticed that this same error [Errno 28] No space left on device can occur when the write access to the destination directory is interrupted, e.g. by a loose USB cable.

The volume that hosts the destination directory may still be mounted after the hiccup, but for safety, the volume reverts to read-only. Thus, when the user tries to use rdiff-backup again, it will fail again, with the same error.

In case of an external USB drive, detach and re-connect the drive. Afterwards, rdiff-backup should work again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.