1

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?

10
  • Without knowing anything about the current computer or the next one, all a person can say is “maybe” 😕
    – matigo
    Jan 20 at 14:15
  • 1
    Maybe it will work, but that doesn't mean you should. Best practice is to reinstall the OS with new hardware.
    – Nmath
    Jan 20 at 15:36
  • 1
    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. Jan 21 at 5:09
  • 1
    And check if the new hardware requires firmware or closed source drivers.
    – nobody
    Jan 21 at 10:53
  • 1
    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.
    – Rinzwind
    Jan 30 at 18:50

2 Answers 2

1

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.

4
  • 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. Jan 22 at 10:24
  • Well said @allo, especially the last paragraph! +1 for encouraging backup!
    – Elder Geek
    Jan 30 at 18:36
  • @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.
    – allo
    Jan 31 at 13:23
  • @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.
    – Elder Geek
    Jan 31 at 23:23
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.