Skip to content

Commit

Permalink
added more images to post
Browse files Browse the repository at this point in the history
  • Loading branch information
BladeWDR committed Feb 10, 2024
1 parent 8099c24 commit dd5b188
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ paginate = 5
theme='hugo-theme-terminal'
publishdir = "docs"
publishdirorig = "docs"
staticDir = ['static']
#staticDir = ['static']

[params]
# dir name of your main content (default is `content/posts`).
Expand Down
8 changes: 7 additions & 1 deletion content/posts/zfs-pull-truenas.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ I recommend disabling password login entirely, and disabling samba authenticatio

Create another user on the backup server. I recommend matching usernames, just for clarity, but it's not 100% necessary.

![user creation panel](/truenasuser.png)
![user creation panel](/static/images/truenasuser.png)

#### Step 2: Assign privileges.

Expand All @@ -62,6 +62,8 @@ Choose manual as your setup method.

Fill in as below.

![backup credentials](/truenas_ssh.png)

#### Step 4: Create your ZFS replication task.

In the TrueNAS web UI, go to Data Protection and expand Replication Tasks.
Expand All @@ -76,10 +78,14 @@ If you want to copy child datasets, make sure you check off "Recursive". In my c

If at any point you get the below prompt - make sure you click "Cancel". You'll need to hit Cancel twice. We don't need sudo, since we manually allowed our user account to run the needed zfs commands using `zfs allow`.

![sudo prompt](/sudo_cancel.png)

Click Next when you're ready. Choose a schedule. I chose "Daily", as it's not a big deal for this dataset if I lose a single day.

And there you have it. You now have a much more secure method of replicating your data from one ZFS pool to another.

![zfs replication wizard](/replication_wizard.png)

#### Some additional notes.

* Remember that you'll need to have some snapshots on the source system for this to work. ZFS replication works based off of *snapshots*, because they are a consistent, immutable reference at a point in time. I recommend setting up automatic snapshot tasks for the datasets you want to back up.
Expand Down
5 changes: 4 additions & 1 deletion docs/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ I wanted to do my replications with an unprivileged user. I wanted the backups t
<p>You need to create a user on each side. On the <em>sending</em> side, or in other words, your production server, you’ll need to add an SSH authorized key, and enable a home directory.
I recommend disabling password login entirely, and disabling samba authentication. You won’t be using this user for anything but the backups.</p>
<p>Create another user on the backup server. I recommend matching usernames, just for clarity, but it’s not 100% necessary.</p>
<p><img src="http://blog.bladewdr.xyz/truenasuser.png" alt="user creation panel"></p>
<p><img src="http://blog.bladewdr.xyz/static/images/truenasuser.png" alt="user creation panel"></p>
<h4 id="step-2-assign-privileges">Step 2: Assign privileges.</h4>
<p>In order to let this user account run zfs commands without root, you’ll need to drop to the shell. There are options in the TrueNAS web UI for allowing certain sudo commands without a password, but it’s better to do this on the command line, as it gives you more control over what specific rights your user has.</p>
<p>On the receiving side, your user needs the receive, create, and mount privileges.</p>
Expand All @@ -45,15 +45,18 @@ I recommend disabling password login entirely, and disabling samba authenticatio
<p>Head back to the TrueNAS web UI and click on Credentials —> Backup Credentials. You want to add a new SSH connection.</p>
<p>Choose manual as your setup method.</p>
<p>Fill in as below.</p>
<p><img src="http://blog.bladewdr.xyz/truenas_ssh.png" alt="backup credentials"></p>
<h4 id="step-4-create-your-zfs-replication-task">Step 4: Create your ZFS replication task.</h4>
<p>In the TrueNAS web UI, go to Data Protection and expand Replication Tasks.</p>
<p>You’ll want to choose your “SSH Connection” first. Pick the one that you created in Step 3.</p>
<p>Next, choose your source location. You’ll want to pick “On a different system”, then choose the dataset or pool you want to replicate below.</p>
<p>Do the same for your destination, which should be on a local ZFS pool.</p>
<p>If you want to copy child datasets, make sure you check off “Recursive”. In my case, this dataset doesn’t have any children, so I left it unchecked.</p>
<p>If at any point you get the below prompt - make sure you click “Cancel”. You’ll need to hit Cancel twice. We don’t need sudo, since we manually allowed our user account to run the needed zfs commands using <code>zfs allow</code>.</p>
<p><img src="http://blog.bladewdr.xyz/sudo_cancel.png" alt="sudo prompt"></p>
<p>Click Next when you’re ready. Choose a schedule. I chose “Daily”, as it’s not a big deal for this dataset if I lose a single day.</p>
<p>And there you have it. You now have a much more secure method of replicating your data from one ZFS pool to another.</p>
<p><img src="http://blog.bladewdr.xyz/replication_wizard.png" alt="zfs replication wizard"></p>
<h4 id="some-additional-notes">Some additional notes.</h4>
<ul>
<li>Remember that you’ll need to have some snapshots on the source system for this to work. ZFS replication works based off of <em>snapshots</em>, because they are a consistent, immutable reference at a point in time. I recommend setting up automatic snapshot tasks for the datasets you want to back up.</li>
Expand Down
5 changes: 4 additions & 1 deletion docs/posts/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ I wanted to do my replications with an unprivileged user. I wanted the backups t
<p>You need to create a user on each side. On the <em>sending</em> side, or in other words, your production server, you’ll need to add an SSH authorized key, and enable a home directory.
I recommend disabling password login entirely, and disabling samba authentication. You won’t be using this user for anything but the backups.</p>
<p>Create another user on the backup server. I recommend matching usernames, just for clarity, but it’s not 100% necessary.</p>
<p><img src="http://blog.bladewdr.xyz/truenasuser.png" alt="user creation panel"></p>
<p><img src="http://blog.bladewdr.xyz/static/images/truenasuser.png" alt="user creation panel"></p>
<h4 id="step-2-assign-privileges">Step 2: Assign privileges.</h4>
<p>In order to let this user account run zfs commands without root, you’ll need to drop to the shell. There are options in the TrueNAS web UI for allowing certain sudo commands without a password, but it’s better to do this on the command line, as it gives you more control over what specific rights your user has.</p>
<p>On the receiving side, your user needs the receive, create, and mount privileges.</p>
Expand All @@ -45,15 +45,18 @@ I recommend disabling password login entirely, and disabling samba authenticatio
<p>Head back to the TrueNAS web UI and click on Credentials —> Backup Credentials. You want to add a new SSH connection.</p>
<p>Choose manual as your setup method.</p>
<p>Fill in as below.</p>
<p><img src="http://blog.bladewdr.xyz/truenas_ssh.png" alt="backup credentials"></p>
<h4 id="step-4-create-your-zfs-replication-task">Step 4: Create your ZFS replication task.</h4>
<p>In the TrueNAS web UI, go to Data Protection and expand Replication Tasks.</p>
<p>You’ll want to choose your “SSH Connection” first. Pick the one that you created in Step 3.</p>
<p>Next, choose your source location. You’ll want to pick “On a different system”, then choose the dataset or pool you want to replicate below.</p>
<p>Do the same for your destination, which should be on a local ZFS pool.</p>
<p>If you want to copy child datasets, make sure you check off “Recursive”. In my case, this dataset doesn’t have any children, so I left it unchecked.</p>
<p>If at any point you get the below prompt - make sure you click “Cancel”. You’ll need to hit Cancel twice. We don’t need sudo, since we manually allowed our user account to run the needed zfs commands using <code>zfs allow</code>.</p>
<p><img src="http://blog.bladewdr.xyz/sudo_cancel.png" alt="sudo prompt"></p>
<p>Click Next when you’re ready. Choose a schedule. I chose “Daily”, as it’s not a big deal for this dataset if I lose a single day.</p>
<p>And there you have it. You now have a much more secure method of replicating your data from one ZFS pool to another.</p>
<p><img src="http://blog.bladewdr.xyz/replication_wizard.png" alt="zfs replication wizard"></p>
<h4 id="some-additional-notes">Some additional notes.</h4>
<ul>
<li>Remember that you’ll need to have some snapshots on the source system for this to work. ZFS replication works based off of <em>snapshots</em>, because they are a consistent, immutable reference at a point in time. I recommend setting up automatic snapshot tasks for the datasets you want to back up.</li>
Expand Down
5 changes: 4 additions & 1 deletion docs/posts/zfs-pull-truenas/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ <h4 id="step-1-create-your-user-accounts">Step 1: Create your user accounts.<a h
<p>You need to create a user on each side. On the <em>sending</em> side, or in other words, your production server, you&rsquo;ll need to add an SSH authorized key, and enable a home directory.
I recommend disabling password login entirely, and disabling samba authentication. You won&rsquo;t be using this user for anything but the backups.</p>
<p>Create another user on the backup server. I recommend matching usernames, just for clarity, but it&rsquo;s not 100% necessary.</p>
<p><img src="/truenasuser.png" alt="user creation panel"></p>
<p><img src="/static/images/truenasuser.png" alt="user creation panel"></p>
<h4 id="step-2-assign-privileges">Step 2: Assign privileges.<a href="#step-2-assign-privileges" class="hanchor" ariaLabel="Anchor">&#8983;</a> </h4>
<p>In order to let this user account run zfs commands without root, you&rsquo;ll need to drop to the shell. There are options in the TrueNAS web UI for allowing certain sudo commands without a password, but it&rsquo;s better to do this on the command line, as it gives you more control over what specific rights your user has.</p>
<p>On the receiving side, your user needs the receive, create, and mount privileges.</p>
Expand All @@ -208,15 +208,18 @@ <h4 id="step-3-create-your-backup-credentials-in-truenas">Step 3: Create your ba
<p>Head back to the TrueNAS web UI and click on Credentials &mdash;&gt; Backup Credentials. You want to add a new SSH connection.</p>
<p>Choose manual as your setup method.</p>
<p>Fill in as below.</p>
<p><img src="/truenas_ssh.png" alt="backup credentials"></p>
<h4 id="step-4-create-your-zfs-replication-task">Step 4: Create your ZFS replication task.<a href="#step-4-create-your-zfs-replication-task" class="hanchor" ariaLabel="Anchor">&#8983;</a> </h4>
<p>In the TrueNAS web UI, go to Data Protection and expand Replication Tasks.</p>
<p>You&rsquo;ll want to choose your &ldquo;SSH Connection&rdquo; first. Pick the one that you created in Step 3.</p>
<p>Next, choose your source location. You&rsquo;ll want to pick &ldquo;On a different system&rdquo;, then choose the dataset or pool you want to replicate below.</p>
<p>Do the same for your destination, which should be on a local ZFS pool.</p>
<p>If you want to copy child datasets, make sure you check off &ldquo;Recursive&rdquo;. In my case, this dataset doesn&rsquo;t have any children, so I left it unchecked.</p>
<p>If at any point you get the below prompt - make sure you click &ldquo;Cancel&rdquo;. You&rsquo;ll need to hit Cancel twice. We don&rsquo;t need sudo, since we manually allowed our user account to run the needed zfs commands using <code>zfs allow</code>.</p>
<p><img src="/sudo_cancel.png" alt="sudo prompt"></p>
<p>Click Next when you&rsquo;re ready. Choose a schedule. I chose &ldquo;Daily&rdquo;, as it&rsquo;s not a big deal for this dataset if I lose a single day.</p>
<p>And there you have it. You now have a much more secure method of replicating your data from one ZFS pool to another.</p>
<p><img src="/replication_wizard.png" alt="zfs replication wizard"></p>
<h4 id="some-additional-notes">Some additional notes.<a href="#some-additional-notes" class="hanchor" ariaLabel="Anchor">&#8983;</a> </h4>
<ul>
<li>Remember that you&rsquo;ll need to have some snapshots on the source system for this to work. ZFS replication works based off of <em>snapshots</em>, because they are a consistent, immutable reference at a point in time. I recommend setting up automatic snapshot tasks for the datasets you want to back up.</li>
Expand Down
5 changes: 4 additions & 1 deletion docs/tags/linux/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ I wanted to do my replications with an unprivileged user. I wanted the backups t
&lt;p&gt;You need to create a user on each side. On the &lt;em&gt;sending&lt;/em&gt; side, or in other words, your production server, you&amp;rsquo;ll need to add an SSH authorized key, and enable a home directory.
I recommend disabling password login entirely, and disabling samba authentication. You won&amp;rsquo;t be using this user for anything but the backups.&lt;/p&gt;
&lt;p&gt;Create another user on the backup server. I recommend matching usernames, just for clarity, but it&amp;rsquo;s not 100% necessary.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://blog.bladewdr.xyz/truenasuser.png&#34; alt=&#34;user creation panel&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://blog.bladewdr.xyz/static/images/truenasuser.png&#34; alt=&#34;user creation panel&#34;&gt;&lt;/p&gt;
&lt;h4 id=&#34;step-2-assign-privileges&#34;&gt;Step 2: Assign privileges.&lt;/h4&gt;
&lt;p&gt;In order to let this user account run zfs commands without root, you&amp;rsquo;ll need to drop to the shell. There are options in the TrueNAS web UI for allowing certain sudo commands without a password, but it&amp;rsquo;s better to do this on the command line, as it gives you more control over what specific rights your user has.&lt;/p&gt;
&lt;p&gt;On the receiving side, your user needs the receive, create, and mount privileges.&lt;/p&gt;
Expand All @@ -45,15 +45,18 @@ I recommend disabling password login entirely, and disabling samba authenticatio
&lt;p&gt;Head back to the TrueNAS web UI and click on Credentials &amp;mdash;&amp;gt; Backup Credentials. You want to add a new SSH connection.&lt;/p&gt;
&lt;p&gt;Choose manual as your setup method.&lt;/p&gt;
&lt;p&gt;Fill in as below.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://blog.bladewdr.xyz/truenas_ssh.png&#34; alt=&#34;backup credentials&#34;&gt;&lt;/p&gt;
&lt;h4 id=&#34;step-4-create-your-zfs-replication-task&#34;&gt;Step 4: Create your ZFS replication task.&lt;/h4&gt;
&lt;p&gt;In the TrueNAS web UI, go to Data Protection and expand Replication Tasks.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll want to choose your &amp;ldquo;SSH Connection&amp;rdquo; first. Pick the one that you created in Step 3.&lt;/p&gt;
&lt;p&gt;Next, choose your source location. You&amp;rsquo;ll want to pick &amp;ldquo;On a different system&amp;rdquo;, then choose the dataset or pool you want to replicate below.&lt;/p&gt;
&lt;p&gt;Do the same for your destination, which should be on a local ZFS pool.&lt;/p&gt;
&lt;p&gt;If you want to copy child datasets, make sure you check off &amp;ldquo;Recursive&amp;rdquo;. In my case, this dataset doesn&amp;rsquo;t have any children, so I left it unchecked.&lt;/p&gt;
&lt;p&gt;If at any point you get the below prompt - make sure you click &amp;ldquo;Cancel&amp;rdquo;. You&amp;rsquo;ll need to hit Cancel twice. We don&amp;rsquo;t need sudo, since we manually allowed our user account to run the needed zfs commands using &lt;code&gt;zfs allow&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://blog.bladewdr.xyz/sudo_cancel.png&#34; alt=&#34;sudo prompt&#34;&gt;&lt;/p&gt;
&lt;p&gt;Click Next when you&amp;rsquo;re ready. Choose a schedule. I chose &amp;ldquo;Daily&amp;rdquo;, as it&amp;rsquo;s not a big deal for this dataset if I lose a single day.&lt;/p&gt;
&lt;p&gt;And there you have it. You now have a much more secure method of replicating your data from one ZFS pool to another.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://blog.bladewdr.xyz/replication_wizard.png&#34; alt=&#34;zfs replication wizard&#34;&gt;&lt;/p&gt;
&lt;h4 id=&#34;some-additional-notes&#34;&gt;Some additional notes.&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Remember that you&amp;rsquo;ll need to have some snapshots on the source system for this to work. ZFS replication works based off of &lt;em&gt;snapshots&lt;/em&gt;, because they are a consistent, immutable reference at a point in time. I recommend setting up automatic snapshot tasks for the datasets you want to back up.&lt;/li&gt;
Expand Down
Loading

0 comments on commit dd5b188

Please sign in to comment.