October 12

Small reminder about commands

A few thread file transfer:

rclone copy :sftp:/disk_folder/disk_hash_id /the_way/to_target_folder/ --sftp-host=target_host_name_or_ip --sftp-user=your_username --sftp-ask-password --sftp-key-use-agent=false --sftp-shell-type=unix --sftp-md5sum-command=md5sum --progress --transfers=1 --multi-thread-streams=6 --checksum --bwlimit=300M

The single thread file transfer with additional validation:
rsync --progress --checksum --checksum-choice=md5 /disk_folder/disk_hash_id your_username@target_host_name_or_ip:/the_way/to_target_folder/

Aggregated itop stat (very helpful for a debug in some cases):

iotop -aoP

Manual checksums for the file:

md5sum /path/to/file

Look deeper at TCP timeouts and waits:

netstat -napo|grep TIME_WAIT

Check disk info:
qemu-img info disk_name

Create disk from command line:
qemu-img create -f qcow2 new_disk_name 15G

Converting/cloning the disk (It should also fix the dependency on the backing file, which means building a standalone VM)
qemu-img convert -O qcow2 old_with_backing_dependency.qcow2 new_standalone.qcow2

Add the backuing file to already existing disk (or rewrite this file):
qemu-img rebase -u -b /way_to_the_backing/file -F qcow2 /way_to_disk/new.qcow2

Creating disk WITH backing file:
qemu-img create -f qcow2 -F qcow2 -b /way_to_the_backing/file new.qcow2 500G

Resize disk:
qemu-img resize disk.qcow2 +10G

Attach the disk to VM:
virsh attach-disk --domain short_VM_ID /way_to_disk/file --target vdx --driver "qemu" --subdriver "qcow2"

Detach the disk from VM:
virsh detach-disk --domain short_VM_ID --target vdx

Check VM details:
virsh dumpxml short_VM_ID

Show all VMs:
virsh list --all


Copyright 2021. All rights reserved.

Posted 12 October 2025 by admin in category "simple memo

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.