Plugins/Jails or File Permissions?

Status
Not open for further replies.
Joined
Aug 7, 2014
Messages
4
Hey All!

Thanks for attempting to read this.

Now to get into the gritty.

I've followed this article on the web: Blog post on BitTorrent's website

Created the btsync user and group on the nas like the doco says with a UID of 817 and the username ( I did defer from the doco here, in that I set the users shell to nologin and Disable Password Login ). I've created the zfs datasets like described and set the permissions to be even more lose then what they state (ie 777 rather the 775) and set the btsync user as the owner and group.

I then installed the plugin like the doco says and started the jail.

It works! I can get to my internal ip and the port and access the webgui ( http://XXX.XXX.XXX.XXX:8888/gui )

Now this is where the doco doesn't work for "me".

Code:
Return to the “Jails” tab. Click on the new jail, which will be called something like “btsync_1”.
At the bottom of the window, click the second button from the left, “Add Storage”. For “Source”, click through the dropdowns and select the second dataset you made, “Files”.
For “Destination”, you can either type in a custom path such as “/btsync”, or choose an existing empty folder, such as “/media”.
Click OK to save the mount point.

I added in the source DIR of /mnt/tank/data/btsync/ I attempt to make a folder in the destination field called "/btsync" and expect the tick box of Create Directory to make the folder inside the jail.

It doesn't, I get this is the logs:

Code:
 freenas manage.py: [middleware.exceptions:38] [MiddlewareError: The path could not be mounted /mnt/tank/data/btsync: Mount failed (64) -> mount: /mnt/tank/jail/btsync_1/btsync: No such file or directory ]

ZJSrJrh8TlVSigEUST9rw2dm658aosa-JG1xXV6JWmfUT2E11N8YMuBiTVj-kP9w8N0-WHbf9RrJ9rD2TYkjQ8gyEIgl370WQnMDQccg1kiTewB-EXhB9Ul9t8fdhd8xLs8yUv7DRE9XTdF8MCZMHlo4=s0-d-e1-ft


So I think OK, I need to go into the jail and make the folder myself and apply the chown btsync:btsync /btsync and apply a 777 to the folder.

After doing this. I can added the folder in like the doco says.

I go back into the BTsync webgui and add the jail folder in as my folder to sync into and get this in the webclient:

Code:
Bittorrent Sync cannot identify the destination folder.

It doesn't work... :(

I then remove the nullfs mount from the freenas GUI and the folder happily starts to sync my data.

Now I don't think its a mount issue and I think it's a folder/file permission issue but as you'll see below. I can't see what I did wrong?

Code:
FreeBSD 9.2-RELEASE-p9 (FREENAS.amd64) #0 r262572+cc525fe: Thu Jul  3 14:22:45 P
DT 2014
Code:

        FreeNAS (c) 2009-2014, The FreeNAS Development Team
        All rights reserved.
        FreeNAS is released under the modified BSD license.

        For more information, documentation, help or support, go here:
        http://freenas.org
Welcome to FreeNAS
[root@freenas] ~# jls
   JID  IP Address      Hostname                      Path
     1  -               btsync_1                      /mnt/tank/jail/btsync_1
[root@freenas] ~# cd /mnt/tank/data/btsync/
[root@freenas] /mnt/tank/data/btsync# ls -la
total 43
drwxrwxrwx  3 btsync  btsync    4 Aug  7 10:43 ./
drwxrwxrwx  3 guest   guest     3 Aug  8 11:04 ../
drwxrwxrwx  2 btsync  btsync    2 Aug  7 10:43 .SyncArchive/
-rwxrwxrwx  1 btsync  btsync  296 Aug  7 10:43 .SyncIgnore*
[root@freenas] /mnt/tank/data/btsync# cd /mnt/tank/jail/btsync_1/
[root@freenas] /mnt/tank/jail/btsync_1# ls
./         .cshrc     .profile   bin/       btsync/    etc/       libexec/   mnt/       rescue/    sbin/      tmp/       var/
../        .plugins/  COPYRIGHT  boot/      dev/       lib/       media/     proc/      root/      sys@       usr/
[root@freenas] /mnt/tank/jail/btsync_1# ls -la btsync/
total 43
drwxrwxrwx   3 btsync  btsync    4 Aug  7 10:43 ./
drwxr-xr-x  19 root    wheel    23 Aug  7 10:38 ../
drwxrwxrwx   2 btsync  btsync    2 Aug  7 10:43 .SyncArchive/
-rwxrwxrwx   1 btsync  btsync  296 Aug  7 10:43 .SyncIgnore*
[root@freenas] /mnt/tank/jail/btsync_1# id btsync
uid=817(btsync) gid=817(btsync) groups=817(btsync)
[root@freenas] /mnt/tank/jail/btsync_1# jexec 1 tcsh
root@btsync_1:/ # id btsync
uid=817(btsync) gid=817(btsync) groups=817(btsync)
root@btsync_1:/ # ls -la /btsync/
total 43
drwxrwxrwx   3 btsync  btsync    4 Aug  7 10:43 .
drwxr-xr-x  19 root    wheel    23 Aug  7 10:38 ..
drwxrwxrwx   2 btsync  btsync    2 Aug  7 10:43 .SyncArchive
-rwxrwxrwx   1 btsync  btsync  296 Aug  7 10:43 .SyncIgnore
root@btsync_1:/ # exit
exit
[root@freenas] /mnt/tank/jail/btsync_1# mount | gre
grep      gresource
[root@freenas] /mnt/tank/jail/btsync_1# mount | grep btsync
tank/data/btsync on /mnt/tank/data/btsync (zfs, local, nfsv4acls)
tank/jail/btsync_1 on /mnt/tank/jail/btsync_1 (zfs, local, nfsv4acls)
devfs on /mnt/tank/jail/btsync_1/dev (devfs, local, multilabel)
procfs on /mnt/tank/jail/btsync_1/proc (procfs, local)
/mnt/tank/data/btsync on /mnt/tank/jail/btsync_1/btsync (nullfs, local)
[root@freenas] /mnt/tank/jail/btsync_1#

[/INDENT]
So yeah, I'm stumped. It works when I don't have the nullfs mount on.

Any help would be Great.
 
Last edited:
D

dlavigne

Guest
Code:
 freenas manage.py: [middleware.exceptions:38] [MiddlewareError: The path could not be mounted /mnt/tank/data/btsync: Mount failed (64) -> mount: /mnt/tank/jail/btsync_1/btsync: No such file or directory ]


I then remove the nullfs mount from the freenas GUI and the folder happily starts to sync my data.

Which version of FreeNAS? I know there was a bug with the create directory checkbox not working where the workaround was to create the directory first. Also, mount types were problematic and have been removed for the upcoming 9.3.
 
Joined
Aug 7, 2014
Messages
4
Which version of FreeNAS? I know there was a bug with the create directory checkbox not working where the workaround was to create the directory first. Also, mount types were problematic and have been removed for the upcoming 9.3.
Code:
[root@freenas] ~# uname -a
FreeBSD %NAME-REMOVED% 9.2-RELEASE-p9 FreeBSD 9.2-RELEASE-p9 #0 r262572+cc525fe: Thu Jul  3 14:22:45 PDT 2014     root@build3.ixsystems.com:/fusion/jenkins/9.2.1.6-RELEASE/os-base/amd64/fusion/jenkins/9.2.1.6-RELEASE/FreeBSD/src/sys/FREENAS.amd64  amd64


EDIT:- i just upgraded to 9.2.1.7
 
Last edited:

kss18

Dabbler
Joined
May 17, 2014
Messages
12
I have run into the exactly same problem - I ended up solving it by creating the mountpoint directory (/media) manually by opening a shell in / under the bysync_1 jail.

It almost looks like a bug in that the mkdir fails with a "permissions denied."
 
Joined
Aug 7, 2014
Messages
4
Hey, I did sort it out.

I emailed and worked with the creator of the blog post I used as documentation.

My solution was:

  1. Remove folder from BTSync GUI - IE stop the syncing.
  2. Remove the storage mount from the FreeNAS GUI in the jail section.
  3. Delete the /btsync folder+files inside the jail.
  4. Create the /btsync folder inside the jail with chown btsync:btsync and chmod 777
  5. Add the NULLFS mount in the FreeNAS webGUI in the jail section.
  6. Add the Folder and Secret Key to the BTSync GUI
I then told him that the Create directory button in the "add storage" pop up didn't work and he said he would log it as a bug. I hope he does.

I'll be marking this thread as fixed.
 

MarkN

Cadet
Joined
Sep 1, 2014
Messages
4
Hey, I did sort it out.

I emailed and worked with the creator of the blog post I used as documentation.

My solution was:

  1. Remove folder from BTSync GUI - IE stop the syncing.
  2. Remove the storage mount from the FreeNAS GUI in the jail section.
  3. Delete the /btsync folder+files inside the jail.
  4. Create the /btsync folder inside the jail with chown btsync:btsync and chmod 777
  5. Add the NULLFS mount in the FreeNAS webGUI in the jail section.
  6. Add the Folder and Secret Key to the BTSync GUI
I then told him that the Create directory button in the "add storage" pop up didn't work and he said he would log it as a bug. I hope he does.

I'll be marking this thread as fixed.

I'm having a similar problem, the solutions sounds reasonable and is easy to follow. The part I don't understand is step 5 that pertains to the NULLFS. I'm not sure what that is or how to mount it. A brief explanation or example on how to mount it would be appreciated. Thanks.

EDIT: In my case the can't find folder errors only occurs after a reboot
 
Last edited:
Joined
Aug 7, 2014
Messages
4
Hey MarkN,

Sorry for not replying sooner... NULLFS is what the freenas server does on the terminal if you were to mount it manually...

NULLFS in this case is actually just the "add storage" part in the WEB-GUI of freenas.

If this doesn't make sense let me know and when I get home I'll do a more detailed explanation.
 

MarkN

Cadet
Joined
Sep 1, 2014
Messages
4
horseSizedDuck,

Thanks for the explanation, I got it now. Funny thing is I tired steps you suggested and it works as expected but when I reboot the error comes back. It's fine as long as I don't reboot my box, very odd. Have you experienced that, are your setting persistent after a reboot?
 
Status
Not open for further replies.
Top