this post was submitted on 22 Oct 2024
26 points (96.4% liked)

Linux

8191 readers
136 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 1 year ago
MODERATORS
 

The title pretty much speaks for itself... I have a linux install that I've spent a considerable time configuring, which is unfortunately installed on a drive that's starting to show signs of dying.

My question is: how, if there is a way, can I migrate said linux install over to a different drive, while preserving all the configurations and such.

EDIT: Thank you to everyone who commented! I made the transfer, using dd and it went mostly smoothly, even if it did take a while.

you are viewing a single comment's thread
view the rest of the comments
[–] hendrik@palaver.p3x.de 4 points 1 month ago* (last edited 1 month ago) (1 children)

You should do backups for cases like that. And mind that harddisks might fail and laptops and phones can get stolen, you might want to backup your data regardless if it's important to you.

The trick with 'dd' is to pay attention to the destination. "of=" is the one thing to worry about. If you make a mistake there, it'll overwrite somehing. Everything else isn't as critical. And you can use some graphical interfaces like Clonezilla. It's the same thing there: pay attention to what you're overwriting... But the GUI might make it easier to use an understand what you're doing.

[–] Presi300@lemmy.world 2 points 1 month ago (1 children)

I do have backups, I just don't wanna bother reconfiguring the system and reinstalling everything

[–] hendrik@palaver.p3x.de 2 points 1 month ago* (last edited 1 month ago)

Sure. Just wanted to make sure you have something backed up, just in case something goes wrong. You shouldn't need that anyways. But that's why all the people here recommend 'dd'ing the harddrive. This way you don't need to re-configure or install anything. It'll copy everything and just boot up as before.

Additional advice: Detach unnecessary drives before starting the process. That way you can't overwrite other things and it'll be just one disk to worry about. Buy a new drive that's the same size or larger. Expand the partitions at some point afterwards if it's larger, to access the new space. And after 'dd'ing a whole drive: Don't run the computer with both drives connected at the same time. The partitions will have the same identifiers, as it's an exact copy, and that might lead to confusing situations or the computer reading/writing to the wrong disk. Just detach the old drive after you're done and before booting again. You don't need that old hdd anymore. And use a Live CD / USB-Stick / Clonezilla to do it. Don't 'dd' the system while it's running itself.

I've done it several times. Worked very well each time. And it's not that much of an effort. Get an USB-Stick ready and install the new harddisk, 15minutes of work to get the copying started and then you just have to wait for it to finish, shut down, detach the USB-Stick and the old harddisk and you're pretty much done. It'll come up just as it was, just with a new harddisk inside.