this post was submitted on 05 Jul 2023
4 points (83.3% liked)

Software alternatives for Linux

227 readers
1 users here now

This is a sister community to [email protected].

Many members there are computer users who recently moved to Linux from other OSs, Windows in particular. Having established their work and hobbies on a particular software base, they often encounter difficulties trying to find similar software on Linux.

Here you can ask, propose, comment about some software alternative you're looking for.

It's important to be broad-minded when speaking about software alternatives when switching to Linux:

Role of conduct: The same as in Lemmy and Mastodon: in summary, be respectful, no offensive language, no harassment, no spam.

founded 1 year ago
MODERATORS
 

You can clone a drive from one machine to another using "dd" and netcat (nc)

Caveats:

  • The commands should be run a root

  • Data on the destination device will be overwritten, so double-check that you get the right one (maybe check with "lsblk" etc)

  • The drive on the destination machine must be at least as big as the source

  • The data on the source device should not changed while it is being cloned. Make sure it has no mounted partitions (it's a good idea to boot from USB). Ditto the destination drive

  • The source machine must be able to reach the destination on the port specific (not blocked by firewall etc)

  • Data is sent unencrypted over the network, so make sure you get the right destination and your network is trustworthy/secure (you could so this over the internet - firewall rules permitting - but I wouldn't recommend doing so with a drive containing sensitive data and it is going to eat up bandwidth/data-cap)

The process....

On the machine with the destination drive, run the following (where 11111 is a TCP port the machine will listen on, and /dev/sdd is the device that will be cloned to. Data will be sent in 1M blocks).

nc -l 11111 | dd of=/dev/sdd status=progress

This will begin listening for data on port 11111

On the machine with the source drive, run the following (where 192.168.1.2 is the IP address if the destination machine, /dev/sdb is the drive being cloned from, and 11111 is the port you used above)

dd if=/dev/sda status=progress bs=1M | nc 192.168.1.2 11111

You should see progress on both hosts as the drive from machine to the other

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago

Note also you could use gzip/gunzip to compress the data before it goes over the network, i.e.:

Dest:

nc -l 11111 | gunzip -c | dd of=/dev/sdd status=progress

Source:

dd if=/dev/sda status=progress bs=1M | gzip -c | nc 192.168.1.2 11111