LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to clone hard drive that has windows and linux on it? (https://www.linuxquestions.org/questions/linux-software-2/how-to-clone-hard-drive-that-has-windows-and-linux-on-it-4175617230/)

sdowney717 11-08-2017 03:56 PM

How to clone hard drive that has windows and linux on it?
 
Simply clone, make an exact duplicate so it boots.
Would redo backup work?

Going to try clonezilla stable

jefro 11-08-2017 07:15 PM

Can't really offer 100% solution.

I think I'd look to the hard drive OEM site and see if they have Acronis. It is a good product and usually free if you own one of a few drives.

I've used redo and clonezilla. Both have had issues with other users.

Microsoft has a dedicated way to clone. Don't forget that you may have some recovery area that you need to clone.

Some users use a command dd. It can work too but don't make any mistakes with it. There is no opps button.

sdowney717 11-09-2017 03:54 AM

Clonezilla complete failure. Neither the win7 or the ubuntu cloned drive could boot.
Win7 cant start and ubuntu complains about dates and is in emergency mode.

Hitting a wall here.

sdowney717 11-09-2017 05:21 AM

https://www.backup-utility.com/download-iso.html

Trying this from a running windows 7. It does see the ext 4 partitions.
I have used this to clone win10.

IsaacKuo 11-09-2017 06:00 AM

Assuming the target drive is at least as big as the source drive, a simple "dd" command will work.

http://forums.justlinux.com/showthre...CD-to-clone-XP

Basic steps are:

Code:

1) Use "fdisk -l" to confirm the identity of the source and target

2) Use the following command, adjusted for the device identities you need:

dd if=/dev/sda of=/dev/sdb bs=32256

This will do a complete clone of the drive, which will take a really long time, but it will work. It clones everything...the partition table (if any), UUIDs, partitions, file systems...everything.

If the target drive is smaller than the source drive, you will first need to use a partitioner like gparted to resize/move partitions down to a size that will fit entirely within the first N bytes (where N bytes is the size of the destination drive).

In practice, the dd clone is very slow...it's so slow, that it can easily make sense to first resize/move the partitions to squeeze them down to a much smaller size (if possible). And then you use a dd command which only copies the first N*32256 bytes. And then you use a partitioner to expand the partitions afterward.

dd if=/dev/sda of=/dev/sdb bs=32256 count=99999 (replace 99999 with the desired byte count divided by 32256)

Note that resizing a Windows partition is generally best done from within Windows itself.

sdowney717 11-09-2017 11:11 AM

That also failed. Actually I give up. Simply going to use a different PC to do the cloning and Macrium reflect.
I really thought I had cloned grub with ubuntu and a windows partition and was able to boot it in a prior life, lol.

Actually this was more of an experiment, which is not working well.

I had lost win7 after upgrading to win10 on another PC. And I cloned the win10 drive using Aomei, then using the cloned drive tried to revert the os to win7, but windows kept saying I could not go back to win7 annd it has been 6 days only. So after sleeping on it, I put the original drive back in and win10 said I can go back, go figure.

My idea was if I could not get win7 again, to clone it off this other PC, but that just does not work at all.
Meanwhile I had erased the clone of win10, so I am redoing the clone of win10 using Macrium. And anyway eventually I think it will work out.

IsaacKuo 11-09-2017 03:03 PM

The Windows install of the cloned drive will only work on the original PC. You can sometimes migrate a drive from one computer to another of the same model, but this is pretty iffy. Microsoft does not want you to be able to clone a Windows install from one computer to work in another computer.

dave@burn-it.co.uk 11-10-2017 07:48 AM

It has got little to do with MS not wanting you to do it, the chances of it being successful depend on the two machines being ABSOLUTELY IDENTICAL and that includes the clock.
Part of the installation process involves reconfiguring the software to match the hardware, and if there is the slightest difference the results will be different.
I know, I tried setting up all the machines for a brand new company that wanted 32 identical machines. I hoped to do one and clone that to the rest, but it did not work. There IS a tool that allows much of the install to be copied, but it still equires some individual setting up on each machine.

syg00 11-10-2017 07:58 AM

Don't fight the beast. M$oft has it's own system image/backup tool - works ok, if somewhat slow. Sort that out, then do linux which is (much) more accommodating. I simply copy my Linux(s) - cp, rsync, whatever. Then maybe fix fstab and grub, and off you go.

KISS.

IsaacKuo 11-10-2017 08:43 AM

Quote:

Originally Posted by dave@burn-it.co.uk (Post 5779030)
It has got little to do with MS not wanting you to do it, the chances of it being successful depend on the two machines being ABSOLUTELY IDENTICAL and that includes the clock.

This has everything to do with Microsoft. They made a conscious decision to make Windows Me (and all subsequent Windows OS products) resistant to piracy by disk cloning. Windows 98SE would happily boot if you cloned a drive and installed the clone in another computer. It wouldn't care if the second computer had a completely different configuration. It would do its best to boot up, obviously to Safe Mode if the required drivers were not already installed.

This was great for computer stores because builders could easily just set-and-forget disk copy to install Windows 95/98/98SE on new builds. Obviously, it was easy to set up custom boot screens, backgrounds, installed applications, etc.

But it also made it dead easy for people to pirate Windows. I can understand why Microsoft changed things in order to do something about software piracy, and I don't fault them for this particular scheme (now, that darn Registry contraption, on the other hand...)


All times are GMT -5. The time now is 04:56 AM.