Linux Copy a Disk Over SSH with DD
-
This is a really handy command when you need to get an image of a filesystem to a remote machine.
ssh root@hostname "dd if=/dev/sda" | dd of=mydisk.img
-
the dd command is so useful
-
@scottalanmiller said in Linux Copy a Disk Over SSH with DD:
This is a really handy command when you need to get an image of a filesystem to a remote machine.
ssh root@hostname "dd if=/dev/sda" | dd of=mydisk.img
Going to use this today. Do you have to boot into "rescue" mode to do this? Or can you run this right from the live running system that you are copying from?
-
@AdamF said in Linux Copy a Disk Over SSH with DD:
@scottalanmiller said in Linux Copy a Disk Over SSH with DD:
This is a really handy command when you need to get an image of a filesystem to a remote machine.
ssh root@hostname "dd if=/dev/sda" | dd of=mydisk.img
Going to use this today. Do you have to boot into "rescue" mode to do this? Or can you run this right from the live running system that you are copying from?
You can run live. But you definitely want to unmount it if there is ANY possibility to do so. Or go read only.
-
@scottalanmiller can this be used while on XCP-NG host?
-
@krisleslie said in Linux Copy a Disk Over SSH with DD:
@scottalanmiller can this be used while on XCP-NG host?
Can be used on every non-Windows system.
-
if you want to also know the progress you can pipe it to pv, like in the below example
ssh [email protected] "sudo dd if=/dev/nvme0n1" | pv | dd of=/Users/someuser/Desktop/mydisk.img