linux_truenas_scale_change_dataset_name
TrueNAS move dataset to another dataset
Moving data from one dataset to another within TrueNAS can be accomplished through a few methods, as the TrueNAS GUI does not provide a direct “move” function for data within datasets.
1. Using the Command Line Interface (CLI) via SSH:
This method offers the most direct control and is often the fastest for large amounts of data.
- Connect via SSH: Access your TrueNAS system using an SSH client.
- Navigate to the datasets: Use
cdto navigate to the parent directory of your datasets. - Copy the data: Use the
cpcommand to copy files and directories from the source dataset to the destination dataset. For example, to copy all contents frompool/old_datasettopool/new_dataset:
Code
cp -r /mnt/pool/old_dataset/* /mnt/pool/new_dataset/
The -r flag ensures recursive copying of directories and their contents.
- Verify the data: Confirm that the data has been successfully copied to the new dataset.
- Remove the old data (optional): Once verified, you can delete the data from the old dataset using
rm -rf. Be extremely cautious with this command, as it permanently deletes data.
2. Using ZFS Commands (for entire datasets or snapshots):
zfs rename: If you want to rename an entire dataset or move it to a different location within the same pool hierarchy (e.g., making it a child of another dataset), you can usezfs rename.
Code
zfs rename pool/old_dataset pool/new_parent_dataset/new_dataset_name
zfs sendandzfs receive: For replicating or moving entire datasets, including snapshots, you can usezfs sendandzfs receive. This is particularly useful for moving datasets between pools or even different TrueNAS systems.
Code
zfs send pool/old_dataset@snapshot_name | zfs receive destination_pool/new_dataset_name
linux_truenas_scale_change_dataset_name.txt · 最后更改: 由 packingbox
