Blog | Forums | Control panel | Order Now
Accessing your backup space over NFS
NFS is a convenient way of accessing files across a network; it allows a Linux system to access files on a remote server in exactly the same way as it accesses its own files, with only a little extra latency for the network access.
Unless you’ve been told otherwise when your server was provisioned, or made another arrangement with us (eg merged separate backup space allocations into a single space), backup accounts are named after your Virtual Machine or Dedicated Host, so e.g. if your VM is called joebloggs.vm.bytemark.co.uk your backup space account will be accessible at joebloggs.backup.bytemark.co.uk:/store/backups/joebloggs.
Note that file ownership information will not be preserved. Any files written to your backup directory will have their permissions “squashed” to an arbitrary user ID which is different for each backup account. If preserving file ownership is important to your backup regime, you should only store files in an archive file format (such as tar or zip).
Setting up the mount
To mount and unmount the backup space on /mnt/backup, you will need the following inserted into your fstab (all one
line):
joebloggs.backup.bytemark.co.uk:/store/backups/joebloggs
/mnt/backup
nfs proto=tcp,nolock,noauto,mountvers=3,nfsvers=3,intr 0 0
For this to work you will also need to create the /mnt/backup directory manually by running:
mkdir /mnt/backup
Please make sure you have the noauto option in the options in /etc/fstab or your machine may simply not boot in the event of a network problem.
When you umount, we’d advise using umount -l. This will allow the system to stop using the backup space even if the server is down or there’s some kind of timeout on NFS.
Also, we would advise that you add the mounting and umounting of the backups space as part of your backup scripts rather than leaving a long term mount open. This will minimise any effects of the backup server being unavailable for any length of time
Possible NFS issues
I can’t find my backups!
If you have previously used rsync to back up your files, you will find your files in the hidden directory called .rsync_root; remember to add the -a switch to the ls command.
ls -a /mnt/backup
IP restrictions
NFS mounts may only be made from IP addresses registered to your Virtual Machine or Dedicated Server. Any other attempts will result in “permission denied”. If you have more than one IP address allocated to your host, you may find that Linux tries to use the “wrong” address to mount from. Just ask support to add your extra address to your backup account’s access list if you suspect this is the problem.
User restrictions
If you’ve configured your system along the lines described so far, only the root user will be able to mount the backup space as access will be attempted from privileged ports. If you find this too inconvenient (ie to avoid the need to use sudo, or to su to root), there is a two step process (which must be done with root privileges) to allow limited users the same access. “Limited user” includes admin on a Symbiosis system and probably also any accounts you created with the adduser utility.
First off change the ownership of the mount point to give your limited user control:-
chown admin /mnt/backup
Then make a further addition to the line in /etc/fstab, which should now look like this:-
joebloggs.backup.bytemark.co.uk:/store/backups/joebloggs
/mnt/backup
nfs users,proto=tcp,nolock,noauto,mountvers=3,nfsvers=3,intr 0 0If you compare that to the line higher up the page you see that the users flag was added to the nfs line.
Locking horrors
NFS can implement file locking but we recommend that you don’t bother (in fact we will always ask you to disable it before we can help diagnose NFS problems). Use the nolock option. Locking should not be needed for backup applications; if you find your backup space simply hangs, locking is likely enabled.
“RPC: Timed out” error
Among other things, this may mean that you’ve forgotten to install the nfs-common package under Debian. Type “apt-get install nfs-common” to correct this. Also make sure you have added joebloggs.backup.bytemark.co.uk to your portmap service in /etc/hosts.allow.
My machine hangs when I boot
If you are adding your backup space mount to /etc/fstab, please make sure it’s listed as noauto. Otherwise in the event that the backup server is unavailable your machine may not complete booting.
I get a “wrong fs type, bad block, bad superblock […]” error
You need to install the package nfs-common if you are on Debian based systems and nfs-utils if you are on CentOS.
Tags
Search for documents by tag:
- AddOns
- Backup
- backup2l
- Bandwidth
- ConsoleShell
- Dedicated
- Discussion
- DNS
- Example
- Firewall
- IPv6
- OS
- Overview
- Performance
- Plesk
- Reinstall
- Rescue
- rsync
- Security
- SingleSignOn
- Spam
- Support
- Time
- Tutorial
- VirtualMachine
- VirtualMachineHosting
- Watchdog
- Windows
- Xen
“Bytemark's technical advice and support is exceptional and always fills us with confidence. When I go to Bytemark I am always left feeling that the people there are looking out for me.”




