# Moving distfiles and binary package storage to a file server

## Shining Arcanine

My desktop uses a SSD and space is a premium, so I would like to move all of the distfiles and binary packages to a file server on my home network.

Following advice from #gentoo on freenode, I experimented with sshfs. I setup RSA keys on my desktop's root account and put the public key into a user account on my file server. I then copied the files to the server using scp and mounted the remote directories as root to simulate mounting via fstab:

 *Quote:*   

> sshfs -o nonempty,allow_other,sshfs_sync username@ip_address:/home/username/desktop/portage/packages /usr/portage/packages
> 
> sshfs -o nonempty,allow_other,sshfs_sync username@ip_address:/home/username/desktop/portage/distfiles /usr/portage/distfiles/

 

It seems that with a network shares, the file ownership is no longer what it was on the local system. How concerned should I be about portage becoming upset about this at some point in the future?

Also, I am concerned about the reliability of this approach. I know that I can configure /etc/fstab to mount the remote shares at boot, but past experience with ssh suggests that things will go south very quickly if the pipe breaks (i.e. the server restarts/crashes/loses-power, a network cable is disconnected/severed, a switch crashes/restarts/loses-power). I am concerned about how gracefully things will be able to recover. Will sshfs_sync be enough to ensure data integrity in this scenario? Assuming that the remote server did a shut down in the event of a short power outage (the UPS only lasts 2 minutes) and I brought it back online, would I potentially encounter a dangling mount situation where I need to do a lazy umount on the client?

Are there any alternatives to sshfs that have some property that makes using them more desirable than using sshfs?

----------

## Hu

Traditionally, NFS has been used for this purpose.  Based on your description, I see no reason not to use NFS.  It recovers reasonably well from unreachable servers when they come back.

----------

## Shining Arcanine

 *Hu wrote:*   

> Traditionally, NFS has been used for this purpose.  Based on your description, I see no reason not to use NFS.  It recovers reasonably well from unreachable servers when they come back.

 

Does NFS have the ability to encrypt traffic and use public-key authentication? I know that it is overkill for a private network, but I prefer to follow good security practices so that security degrades gracefully in the event that I misconfigure something.

----------

## Inodoro_Pereyra

If that's the case, you are looking for NFSv4 tought. As said before it can reconnect automagically broken pipes as they become online again.

Cheers!

----------

