Author: Lachlan Language: text
Description: FreeNAS Jails Timestamp: 2014-08-08 02:40:03 +0000
View raw paste Reply
  1. Thanks for the interesting show, FreeBSD is becoming my number 1 server OS choice for me ( namely thanks to the great doco ).
  2.  
  3. I'm trying to get the btsync plugin to work on my new MAXED-OUT freenas mini I just bought! :)
  4.  
  5. Now to get into the gritty.
  6.  
  7. I've followed this article on the web: Blog post on BitTorrent's website
  8.  
  9. 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.
  10.  
  11. I then installed the plugin like the doco says and started the jail.
  12.  
  13. It works! I can get to my internal ip and the port and access the webgui ( http://XXX.XXX.XXX.XXX:8888/gui )
  14.  
  15. Now this is where the doco doesn't work for "me".
  16.  
  17. 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.
  18.  
  19. 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.
  20.  
  21. It doesn't, I get this is the logs:
  22.  
  23.  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 ]
  24.  
  25.  
  26. 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.
  27.  
  28. After doing this. I can added the folder in like the doco says.
  29.  
  30. 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:
  31.  
  32. Bittorrent Sync cannot identify the destination folder.
  33.  
  34. It doesn't work... :(
  35.  
  36. I then remove the nullfs mount from the freenas GUI and the folder happily starts to sync my data.
  37.  
  38. 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?
  39.  
  40.  
  41. FreeBSD 9.2-RELEASE-p9 (FREENAS.amd64) #0 r262572+cc525fe: Thu Jul  3 14:22:45 P                                          
  42. DT 2014
  43.         FreeNAS (c) 2009-2014, The FreeNAS Development Team
  44.         All rights reserved.
  45.         FreeNAS is released under the modified BSD license.
  46.         For more information, documentation, help or support, go here:
  47.         http://freenas.org
  48. Welcome to FreeNAS
  49. [root@freenas] ~# jls
  50.    JID  IP Address      Hostname                      Path
  51.      1  -               btsync_1                      /mnt/tank/jail/btsync_1
  52. [root@freenas] ~# cd /mnt/tank/data/btsync/
  53. [root@freenas] /mnt/tank/data/btsync# ls -la
  54. total 43
  55. drwxrwxrwx  3 btsync  btsync    4 Aug  7 10:43 ./
  56. drwxrwxrwx  3 guest   guest     3 Aug  8 11:04 ../
  57. drwxrwxrwx  2 btsync  btsync    2 Aug  7 10:43 .SyncArchive/
  58. -rwxrwxrwx  1 btsync  btsync  296 Aug  7 10:43 .SyncIgnore*
  59. [root@freenas] /mnt/tank/data/btsync# cd /mnt/tank/jail/btsync_1/
  60. [root@freenas] /mnt/tank/jail/btsync_1# ls
  61. ./         .cshrc     .profile   bin/       btsync/    etc/       libexec/   mnt/       rescue/    sbin/      tmp/       var/
  62. ../        .plugins/  COPYRIGHT  boot/      dev/       lib/       media/     proc/      root/      sys@       usr/
  63. [root@freenas] /mnt/tank/jail/btsync_1# ls -la btsync/
  64. total 43
  65. drwxrwxrwx   3 btsync  btsync    4 Aug  7 10:43 ./
  66. drwxr-xr-x  19 root    wheel    23 Aug  7 10:38 ../
  67. drwxrwxrwx   2 btsync  btsync    2 Aug  7 10:43 .SyncArchive/
  68. -rwxrwxrwx   1 btsync  btsync  296 Aug  7 10:43 .SyncIgnore*
  69. [root@freenas] /mnt/tank/jail/btsync_1# id btsync
  70. uid=817(btsync) gid=817(btsync) groups=817(btsync)
  71. [root@freenas] /mnt/tank/jail/btsync_1# jexec 1 tcsh
  72. root@btsync_1:/ # id btsync
  73. uid=817(btsync) gid=817(btsync) groups=817(btsync)
  74. root@btsync_1:/ # ls -la /btsync/
  75. total 43
  76. drwxrwxrwx   3 btsync  btsync    4 Aug  7 10:43 .
  77. drwxr-xr-x  19 root    wheel    23 Aug  7 10:38 ..
  78. drwxrwxrwx   2 btsync  btsync    2 Aug  7 10:43 .SyncArchive
  79. -rwxrwxrwx   1 btsync  btsync  296 Aug  7 10:43 .SyncIgnore
  80. root@btsync_1:/ # exit
  81. exit
  82. [root@freenas] /mnt/tank/jail/btsync_1# mount | grep btsync
  83. tank/data/btsync on /mnt/tank/data/btsync (zfs, local, nfsv4acls)
  84. tank/jail/btsync_1 on /mnt/tank/jail/btsync_1 (zfs, local, nfsv4acls)
  85. devfs on /mnt/tank/jail/btsync_1/dev (devfs, local, multilabel)
  86. procfs on /mnt/tank/jail/btsync_1/proc (procfs, local)
  87. /mnt/tank/data/btsync on /mnt/tank/jail/btsync_1/btsync (nullfs, local)
  88. [root@freenas] /mnt/tank/jail/btsync_1#
  89.  
  90. So yeah, I'm stumped. It works when I don't have the nullfs mount on.

This paste is large and only partially shown.
View full paste

View raw paste Reply