Tag: duplicate

Duplicate partition table in ubuntu

Duplicate partition table in ubuntu

Note: Haven't got chance to test this.

Duplicate partitions

sfdisk -d /dev/sdX > part_table
sfdisk /dev/sdY < part_table

This will keeping the same disk & partition IDs, mainly for backup and restore partition purpose.

Generate new partition IDs

grep -v ^label-id part_table | sed -e 's/, *uuid=[0-9A-F-]*//' | sfdisk /dev/sdY

References

How to copy the partition layout of a whole disk using standard tools

TODO: Move dataset to another zpool in TrueNAS

Move dataset to another zpool in TrueNAS

In Synology, move share folder to another volume is quite easy, can be done via UI interface. In TrueNAS, I could not find such task can be selected.

Duplicate dataset from snapshot

The workable solution is utilize the zfs command to duplicate in SSH environment, then export old pool and import new one.

First make a snapshot poolX/dataset@initial, then use following command duplicate zfs dataset snapshot to new zpool.

zfs send poolX/dataset@initial | zfs recv -F poolY/dataset

Update new dataset

Then make another snapshot poolX/dataset@incremental, then use following command update zfs dataset snapshot to new zpool.

zfs send -i initial poolX/dataset@incremental | zfs recv poolY/dataset

Activate new dataset

To make the new dataset usable, rollback snapshot needs to be performed for new dataset.

Update share

Change shared point to use new pool.

Update client

This is only required if client used server filesystem structure, such as NFS.

References

Migrate to smaller disk
*Note: pv (Pipe Viewer) command is not installed in TrueNAS by default.