thin_migrate(8)

πŸŽ€ thin_migrate(8) πŸŽ€

okay so bestie, thin_migrate is the manual page for the thin_migrate tool, and it is lowkey the most iconic way to clone stuff in a live thin-pool πŸ’…


✨ NAME ✨

thin_migrate

🧚 SYNOPSIS ✨

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

πŸ’– DESCRIPTION ✨

okay so thin_migrate copies provisioned data blocks from a thin device over to another device or a file πŸ¦‹ it was made for cloning a read-only snapshot or thin volume while the thin-pool is still live, no cap.

⚠️ bestie, you NEED a metadata snapshot before this works, because that's how it reads the data mappings πŸ™ˆ

🌸 OPTIONS ✨

  • -h, --help β€” shows the help text and exits 🫢
  • -V, --version β€” shows the version info and exits ✨
  • --source-dev {device} β€” the input read-only thin device you want to copy πŸ’œ
  • --dest-dev {device} β€” the output device that becomes the copy destination πŸ“
  • --dest-file {file} β€” the output file that becomes the copy destination 🌈
  • -q, --quit β€” hushes all the output messages so you only get the exit code 🀫
  • --buffer-size-meg {size} β€” sets how big the data buffers are, in megabytes πŸ”₯

πŸ¦‹ EXAMPLE ✨

okay so say there's a thin snapshot vg/snap you wanna copy πŸ‘€ first thing, you have to make the snapshot read-only:

$ lvchange vg/snap --permission r

next up, make a metadata snapshot so thin_migrate can run πŸ’…

$ dmsetup message vg-mythinpool-tpool 0 reserve_metadata_snap

once that metadata snapshot exists, copy the snapshot into another linear or thin volume. the destination volume has to be the same size as the source device, bestie, so don't mess that up 😭

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

or, if you'd rather copy into a file, you can do that too 🧚 thin_migrate can optionally make the destination file if it isn't there yet, or the file gets truncated so it matches the source device size.

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

last but not least, once thin_migrate is done with its job, release the metadata snapshot so you're not leaving it hanging 🫢

$ dmsetup message vg-mythinpool-tpool 0 release_metadata_snap

πŸ’€ DIAGNOSTICS ✨

okay so thin_migrate returns an exit code of 0 for success or 1 for error. that's it, that's the tea 🍡

πŸ‘‘ AUTHOR ✨

the iconic creator is Joe Thornber <ejt@redhat.com> 🌟


thanks for hanging with me bestie 🌈 this was the Device Mapper Tools page for thin_migrate(8) from the System Manager's Manual, and I'm obsessed with you for reading it πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from