Author Topic: Cloning Win HP to smaller SSD  (Read 1748 times)

0 Members and 2 Guests are viewing this topic.

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Cloning Win HP to smaller SSD
« on: May 30, 2024, 10:12:05 am »
This is a continuation of
Failing Win XP HDD
https://www.eevblog.com/forum/general-computing/failing-win-xp-hdd/
where I managed to successfully clone a 1TB HDD to a 3TB HDD and Win XP runs fine there.

But that 3 TB HDD is for something else and too big anyway so I want to clone the 336 GB Win XP partition to a smaller 500 GB SSD.

So this is what I want to do

Origin:
sda = MBR, total 3TB, HDD
- sda1 : 336 GB NTFS Win XP
- sda2 : 663 GB NTFS Storage
- Empty space : 2 TB

Destination:
sdb : 480 GB, empty, SSD
I want to clone the Win XP partition here.

I did
sudo ddrescue -- force --size 350GB /dev/sda /dev/sdb /home/user/Desktop/mapfile.txt

and after a couple hours it completed the cloning successfully. So far so good.

Now the SSD has the WIN XP 336 GB partition but when it tries to boot it crashes and it restarts the computer and then just crashes again and again.

I thought maybe the second, incomplete partition on the SSD was causing the problem. In Linux it shows a second partition which extends outside the size and boundaries of the SSD. Y tried to delete this (defective) partition but I get the following error:

Error deleting partition /dev/sda2: Command-line 'parted --script "/dev/sda" "rm2"' exited with non-zero exit status 1: Error: Can't have a partition outside the disk!

gparted gives the same error and will not even start.

Well, yes, so now what? How can I make that bad partition just empty space?
I think that might correct the problem and let Win XP start.


« Last Edit: May 30, 2024, 01:25:15 pm by soldar »
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1603
  • Country: ua
Re: Cloning Win HP to new SSD
« Reply #1 on: May 30, 2024, 10:28:34 am »
It's weird that those partition editing tools crash/error out like that.

Try the normal standard "fdisk" (linux). Let's see if it works.
 

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to new SSD
« Reply #2 on: May 30, 2024, 10:45:59 am »
Code: [Select]
sudo fdisk -l /dev/sda
Disk /dev/sda: 447.1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3d1f3d1e

Device     Boot     Start        End    Sectors   Size Id Type
/dev/sda1  *           28  655359767  655359740 312.5G  7 HPFS/NTFS/exFAT
/dev/sda2       655359768 1953523655 1298163888   619G  f W95 Ext'd (LBA)
/dev/sda5       655359796 1953523655 1298163860   619G  7 HPFS/NTFS/exFAT

sda2 and sda5 are bad and need to be deleted.   But how? Now what?
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1603
  • Country: ua
Re: Cloning Win HP to new SSD
« Reply #3 on: May 30, 2024, 10:50:55 am »
Code: [Select]
sudo fdisk -l /dev/sda
Disk /dev/sda: 447.1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3d1f3d1e

Device     Boot     Start        End    Sectors   Size Id Type
/dev/sda1  *           28  655359767  655359740 312.5G  7 HPFS/NTFS/exFAT
/dev/sda2       655359768 1953523655 1298163888   619G  f W95 Ext'd (LBA)
/dev/sda5       655359796 1953523655 1298163860   619G  7 HPFS/NTFS/exFAT

sda2 and sda5 are bad and need to be deleted.   But how? Now what?
Well, 1) make sure you have a backup image
2) sudo fdisk /dev/sda
3) use the interactive command prompt: Command (m for help):
 

Offline Halcyon

  • Global Moderator
  • *****
  • Posts: 5759
  • Country: au
Re: Cloning Win HP to new SSD
« Reply #4 on: May 30, 2024, 11:05:57 am »
Why do we need another thread, that's just a continuation of the other?
 

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to new SSD
« Reply #5 on: May 30, 2024, 11:17:57 am »
Why do we need another thread, that's just a continuation of the other?
Well, sorry, I considered this is a new and different question. The other one was about rescuing a disk going bad and that was done and the thread kind of got muddled with people arguing side issues so I thought it might be better to start a new thread.

This one is a totally different issue which is cloning a good disk to a smaller disk.

But if you feel like merging them I have no objection at all.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline m k

  • Super Contributor
  • ***
  • Posts: 2226
  • Country: fi
Re: Cloning Win HP to new SSD
« Reply #6 on: May 30, 2024, 11:58:39 am »
sudo ddrescue -o 462 --size=16 /dev/zero /dev/sdb

from other thread is how you do it without any hassle.

462 is starting point and 16 is length.
So changing 16 to 32 and you're clearing tables 2 and 3.

You can also edit that earlier created 1st block file by zeroing those above locations.
And then write it back using regular dd.

sudo dd if=/home/user/Desktop/1st_blk.img of=/dev/sda

But using fdisk in interactive way is much better.
Advance-Aneng-Appa-AVO-Beckman-Danbridge-Data Tech-Fluke-General Radio-H. W. Sullivan-Heathkit-HP-Kaise-Kyoritsu-Leeds & Northrup-Mastech-REO-Simpson-Sinclair-Tektronix-Tokyo Rikosha-Topward-Triplett-YFE
(plus lesser brands from the work shop of the world)
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 6215
  • Country: ca
Re: Cloning Win HP to new SSD
« Reply #7 on: May 30, 2024, 12:16:09 pm »
you should have stayed in the same thread
 

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to new SSD
« Reply #8 on: May 30, 2024, 12:21:16 pm »
you should have stayed in the same thread
And who made you moderator?
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5104
  • Country: ro
  • .
Re: Cloning Win HP to new SSD
« Reply #9 on: May 30, 2024, 12:40:07 pm »
It's probably not this but it's worth checking.... it could be something like difference in sector sizes (ex hard drive uses 512 byte sectors while ssd uses 4096 byte sectors or something like that)

I haven't used ddrescue , but I used Macrium Reflect in the past to clone drives to SSDs with different size partitions and had no problems with it.

 

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to new SSD
« Reply #10 on: May 30, 2024, 12:50:07 pm »
OK, using fdisk interactive I did manage to delete the two bad partitions and that left empty space.

Then with gnome-disks I formatted that empty space into a new NTFS partition.

Now Windows XP starts fine. So thank you to those who helped. The problem was the "corrupted" partition, as I had suspected.

At this point I have the 480 GB SSD with two partitions

The OS: 330 GB, 25% used (about 79.7 GB), 75% empty
"Data": 150 GB, 100% empty

Maybe I should quit while I am ahead but I am thinking several reasons why I would like to reduce the OS partition to, say, 160 GB and add that space to the data storage partition. Is there and easy a not risky way to do it?

Because with the OS partition being 150 - 160 GB I could just clone it every so often as a backup and if the SSD fails I can just plug in the backup and boot from there. I think this is a good alternative to just backing up my files.

Another option would be to merge both partitions into a single one taking up the entire disk but I think O prefer the other option. What do you think?

Tangent side note. I hate it that every time I start Linux it resets the clock to its liking and then I have to reset it when I return to Windows. It seems Linux uses UTC and Windows uses local time.



All my posts are made with 100% recycled electrons and bare traces of grey matter.
 


Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 2776
  • Country: gb
Re: Cloning Win HP to new SSD
« Reply #12 on: May 30, 2024, 01:04:14 pm »
Quote
Maybe I should quit while I am ahead but I am thinking several reasons why I would like to reduce the OS partition to, say, 160 GB and add that space to the data storage partition. Is there and easy a not risky way to do it?
Gparted
« Last Edit: May 30, 2024, 01:05:54 pm by themadhippy »
 
The following users thanked this post: amyk

Offline Halcyon

  • Global Moderator
  • *****
  • Posts: 5759
  • Country: au
Re: Cloning Win HP to new SSD
« Reply #13 on: May 30, 2024, 01:05:39 pm »
Why do we need another thread, that's just a continuation of the other?
Well, sorry, I considered this is a new and different question. The other one was about rescuing a disk going bad and that was done and the thread kind of got muddled with people arguing side issues so I thought it might be better to start a new thread.

This one is a totally different issue which is cloning a good disk to a smaller disk.

But if you feel like merging them I have no objection at all.

If it's distinctly different, that's fine. Maybe rename the title to be more specific? Especially since it has a typo in it.
 

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to new SSD
« Reply #14 on: May 30, 2024, 01:29:27 pm »
If it's distinctly different, that's fine. Maybe rename the title to be more specific? Especially since it has a typo in it.

I added "smaller" to the title which I meant to put there initially and is the crux of the matter and describes the issue better.

Could not find a typo though.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to new SSD
« Reply #15 on: May 30, 2024, 01:33:10 pm »
https://www.howtogeek.com/323390/how-to-fix-windows-and-linux-showing-different-times-when-dual-booting/

Yes, thanks, I am aware but I never dual boot and it is never an issue except now that I am using a Linux Live to rescue a Windows installation. As soon as this is finished that computer should not see Linux again.

I like to have separate computers precisely to avoid this kind of issues and MS dirty tricks.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to new SSD
« Reply #16 on: May 30, 2024, 03:23:54 pm »
Gparted

I did manage to do it albeit with a bit of fumbling around.

I am even surprised myself that I have managed to get this far without major mishap because every step was done fumbling in the dark and with trepidation.

Gparted is not so bad bcause of the GUI but the command line ones like fdisk and ddrescue are scary.

Anyway, all's well that ends well so I call this complete.

I will refer to these threads in the future when I clone the OS partition as backup measure.

Many thanks to all for your great help.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to smaller SSD
« Reply #17 on: May 30, 2024, 03:49:37 pm »
Oh, now I remember one more thing abut the warning that Win XP did not support TRIM cleanup (which I do not really understand).  The impression I got is that this will ony become an issue when the entire partition has been written over and then I will need to do this cleaning up and the process depends on the SSD brand and model.

The SSD is Crucial BX500 480GB

Should I install any tool and, if so, how should I use it? Or should I just wait until I need it? A search does not clarify the issue for me.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8331
Re: Cloning Win HP to smaller SSD
« Reply #18 on: May 31, 2024, 01:54:12 am »
Lack of TRIM is not really a problem unless you want absolute fastest performance, which you're not going to need anyway.

Also, that model of SSD is incidentally one that is likely SLC-moddable, probably to 160GB since that's the TLC variant, if you want a lot more endurance.
 
The following users thanked this post: soldar

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to smaller SSD
« Reply #19 on: May 31, 2024, 08:07:47 am »
Lack of TRIM is not really a problem unless you want absolute fastest performance, which you're not going to need anyway.

Also, that model of SSD is incidentally one that is likely SLC-moddable, probably to 160GB since that's the TLC variant, if you want a lot more endurance.

I had to look up the acronyms SLC and TLC. It is something I did not know. I do not think I want to mess with this drive but I would buy a 160GB SLC SSD and clone this install there. 

The thing is that I cannot see that vendors specify the technology of particular drives. How can I know? How can I get a 160GB SLC SSD? I assume Crucial would sell it for about the same price as the TLC 480 GB SSD.
« Last Edit: May 31, 2024, 08:12:17 am by soldar »
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1603
  • Country: ua
Re: Cloning Win HP to smaller SSD
« Reply #20 on: May 31, 2024, 08:39:41 am »
How much writes will this system do? If it's mostly read only, then you won't gain much from switching to the less dense cell technology.

Always keep a sufficiently recent backup image (taken for example with dd from entire drive), that's pretty much all you need. This is even more important than it is with magnetic drives, because SSDs often fail suddenly and completely rather than gradually.

But you will need something to implement TRIM support regardless. I'm not sure there are (still available) tools that can do it under Win XP. Worst case, you can mount the NTFS partitions under linux from time to time and run fstrim manually (some details at https://www.vogons.org/viewtopic.php?t=68421)
 

Offline soldarTopic starter

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: Cloning Win HP to smaller SSD
« Reply #21 on: May 31, 2024, 09:00:53 am »
How much writes will this system do? If it's mostly read only, then you won't gain much from switching to the less dense cell technology.

Always keep a sufficiently recent backup image (taken for example with dd from entire drive), that's pretty much all you need. This is even more important than it is with magnetic drives, because SSDs often fail suddenly and completely rather than gradually.

But you will need something to implement TRIM support regardless. I'm not sure there are (still available) tools that can do it under Win XP. Worst case, you can mount the NTFS partitions under linux from time to time and run fstrim manually (some details at https://www.vogons.org/viewtopic.php?t=68421)

Yes, it is not going to get much use and I am sure this SSD drive is OK but I have already reduced the main partition to 160 GB and I am thinking of changing my backup procedure to having three 160 GB SSD drives and periodically cloning and rotating. That way I always have a recent backup and the drives get even wear. Since I already have the main OS partition be 160GB I can just get a couple more 160GB drives and I would rather get them of better quality unless the price difference is huge. Temporarily I might be using some HDDs I was using for backups. I will be backing up the entire partition and not just my data.

I am also thinking that formatting and cloning the SSD would obviate the need for TRIM. Yes?




All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1603
  • Country: ua
Re: Cloning Win HP to smaller SSD
« Reply #22 on: May 31, 2024, 09:13:21 am »
I have already reduced the main partition to 160 GB and I am thinking of changing my backup procedure to having three 160 GB SSD drives and periodically cloning and rotating.
That's reasonable, but watch out: 160 GB isn't always equal to 160 GB ;)
Meaning, you want to make sure that the main partition's end offset is below the physical size of the destination SSD drives. Since you will be backing up not only the partition itself, but all data (including the partition table, MBR etc.) from the beginning of the drive to the end of the partition, it may potentially be too big to fit on a 160 GB SSD drive. Check that size before you buy any backup drives. You may need to resize the partition first to, say, 140-150 GB.

I am also thinking that formatting and cloning the SSD would obviate the need for TRIM. Yes?
That's an interesting question. I don't know for certain. I'd also like someone to answer this.
 
The following users thanked this post: soldar


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf