Replication Tasks is not really working

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
Hello, I just want to back up my data to an external hard drive, basically by cloning it completely. But somehow, it's not working. I'm facing the following problems:

1. Every time, it gives me an error or a warning because my target volume is encrypted, which can cause issues. So, I removed the encryption from the target volume and enabled encryption directly in the replication task. But then it told me that it can't double-encrypt encrypted datasets. I also removed encryption from the replication task. Now, if I run the replication task, will my datasets remain encrypted even if they're in use and decrypted at the moment? I don't want my data to be in an unencrypted state on the hard drive.

2. I managed to start the replication task without errors now. However, it finished after just one minute. This doesn't make sense because I have over 1TB of data that needs to be backed up. When I check the external hard drive, only 2GB has been used. So, it seems like it only created a snapshot. Why? I want everything to be backed up, not just a snapshot. Also, I don't understand why the replication task is so focused on snapshots. I thought snapshots were a completely separate option.

Maybe someone can clarify things for me... Thank you.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
if I run the replication task, will my datasets remain encrypted even if they're in use and decrypted at the moment?
Replication is at block level from the disk... an unlocked dataset isn't decrypted on the disk, only the reads and writes are going through encryption/decryption.

What will appear on the other side is a block-level match of the source, so will be encrypted (with the same key).

Unless you put the key on the target side, it will not be unlocked.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I don't understand why the replication task is so focused on snapshots. I thought snapshots were a completely separate option.
If you're doing a block-level copy (replication), you can't have the contents of the blocks changing as you're in progress or the target won't be the same as the source.

Due to this requirement (a stable source), snapshots are used (since their content is frozen).
 

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
Ok, I understand. So I need to create a snapshot first. But I get this error:

New alert:
  • Snapshot Task For Dataset "Pool/Nextcloud-Data" failed: cannot create snapshot 'Pool/Nextcloud-Data@auto-2023-08-09_13-00': out of space..
  • Replication "Pool,...,Pool/PiHole-qan33 - External/Replication" failed: Target dataset 'External/Replication' does not have snapshots but has data (e.g. 'ubuntu-22.04.2-live-server-amd64.iso') and replication from scratch is not allowed. Refusing to overwrite existing data..
I do not understand what "out of space" mean, because I have enough space for snapshots on every drive. And I do not understand the second error. I just created the External/Replication dataset. There should be no files on it. So I don't know what the "ubuntu-22.04.2-live-server-amd64.iso" file is. And why I can't replicate from scatch. :(

So complicated for me. I just want a task which duplicate my datasets to my external drive. o_O
 

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
Here is my configuration.
 

Attachments

  • 1691579574053.png
    1691579574053.png
    74.6 KB · Views: 56
  • 1691579604486.png
    1691579604486.png
    590.9 KB · Views: 57
  • 1691579615602.png
    1691579615602.png
    338.7 KB · Views: 61
  • 1691579640034.png
    1691579640034.png
    26.7 KB · Views: 53

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Replication "Pool,...,Pool/PiHole-qan33 - External/Replication" failed: Target dataset 'External/Replication' does not have snapshots but has data (e.g. 'ubuntu-22.04.2-live-server-amd64.iso') and replication from scratch is not allowed. Refusing to overwrite existing data..
Looks like this is due to a replication cycle having completed (maybe failed), leaving content on the target side which is different to the source.

The replication system therefore can't mess with what looks like a modified target side for fear of overwriting valid new data.

Best is to clear it and start again (deleting snapshots on the target side back to the last good one might also be an option if there's too much to catch up with a start from scratch.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I do not understand what "out of space" mean,
Have a look at this one:
 

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
I do not have the "Initialize remote side for once. (May cause data loss on remote side!):" checkbox. For snapshots there are not really much options. I also deleted all snapshots before I started a the new snapshot job. And this affect only the Pool/Nextcloud-Data dataset... and this is the most important one with around 1TB of data. I don't get it.

Edit: And I checked again, if I really have enough space. But I do, right?
 

Attachments

  • 1691581607714.png
    1691581607714.png
    33.6 KB · Views: 48
  • 1691581629884.png
    1691581629884.png
    9.3 KB · Views: 53
Last edited:

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
Ok. I see I can only select for the Replication the target location (External disk). But for the Snapshot I only have few settings and I can't select the target location, where the snapshot should stored. So the default location will then be the same disc that I want to snapshot from. So the "Pool" volume. And on the pool volume I only have 600GB of free storage. But Nextcloud-Data ist over 1000GB. But normally the snapshot is only few GBs big. But the system still requires that I have at least the size of the disc to be backed up still free. Of course, this doesn't make much sense, since a snapshot is usually only a few GB in size.

Can this be? That would be extremely stupid, because then I could not back up my data, although it could theoretically work. A snapshot is only a few GB large anyway!!! Is there a solution for this? This is really quite stupid.. :(
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Snapshots can't be stored anywhere other than the pool in which they are generated (they only contain block pointers and some other metadata... the snapshot contents are blocks in your pool that are probably used in the snapshot and the current version of the filesystem in large part).

You can use the snapshot to move the right blocks around with a replication task.

That's it.

For ZVOLs, to take a snapshot requires that you have the free space equivalent to the ZVOL size... that's probably not what's going on here if I understood you right though.
 

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
For ZVOLs, to take a snapshot requires that you have the free space equivalent to the ZVOL size... that's probably not what's going on here if I understood you right though.
not? But Nextcloud-Data is 1000GB and free Space is 600GB. So of cource this is the problem.

Is there any other way I can backup my data? Or can I just not create backups now and I always take the risk of losing all the data?
Maybe I can backup my pools with Rsync? Is this recommended?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Maybe I can backup my pools with Rsync? Is this recommended?
You can.

Recommended for some things, depending on your objectives.

It can't replicate dataset structures though, so you'll end up with directories instead on the target, with no way to get the dataset structure back if you lose your source pool.
 

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
Ok, I can not. Because I want to backup on a external drive and with Rsync I can only backup via SSH or something which is called "Module". I just want to select the drive I added via USB...

So I think its not possible with Truenas and zfs to backup my data. Its also not possible to create a snapshot of my VM, before I update the VM. This is really bad... :(

If anyone know another solution please let me know, I really need a backup solution. I mean I can change my drives to extend my storage. At the moment I have 2x 2TB M.2 PCIe 3.0 SSDs in use. So I need 2x 4TB. This would cost around 600€. Too much.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Of course you can create a snapshot of your VM. A snapshot is not a copy. It does not take up any space when initially created. Later it takes the space of all the blocks that have been modified for which it is keeping an older version.

@sretalla Why should a snapshot of a zvol behave different from a dataset in that regard?

@Kienaba why is your Nextcloud data in a zvol and not in a dataset?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
zfs snapshot <pool>/<path>/<zvol>@<some-identifier>

Or use the storage section of the UI although I am not sure it is in exactly that place in SCALE - I'm more of a CORE guy. Maybe the datasets section.

So your zvols are virtual machine disks? Of course you need zvols for that. But why run Nextcloud in a virtual machine instead of an app on SCALE or a jail on CORE? VMs for applications are frequently not necessary and way to much overhead. Plus you cannot access the contents of that zvol from outside the VM. It's a single monolithic block device. With a jail on CORE you can see all the files in Nextcloud in the TrueNAS file system.
 

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
I think you are talking about the general snapshot feature in Truenas. But I already wrote in this topic, that this is not working because nextcloud-data is 1000GB and free space is 600GB. Should make no difference, if I run it via console or UI.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Try it in in the CLI and report back. This should work. You do not need the same space twice.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You need to be root.

Code:
sudo su -
zfs snapshot ...
 
Top