thin\_migrate(8) System Manager's Manual thin\_migrate(8)

# [NAME](#NAME)

**thin\_migrate**

# [SYNOPSIS](#SYNOPSIS)

```
thin_migrate [options] --source-dev {device} --dest-dev {device}
thin_migrate [options] --source-dev {device} --dest-file {file}
```

# [DESCRIPTION](#DESCRIPTION)

**thin\_migrate** copies provisioned data blocks from a thin device to another device or file. It is designed for cloning a read-only snapshot or thin volume within a live thin-pool. A metadata snapshot is required to read the data mappings.

# [OPTIONS](#OPTIONS)

[**-h, --help**](#h)

Print help and exit.

[**-V, --version**](#V)

Print version information and exit.

[**--source-dev {device}**](#source_dev)

The input read-only thin device to copy.

[**--dest-dev {device}**](#dest_dev)

The output device as the copy destination.

[**--dest-file {file}**](#dest_file)

The output file as the copy destination.

[**-q, --quit**](#q)

Suppress output messages, return only exit code.

[**--buffer-size-meg {size}**](#buffer_size_meg)

Specify the size of the data buffers, in megabytes.

# [EXAMPLE](#EXAMPLE)

Assuming that there's a thin snapshot 'vg/snap' to copy, we must first set the snapshot to read-only:

```


    $ lvchange vg/snap --permission r
```

Next, create a metadata snapshot for running **thin\_migrate**:

```


    $ dmsetup message vg-mythinpool-tpool 0 reserve_metadata_snap
```

Once the metadata snapshot is created, copy the snapshot into another linear or thin volume. The destination volume must have the same size as the source device.

```


    $ thin_migrate --src-device /dev/vg/snap --dest-device /dev/vg2/dest
```

Alternatively, copy the snapshot into a file. **thin\_migrate** can optionally create the destination file if it is not present, or the size of the file will be truncated to match that of the source device.

```


    $ thin_migrate --src-device /dev/vg/snap --dest-file dest.bin
```

Finally, release the metadata snapshot after **thin\_migrate** finishes its job:

```


    $ dmsetup message vg-mythinpool-tpool 0 release_metadata_snap
```

# [DIAGNOSTICS](#DIAGNOSTICS)

**thin\_migrate** returns an exit code of 0 for success or 1 for error.

# [AUTHOR](#AUTHOR)

Joe Thornber &lt;ejt@redhat.com&gt;

Device Mapper Tools System Manager's Manual

---

Document: thin_migrate(8) from thin-provisioning-tools 1.3.4-r3 (Chainguard OS)
