Copying old HDD to new HDD via USB

Having followed along on a thread regarding an HDD failure, I have a system with FreePBX 15 distro installed and working well. I forgot to replace the old HDD with a new solid state HDD and my options are,

Install New and restore backup requesting a new Zend reset or

Copy the old drive to the new drive and hopefully make the new drive bootable. One big issue I have, and it may not be an issue, is that my FreePBX box, as well as anything else I have, only has one SATA port. Go figure… well, I have a dell with two SATA ports but I simply don’t have the hard drive to hard drive type cable this connector on the MB supplies. Looks just like the rear of a SATA drive. So my only alternative is hooking up the SSHD via USB and an adapter.

I tried Clonezilla, had it copy the MBR and etc, but the new SSHD just booted to a Grub prompt and I have no experience with GRUB or what to enter to boot the box or make it work/boot permanently.

SO… my question is; what cloning software will work with a HDD/SSDD via USB and without further messing around to allow the new drive to boot as it should. OR, has anyone used Clonezilla and had a new drive boot normally?

Or go thru the time to reinstall on the new drive and do a restore.

Thanks so much!

John

look into Mondoarchive if the system is working

Im not sure how you did the clonezilla thing, but just a local drive to local drive has yet to fail for me , even if they are only ‘local’ by a long stretch of the imagination :wink:

If the probem remains try using images a third party machine (can be in the cloud)

Thanks Dicko!

I basically just used the dummy beginner prompts to do a local disk to local disk and had Clonezilla copy the MBR. And yes the system was operational. One thing was Clonezilla couldn’t ID the SSHD as it was brand new but still copied everything… just no boot. Anyway, I’ll look into Mondo.

John

https://www.supergrubdisk.org/

If you can, disable anything efi related in your bios.

If you buy a Samsung SSD, you’ll be able to use Samsung’s Data Migration Software. It’s worked 75% of the time for me. I did have the same problem as you once, it just booted to GRUB and quit. I copied the drive again and it worked fine.

Something like this would be very helpful to you:

Here’s what I do:

  • shut down the pbx, pull the original drive out.
  • hook up the old drive and the new drive to any computer (preferably with USB3)
  • run Samsung Data migration software, clone old drive to new drive
  • pop new drive into pbx and fire it up. Keep the old drive as your backup.
1 Like

Sixth or seventh time is a charm! I don’t have a clue as to why it worked. Accepted all the defaults as I did several times prior, set it up the same way and it booted just fine. Used G-Parted to extend the main partition and it’s happy. I swear I have no clue what changed.

Thanks you guys!

For the future, if you have a flash drive that’s as big or bigger than the hard drive, this is trivial using a Linux Live CD or USB stick. For the following examples, I’m going to assume sda is your hard drive and sdb is your flash drive.

[Boot from media and at root command prompt]
dd if=/dev/sda of=/dev/sdb bs=1M
[This dumps the hard drive to the USB drive. Shut down, swap drive, then dump the flash drive to the new drive.]
dd if=/dev/sdb of=/dev/sda bs=1M

Since DD does a bitwise copy, should work perfectly to clone one drive to another. It’s even easier when using a device that has 2 SATA ports or a SATA->USB cradle for your second drive; only one copy is needed as you’re not using a flash drive as an intermediary. It’s also a fantastic way of creating a full backup of everything on a device - OS, boot sector, MBR, partition table, data - literally everything. :slight_smile: (dd also has conv options which allow you to skip over bad sectors, so you can clone disks which are in the process of failing.)

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.