You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
1.6 KiB

  1. Mount the SeaweedFS via FUSE
  2. # Mount by fstab
  3. ```
  4. $ # on linux
  5. $ sudo apt-get install fuse
  6. $ sudo echo 'user_allow_other' >> /etc/fuse.conf
  7. $ sudo mv weedfuse /sbin/mount.weedfuse
  8. $ # on Mac
  9. $ sudo mv weedfuse /sbin/mount_weedfuse
  10. ```
  11. On both OS X and Linux, you can add one of the entries to your /etc/fstab file like the following:
  12. ```
  13. # mount the whole SeaweedFS
  14. localhost:8888/ /home/some/mount/folder weedfuse
  15. # mount the SeaweedFS sub folder
  16. localhost:8888/sub/dir /home/some/mount/folder weedfuse
  17. # mount the SeaweedFS sub folder with some options
  18. localhost:8888/sub/dir /home/some/mount/folder weedfuse user
  19. ```
  20. To verify it can work, try this command
  21. ```
  22. $ sudo mount -av
  23. ...
  24. /home/some/mount/folder : successfully mounted
  25. ```
  26. If you see `successfully mounted`, try to access the mounted folder and verify everything works.
  27. To debug, run these:
  28. ```
  29. $ weedfuse -foreground localhost:8888/ /home/some/mount/folder
  30. ```
  31. To unmount the folder:
  32. ```
  33. $ sudo umount /home/some/mount/folder
  34. ```
  35. <!-- not working yet!
  36. # Mount by autofs
  37. AutoFS can mount a folder if accessed.
  38. ```
  39. # install autofs
  40. $ sudo apt-get install autofs
  41. ```
  42. Here is an example on how to mount a folder for all users under `/home` directory.
  43. Assuming there exists corresponding folders under `/home` on both local and SeaweedFS.
  44. Edit `/etc/auto.master` and `/etc/auto.weedfuse` file with these content
  45. ```
  46. $ cat /etc/auto.master
  47. /home /etc/auto.weedfuse
  48. $ cat /etc/auto.weedfuse
  49. # map /home/<user> to localhost:8888/home/<user>
  50. * -fstype=weedfuse,rw,allow_other,foreground :localhost\:8888/home/&
  51. ```
  52. -->