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 (1 children)

You can also use a file instead of a device if you want to write your image to/from a file

Writing a compressed image at the destination

nc -l 11111 | gzip > /path/to/backup.img.gz

Reading a compressed image at the source and sending uncompressed data over the network (can be cloned directly over drive at the destination, within the original constraints). Please note this will not show a progress status at the source:

zcat /path/to/backup.img.gz | nc 192.168.1.2 11111

Or you could just send the compressed-image data over the network and decompress at the destination (as per the second example}:

dd if=/path/to/backup.img.gz status=progress bs=1M | nc 192.168.1.2 11111

[–] [email protected] 1 points 1 year ago (1 children)

what about clonezilla? does it have more safe guards and functionality?

[–] [email protected] 1 points 1 year ago

I've never used that particular software so I couldn't say. Unless you're sending over the internet this method should be fairly safe though