Jump to content

What's the best ssd cloning software for linux?

I'm just starting to learn about linux and I can probably google the apps as well, but I would also like to get your opinions. I'll be doing this on my steam deck, so what is the best cloning app or the easiest to us that would work on steamOS?

 

Basically, I already have a m.2 to usb C adapter. The idea is, to have the much cleaner process. I would like to clone the old drive first directly from the steam deck. Once the cloning is successful, that's the time I will open the steam deck and swap the ssd. I already did a lot of setup on it, like stalling emudeck on the micro sd and I really don't want to do it again, if I don't have to.

Link to comment
Share on other sites

Link to post
Share on other sites

For a beginner, Clonezilla as it has a GUI

Gnome disk I BELIEVE only works with Gnome

rsync and dd are terminal tools, which while they are easy to use, may not be best for the newbie. Myself I use dd.

Link to comment
Share on other sites

Link to post
Share on other sites

New Linux user here too (and new to this site) and I'm interested in using rsync or dd to clone the Steam Deck's SSD. Is one method recommended over the other? From what I've read on other sites using dd doesn't seem too complicated.

For the dd method, is it really as easy as connecting the new SSD via an enclosure, finding out the names of the stock SSD and the new SSD and then running the following in the terminal?

 

sudo dd if=/dev/nvme0n1 of=/dev/sda bs=256M conv=sync status=progress

 

I believe "if" would represent the stock SSD and "of" is the new SSD. 

 

Would that script work? Am I missing anything? I would hate to damage anything, 

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, Thomas4 said:

Gnome disk I BELIEVE only works with Gnome

It works outside of gnome too

Link to comment
Share on other sites

Link to post
Share on other sites

I never used Gnome, so I just assumed by the title and never looked into it.

1 hour ago, 10leej said:

It works outside of gnome too

 

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, Palman said:

I believe "if" would represent the stock SSD and "of" is the new SSD. 

 

Aye, "if" is "input file", "of" "is output file".

The downside of dd is it will copy the empty space on a drive/partition too, this is obviously fine when you have optimised a source, from which you are going to crate an image, to have no/minimal "empty" space, but for the purposes of backup things up on a regular basis rsync or tar are better alternatives. 

If your "new SDD" is order of magnitudes larger than the original, then storing images as files is a better idea:

#only once
mkfs.ext4 /dev/sda
mkdir -p /mnt/snapshots
#every time
mount /dev/sda /mnt/snapshots
#make a snapshot
dd if=/dev/nvme0n1 of=/mnt/snapshots/2022-11-30
#or to restore
dd if=/mnt/snapshots/2022-11-30 of=/dev/nvme0n1
#or to use compression (for the "empty" space)
#make a snapshot
dd if=/dev/nvme0n1 | xz -zc >/mnt/snapshots/2022-11-30.xz
#restore a snapshot
xzcat /mnt/snapshots/2022-11-30.xz| dd of=/dev/nvme0n1

 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

First script (oneliner):

makes use of dialog to show progress and , uses pv (pipeview and dd)

(pv -n $1 | dd of=$2  bs=16M conv=notrunc,noerror) 2>&1 | dialog --gauge "Cloning $1 to $2 ..." 10 70 0

second one , just terminal but it does calculate somewhat acurate  ETA and progress (unlike dd's native progress reporting)

#!/usr/bin/env bash
SIZE1=$(lsblk -bdno SIZE $1 2>/dev/null)
SIZE2=$(lsblk -bdno SIZE $2 2>/dev/null)
[[ -z "$SIZE1"  ]]  && SIZE="$SIZE2"
[[ -n "$SIZE1"  ]]  && SIZE="$SIZE1"
pv -per -s $SIZE $1 | dd of=$2 bs=16M conv=notrunc,noerror

screen is from a prev iter of the script:

image.png.9af29d1fa79c26c2a6cbe343ab5a56db.png

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/27/2022 at 12:04 AM, kitnoman said:

I'm just starting to learn about linux and I can probably google the apps as well, but I would also like to get your opinions. I'll be doing this on my steam deck, so what is the best cloning app or the easiest to us that would work on steamOS?

 

Basically, I already have a m.2 to usb C adapter. The idea is, to have the much cleaner process. I would like to clone the old drive first directly from the steam deck. Once the cloning is successful, that's the time I will open the steam deck and swap the ssd. I already did a lot of setup on it, like stalling emudeck on the micro sd and I really don't want to do it again, if I don't have to.

 

Honestly its looks terrifying but if you are simply cloning from disk A to disk B and disk B is the same size or bigger than A I would recommend the basic dd. Its a CLI tool but its so basic and simple that in my opinion is better than a complex alternative that does stuff under the hood for you.

dd syntax is basic:

dd if=/dev/source-device of=/dev/destination-device

and then leave the PC there, it'll just copy your data in the most simple way possible, block by block, from the beginning to the end without trying to be smart about it. Also its available basically everywhere out of the box, even non linux systems like bsd and mac. Just be aware that theres zero progression statistics, your cursor will be stuck until the copy ends and goes back to the shell, thats expected and totally normal, just be patient. There are ways to add progression to dd but the "simple" thing is taken very seriously so its not on by default.

To check what devices you want to copy from and to you can use

fdisk -l

it will show a basic overview of your disks and partitions. Make sure its the right disk / partition, theres zero confirmation, once you press ender dd will start to overwrite data in your destination (remember the simplicity thing?)

You can go advanced on dd but its really not necessary for a simple hdd / ssd copy.

"I dont know what i'm doing here. Do you?"

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/29/2022 at 9:53 PM, Palman said:

New Linux user here too (and new to this site) and I'm interested in using rsync or dd to clone the Steam Deck's SSD. Is one method recommended over the other? From what I've read on other sites using dd doesn't seem too complicated.

For the dd method, is it really as easy as connecting the new SSD via an enclosure, finding out the names of the stock SSD and the new SSD and then running the following in the terminal?

 

sudo dd if=/dev/nvme0n1 of=/dev/sda bs=256M conv=sync status=progress

 

I believe "if" would represent the stock SSD and "of" is the new SSD. 

 

Would that script work? Am I missing anything? I would hate to damage anything, 


Yes, it will work. you can also get if and of as if is the source and of is the destination of the data 😉 In your case it will take all the data from /dev/nvme0n1 and put a copy into /dev/sda.

bs=256M is the block size, the amount of data it will copy in one go. 256M is higher than what I use but its fine for a modern SSD and wont have any issues. In most cases this option only affects the copy speed nothing else.

conv=sync your telling dd to write the data to the disk and to avoid caching at all costs, thats a good option to have during copies.

 

status=progress is what says on the tin, shows you the progress. Not all versions of dd supports this, some versions only show a progress statistics at the end and the cursor keeps blinking "looking stuck" even if you pass status=progress.

"I dont know what i'm doing here. Do you?"

Link to comment
Share on other sites

Link to post
Share on other sites

OS: FreeBSD 13.3  WM: bspwm  Hardware: Intel 12600KF -- Kingston dual-channel CL36 @6200 -- Sapphire RX 7600 -- BIOSTAR B760MZ-E PRO -- Antec P6 -- Xilence XP550 -- ARCTIC i35 -- EVO 850 500GB

Link to comment
Share on other sites

Link to post
Share on other sites

On 12/18/2022 at 7:36 PM, The Hope said:

you realize  partimage is amost useless on any linux system right?

image.png.a781dc366dec6d9161f347683707ba83.png

i think (unfortunatly) ext4 is the most common fs on linux systems, possibly followed by btrfs  and then a combi of Reiser+Xfs

and i dont know if this still holds true for fsarchiver:

image.thumb.png.8b52a627d5e72c07fa0e3bb9955c703d.png

but atleast its allot more usable then partimage

 

and i havent looked into partclone but i saw that the Aur lists :

NTFS-3G as one of its depencies that means that

  • A: hastent ben updated in a while to use ntfs3 instead
  • B: The Aur maintainer should be informed to update his stuff

(as i cant think of any reason to use ntfs-3G (over ntfs3) , and i can give you a million why u should use ntfs3 (over 3G), so i would defenetly argue against using it(=that AUR PKGBUILD in the case of B) for ntfs related stuff (=imaging or storing the image on)ever...

also i have no idea what clonezilla uses in the background but i have used that for some simple stuff that would otherwise be a pain (moving a virtual partition spread over multiple vmdk's to a baremetal partition oa easier to boot clonezilla inside the vmware vm and and attach the physical drive to the vm aswell)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×