Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tip: Exporting Btrfs over NFS 4
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Hupf
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 105
Location: Germany

PostPosted: Fri Sep 09, 2011 7:15 pm    Post subject: Tip: Exporting Btrfs over NFS 4 Reply with quote

If you try to export a btrfs volume over NFSv4 you may get errors like
Quote:
Aug 25 11:50:32 pc-diego rpc.mountd[10423]: qword_eol: fflush failed: errno 9
(Bad file descriptor)
Aug 25 11:50:32 pc-diego rpc.mountd[10423]: Cannot export /dati/ISO, possibly
unsupported filesystem or fsid= required

(shamelessly copied from this bug)

On the client's side, you may see "stale file handle" or ESTALE error messages when trying to mount such a volume.



The solution was not easy to find based on the above error messages which is the reason for me writing this post. After reading this guide, chapter 18.7.1.1, I did the following:

# mkdir -p /exports/btrfs
# mount --bind /regular/btrfs/mountpoint /exports/btrfs

Then I changed my /etc/exports file to look like this:
Quote:
/exports *(ro,no_subtree_check,fsid=0)
/exports/btrfs *(rw,no_subtree_check,fsid=12345)


(notice the fsid=0 part; you may replace the 12345 with the UUID given with btrfs-show, but it just has to be unique among the exports)

You should now successfully be able to

# mount -v -t nfs4 server:/btrfs /mnt/nfs
(notice the use of /btrfs instead of /exports/btrfs since /exports is the "virtual root" for all nfs exports now)
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4296

PostPosted: Fri Sep 09, 2011 7:54 pm    Post subject: Reply with quote

you are just showing howto export something using nfsv4

the only "new" thing i see is the need to specify the fsid for your filesystem when it's brtfs, i don't know if it's a "real" need.
And it's not clear it's a need, as the guys weren't exporting right the fs in the bug report you've shown

redo your test with
Code:
/exports *(ro,no_subtree_check,fsid=0)
/exports/btrfs *(rw,no_subtree_check)

if it doesn't work it will confirm the need to specify fsid for brtfs, else it's just the nfsv4 standard, nothing new there

because the fsid is state to be pass to help kernel when the fs is not on a device (like if someone would export a fs that is in memory), but i doubt you use such configuration but an harddisk device that hold your fs no ?
Back to top
View user's profile Send private message
Hupf
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 105
Location: Germany

PostPosted: Wed Sep 14, 2011 8:42 pm    Post subject: Reply with quote

Originally I had the exact same configuration but tried to export the btrfs mount point directly (which resulted in the errors from the bug report). Solely adding the mount --bind in-between and exporting that solved the issue for me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum