r/linuxquestions • • 8d ago

Support Could someone help be clone my drive?

I am currently running fedora linux on a 1tb hdd and kept my windows on my 250gig ssd just in case something goes wrong. After a year of this I wiped my ssd and will transfer everything from hdd to the ssd. Now i have cleared my hdd and i have about 200 gigs of data on it so its small enough to fit on the SSD but i have no idea how to do this and from what I saw online its complicated to switch from a bigger drive to a smaller one.

0 Upvotes

16 comments sorted by

1

u/3grg 8d ago

There are two ways to look at this. Pick the most convenient.

Clonezilla Live can clone a larger drive to a smaller drive, but it is a little complicated.

https://drbl.org/fine-print.php?path=./faq/2_System/119_larger_to_smaller_disk_restore_clone.faq#119_larger_to_smaller_disk_restore_clone.faq

https://www.youtube.com/watch?v=Fk5dtd_T3IU

The other option is to simply reinstall Fedora to the SSD and transfer files once you get it setup the way you want it.

If you were going from smaller to bigger it is a little easier, but either way you can get it done.

1

u/Madhav_Lamba 8d ago

I just made a fresh install of fedora and transferred my files that seemed to have worked thank you

1

u/3grg 8d ago

Sometimes that is the quickest and easiest!

1

u/ScratchHistorical507 8d ago

The most future-proof way is to not clone the drive, but copy over the files. Sure, you can just clone the file system, though going to a smaller drive is a bit complicated. But cloning the file system may also clone issues with it. Just create a new file system on the SSD and use rsync to copy all files over. That way you can make sure the file system is in pristine condition. Also, you should erase the SSD while you format it. That way, all flash cells are being touched, so the controller can check if they are still usable or need to be marked as defective before they corrupt any data.

1

u/Madhav_Lamba 8d ago

I did that, thank you

2

u/billhughes1960 8d ago

Look into rsync. A line as simple as:

rsync -axXH --delete --ignore-errors /SOURCE /DESTINATION

1

u/ScratchHistorical507 8d ago

--ignore-errors

I'm sorry, but have you lost it? That's exactly the wrong option you want in this situation. That's just how you create weird issues unnecessarily difficult to debug down the road.

1

u/billhughes1960 8d ago

Ok. Fine. You do you. But I'd be able to take your comment more seriously IF you had offered a solution of your own.

I bet you're LOADS of fun at parties.

1

u/ScratchHistorical507 8d ago

The solution is obvious from my comment. Just leave that option out.

I bet you're LOADS of fun at parties.

Thanks for confirming that your IQ must be somewhere close to room temperature...

1

u/billhughes1960 8d ago

I misunderstood! You LIKE my suggestion; we're just quibbling over the arguments. Thank you.

1

u/ScratchHistorical507 7d ago

The general suggestion of course. I don't see any benefits in trying to clone the drive on a block device level, only potential issues. But as the data is supposed to be moved permanently to the SSD, which means it will be deleted from the current drive, you want all the errors to be reported that may lead to data not being stored the same way it is right now.

1

u/billhughes1960 7d ago

This should have been your first reply.

There are a million options for rsync. I have extensively tested mine and feel comfortable with them.

No one appreciates being asked if they've lost their mind for trying to help someone.

1

u/ScratchHistorical507 7d ago

It was made obvious enough in my original comment. Or why do you think the quote only contained that one option?

1

u/DrozdMensch 8d ago

Clonezilla

1

u/Few_Care_1657 8d ago

Zmniejsz partycję do wielkości małego dysku, a potem użyj Clonezilla.

1

u/MintAlone 8d ago

Booting from a usb install stick for fedora you can run gparted or kparted to copy the partitions on the HDD to the SSD. You may have to shrink the partitions before you copy to fit on the SSD. Remove the HDD before trying to boot the SSD as the partitions on the SSD will have the same UUIDs as on the HDD. Take a backup before you start.