Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Help about MediaWiki
FUTO
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Introduction to a Self Managed Life: a 13 hour & 28 minute presentation by FUTO software
(section)
Main Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Step 3: Mount a read only samba share of the ZFS pool for Immich onto the androidstuff virtual machine == We are going to do the following: # On the '''happycloud''' host machine, create another samba share of our ZFS pool <code>/mediapool/archive</code> that is read only. # Mount this inside the '''androidstuff''' virtual machine on <code>~/Pictures</code> which is the Pictures subdirectory of my home directory. <code>~/</code> is shorthand for your home directory; in my case, <code>~/</code> is the same as <code>/home/louis/</code> <span id="modify-samba-configuration-on-happycloud-host-machine"></span> ==== 3.1 Modify samba configuration on happycloud host machine ==== SSH into the happycloud host machine: <pre>ssh louis@happycloud.home.arpa</pre> or <pre>ssh louis@192.168.5.2</pre> Our <code>/etc/samba/smb.conf</code> file currently looks like this: <pre>[global] # Network settings workgroup = HOME realm = home.arpa netbios name = happycloud server string = ZFS Archive Server dns proxy = no # Security settings security = user map to guest = bad user server signing = auto client signing = auto # Logging log level = 1 log file = /var/log/samba/%m.log max log size = 1000 # Performance optimization socket options = TCP_NODELAY IPTOS_LOWDELAY read raw = yes write raw = yes use sendfile = yes min receivefile size = 16384 aio read size = 16384 aio write size = 16384 # Multichannel support server multi channel support = yes # Disable unused services load printers = no printing = bsd printcap name = /dev/null disable spoolss = yes # Character/Unix settings unix charset = UTF-8 dos charset = CP932 [archive] comment = ZFS Archive Share path = /mediapool/archive valid users = louis invalid users = root browseable = yes read only = no writable = yes create mask = 0644 force create mode = 0644 directory mask = 0755 force directory mode = 0755 force user = louis force group = louis veto files = /._*/.DS_Store/.Thumbs.db/.Trashes/ delete veto files = yes follow symlinks = yes wide links = no ea support = yes inherit acls = yes hide unreadable = yes guest ok = no</pre> We are going to add something like this to the bottom of the <code>/etc/samba/smb.conf</code> file. Obviously '''feel free to set the <code>path</code> folder to what YOU want Immich to see'''. This will be read-only, so if something happens on your host, you won’t lost everything. Use nano to edit the file: <pre>sudo nano -w /etc/samba/smb.conf</pre> Enter the following at the end. Hit enter so there’s a pretty little space before the new section. :) <pre>[immich] comment = ZFS Archive Share (Read-Only) path = /mediapool/archive valid users = louis browseable = yes read only = yes guest ok = no create mask = 0644 directory mask = 0755 veto files = /._*/.DS_Store/.Thumbs.db/.Trashes/ delete veto files = yes follow symlinks = yes wide links = no ea support = yes inherit acls = yes hide unreadable = yes</pre> <span id="configure-the-samba-share-on-the-androidstuff-virtual-machine"></span> ==== 3.2 Configure the samba share on the androidstuff virtual machine ==== We want this to mount each time the '''androidstuff''' virtual machine that will run Immich boots. To do this, we will edit <code>/etc/fstab</code> - the file that defines where hard drives, partitions, network shares, are mounted on the filesystem. We have to install the packages that allow us to mount samba shares: <pre>sudo apt install cifs-utils -y</pre> Edit the file: <pre>sudo nano -w /etc/fstab</pre> Add the following line: <pre>//192.168.5.2/immich /home/louis/Pictures cifs ro,credentials=/etc/samba_credentials,iocharset=utf8,vers=3.0 0 0</pre> Make sure that the IP address matches the IP address of the machine that you have your ZFS pool on. * <code>//192.168.5.2</code> is the address of the computer that is running samba server for our samba share. ** <code>immich</code> is the name of the samba share. ** In '''happycloud'''’s’ <code>/etc/samba/smb.conf</code> configuration file, the line<code>path = /mediapool/archive</code> is present under the <code>[immich]</code> share settings. ** Therefore, `<code>//192.168.5.2/immich</code> will show us <code>/mediapool/archive</code> on the machine located at <code>192.168.5.2</code> * <code>cifs</code> is the filesystem type. CIFS stands for '''Common Internet File System'''. * <code>ro</code> means readonly. * <code>/etc/samba_credentials</code> is the file that will house the username & password to access this share. * For the love of god, do not forget to set the proper permissions on the<code>/etc/samba_credentials</code> file when I tell you to. Once you’re done adding that line to the file, we need to provide it a username/password so it can log into the password protected share. <pre># Create the credentials file that will house the username & password: sudo nano -w /etc/samba_credentials</pre> Add your username and password you set when you set the password for your samba user to the file in the following format: <pre>username=louis password=passwordman</pre> If you forgot what the samba password is for your user, refer to '''step 6.5''' in the '''Setting up ZFS for data storage''' portion of the guide. '''Make sure that this file is not accessible by anyone besides root!''' <pre>sudo chown root /etc/samba_credentials sudo chmod 600 /etc/samba_credentials</pre> <span id="set-the-permissions-for-samba-credentials-file"></span> ==== 3.3 Set the permissions for samba credentials file ==== Important enough to be worth stating again: <pre>sudo chown root /etc/samba_credentials sudo chmod 600 /etc/samba_credentials</pre> ----- <span id="mount-the-samba-share-on-the-androidstuff-virtual-machine"></span> ==== 3.4 Mount the samba share on the androidstuff virtual machine ==== Run the following to mount everything in the <code>/etc/fstab</code> file, including your samba share. <pre>sudo mount -a sudo systemctl daemon-reload</pre> <span id="make-sure-it-worked."></span> ==== 3.5 Make sure it worked. ==== In <code>/home/louis/Pictures</code>on the '''androidstuff''' virtual machine you should see everything that is on <code>/mediapool/archive</code> on the '''happycloud''' host server. Try making a file and saving it there. It shouldn’t work. Create a file on happycloud. Go to the terminal window for happycloud, or just ssh in if you don’t have one open. <pre>ssh louis@happycloud.home.arpa # Put a file called hello_world.log that says "hi" inside of it into the /mediapool/archive directory echo "hi" > /mediapool/archive/helloworld.log</pre> Then, on the '''androidstuff''' virtual machine, try to view it. We mounted this samba share on <code>/home/louis/Pictures</code> so <code>hello_world.log</code> should show up on <code>/home/louis/Pictures/hello_world.log</code> <pre>louis@androidstuff:~$ cat helloworld.log louis@androidstuff:~$ cat ~/Pictures/helloworld.log hi louis@androidstuff:~$ rm ~/Pictures/helloworld.log rm: remove write-protected regular file '/home/louis/Pictures/helloworld.log'? y rm: cannot remove '/home/louis/Pictures/helloworld.log': Read-only file system louis@androidstuff:~$ sudo rm ~/Pictures/helloworld.log [sudo] password for louis: rm: cannot remove '/home/louis/Pictures/helloworld.log': Read-only file system </pre> As you can see, I can see the file, I can read the file, but I can’t delete the file. Perfect. <span id="step-4-make-your-directories"></span>
Summary:
Please note that all contributions to FUTO may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
FUTO:Copyrights
for details).
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:
Cancel
Editing help
(opens in new window)