tasket / wyng-backup

Fast backups for logical volumes & disk images
GNU General Public License v3.0
251 stars 16 forks source link

Cannot receive to a different LV name #177

Closed alvinstarr closed 9 months ago

alvinstarr commented 10 months ago

I have an LV called home. The system I want to restore on also has an LV called home so I must use --save-to. I can do --save-to= and it works but trying to save to new thin LV fails. I have tried --save-to=/dev/newstorage/newhome and I get: Cannot create new volume from ambiguous /dev path. Please create the volume before using 'receive', or specify --save-to=volgroup/pool/volname in case of a thin LVM volume. if I create newhome I get: !! This will erase all existing data in /dev/newstorage/newhome !! Are you sure? [y/N]: y Cannot create new volume from ambiguous /dev path. Please create the volume before using 'receive', or specify --save-to=volgroup/pool/volname in case of a thin LVM volume.

If I use --save-to=newstorage/testpool/newhome I get" Traceback (most recent call last): File "/usr/local/bin/wyng", line 4699, in <module> count = receive_volume(storage, aset.vols[dv], select_ses=options.session or "", File "/usr/local/bin/wyng", line 3922, in receive_volume save_type,_,_,_ = LocalStorage.parse_local_path(ldir := os.path.dirname(save_path)) File "/usr/local/bin/wyng", line 1438, in parse_local_path abspath = os.path.abspath(localpath) File "/usr/lib64/python3.9/posixpath.py", line 380, in abspath cwd = os.getcwd() FileNotFoundError: [Errno 2] No such file or director

Am I missing something?

tasket commented 9 months ago

Hi @alvinstarr .

I am pretty sure the --save-to option doesn't support thin LVs as its similar to 'save to file'. If you don't want to receive to an image file, there are workarounds such as temporarily renaming the archived volume (e.g. wyng rename) before the receive procedure. Otherwise, you could rename the local LV temporarily (or snapshot it) and then receive to the original volume name.

Additionally, if the existing LV and the archived volume are related (one was derived from the other at some point) you could make the receive more efficient with Wyng's --sparse or --sparse-write option by first creating a local snapshot of the LV and then receive into either the original LV or the snapshot (which one would depend on the name of the archived volume at the time you ran receive).

alvinstarr commented 9 months ago

I had not thought of renaming. Thank you.