How do limit disc i/o during backup?
Beside the rather general approach with ionice
there is a nice device mapper target (ioband) which allows precise control over the bandwidth to a (DM) block device. Unfortunately it is not part of the standard kernel.
Furthermore you can probably speed up tar by
- Reading the file names into the disk cache:
find /source/path -printf ""
- Reading the inodes into the disk cache:
find /source/path -perm 777 -printf ""
- Making tar read and write larger blocks from and to the disk by e.g. using a pipe with mbuffer or buffer (with at least 100 MiB of RAM):
tar ... | mbuffer -m 256M -P 100 -p 1 ...
It's expected to see high I/O during backups because they're generally made over large file trees with large files. You can use ionice
to prioritize I/O jobs in Linux with classes and levels. IIRC, class 2, level 7 is the lowest, non starving level which will make it practically invisible to other I/O loads and users. See man ionice
for usage and details.
I would recommend ditching tar and going with rsync (as mentioned by Dogsbody). I use BackupPC to backup files on my Windows and Linux systems and it supports using tar as well as rsync and automatically takes care of the hard linking for you as well as provides a nice web interface.
http://backuppc.sourceforge.net/