Score:1

Can I replace a laptop's hard drive with an Ubuntu hard drive?

ro flag

I'm planning on getting a newer and more powerful laptop. I have so much data in my current laptop that I don't want to lose. I was thinking of replacing the newer laptop's hard drive with this current one. Is that possible?

in flag
Without knowing anything about the current computer or the next one, all a person can say is “maybe”
Organic Marble avatar
us flag
I've done it successfully, but that doesn't mean it will work for you.
Irsu85 avatar
cn flag
It depends on the laptop. I recently moved from the HP Probook 650 G1 to the 11gen Framework laptop diy. Since the old laptop was SATA only and the new one is NVMe only I could not reuse the SSD
guiverc avatar
cn flag
I've replaced drives from one box and placed into a very different box, and had the system boot up & continue operation as if no change was made. I've also replaced drives from one make/model machine to another of the same **identical** make/model machine & had it fail to operate nicely (*the boxes may have been same make/model but motherboards did have chipset changes so weren't identical*), & even fail to be usable at all. You've provided no specifics on the hardware, thus as I see it only off-topic *opinions* can be provided (see https://askubuntu.com/help/dont-ask) which is *maybe*
guiverc avatar
cn flag
FYI: I did a *move* of system yesterday on a desktop system, it worked perfectly on test boot, not that is matters as I'll reinstall anyway... (non-destructive re-installs can be used; ie. no data gets lost, and *manually installed* packages get auto-reinstalled)
C.S.Cameron avatar
cn flag
Remove any proprietary drivers from the current hard drive before proceeding. Do not try to replace a 2.5" SSD or NVMe with a 3.5" HDD.
nobody avatar
gh flag
And check if the new hardware requires firmware or closed source drivers.
cn flag
My experience: it will work. One thing: your current hard disk if it is a 5400rpm might not be ad efficient ;-) You might be better off using the new hard disk and copy the old one onto the new one;that is fairly simple too. Just requires a sata to usb3 cable/connecter.
Score:1
ua flag

Usually Ubuntu is quite robust and one can just swap drives and it will still work. You may have to adjust the boot order in EFI and make sure that the new computer boots in the same mode (BIOS vs. UEFI) as the old one.

You may also have to install new proprietary drivers, but most stuff should just work as the Ubuntu Linux kernel includes most drivers and doesn't select them based on your actual hardware. So graphics may be in a fallback mode on first boot before you install new restricted drivers.

If you did more complicated customizations in the installation, other things may fail, though. But it's worth a try. And don't forget to make a backup of your data before trying such things.

Ezra Gachomo avatar
ro flag
I'm taking the drive from HP Pavilion DM4 to Lenovo Thinkpad Edge X240. And I've had lots of projects in the HP that I don't want to re-configure or start again.
Elder Geek avatar
cn flag
Well said @allo, especially the last paragraph! +1 for encouraging backup!
ua flag
@ElderGeek I did quite a few migrations to new hardware by just replacing the hard drive. Sometimes one needs to know how to use recovery systems to reinstall the bootloader but the rest usually works. But that's nothing I can promise anyone and while it usually should not destroy data in the home folder it may be a problem for people who aren't experienced to get data off a home folder from a hard drive that doesn't boot a working system anymore. On the Unix&Linux site here I would recommend it more openly, but here the advices must also work for novices who want to do most things in an UI.
Elder Geek avatar
cn flag
@allo I have as well, often successfully! It often works, occasionally I've had issues with specific display cards or NICs over the years. Yes, many prefer a GUI, but the CLI is often more effective (and faster). The rsync commands in my answer are the ones I've used regularly over the years, and just switched systems a couple days ago with that approach. Just because data shouldn't be destroyed simply by moving the drive to another machine doesn't mean it CAN'T happen. I've seen drives get dropped to the floor. Backup is best practice anyway.
Score:1
cn flag

Is it possible? Most things are possible. However, as someone who's worked with computers since the 1980's I would say it's NOT advisable. If you get in the habit of simply moving the old drive with your data on it to a new system, what will you do when the old drive fails, rendering all your hard work inaccessible? It takes far less time and expense to duplicate existing data from a healthy drive than to recover data from an unhealthy one. What you SHOULD do is backup your data and restore it to the new system. In most cases, virtually all the data that's important to you will be found in /home/[your user name]/ and if it turns out you are missing something you will still have it on the old computer AND the backup and can easily rectify the problem. If you move the drive this will not be the case. rsync is a great tool for backing up and restoring data and is available in every linux distribution I've seen in the past several decades.

  1. Determine how much space you need for your backup: du -ch /home
  2. Obtain sufficient space for your backup: This could be as simple as an external drive, or stick, or somewhere in the cloud if you don't mind entrusting your data to someone you don't know. 2a) Most commercially available external drives nowadays come preformatted with NTFS or FAT which have some limitations when it comes to maintaining file attributes. If you wish to maintain all the permissions you'll want to format the drive yourself with a Linux filesystem. I prefer ext4.
  3. Mount your backup target. In any currently supported version of Ubuntu this is usually as simple as plugging in the external device. I you intend to backup to the cloud, consult with your provider to determine how to mount the space.
  4. Backup your data. See man rsync For my purposes it would be something like this:

sudo rsync -aruv /home /media/me/TOSHIBA\ EXT/Backup-rsync/

  1. Restore your data. See man rsync

For my purposes it would be something like this:

sudo rsync -aruv /media/me/TOSHIBA\ EXT/Backup-rsync/home /home

  1. confirm your results

Another benefit of this approach is that you now have a backup that you can easily and rapidly keep up to date. rsync with the -u switch allows rsync to skip files that are still new (unchanged) in the destination directory speeding up the process by a large factor on subsequent runs. A well crafted rsync command can also delete files on the target that have been deleted from the source.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.