Advice needed how to migrate a dual boot install to a MSATA drive.

Dear all,

I am planning to exchange the hard disk of my laptop for a MSATA drive. I have a Open Suse 13.2/Windows 7 dual boot install.
I see a potential problem in the fact that the Msata will be twice the size of the current hard drive.
I know that one can use the dd tool of linux to clone a hard drive. However, I am not sure what will happen to the dual boot and how to tackle the difference in drive size.
Therefore, I decided to ask the experts here for advice. I would much appreciate your advice. I have no experience with such type of problems.
Thank you in advance.

Please post output from:

sudo parted -l

so we have partitioning information to work from. What to suggest can depend largely or entirely on the starting point.

thank you for our reply. I apologize for the delay, but just now managed finally get home and boot the laptop.
The requested output is

sudo parted -l
Model: ATA ST320LT007-9ZV14 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  106MB  105MB   primary   ntfs            boot, type=07
 2      106MB   126GB  126GB   primary   ntfs            type=07
 3      126GB   320GB  194GB   extended                  lba, type=0f
 5      126GB   174GB  48.3GB  logical   ext4            type=83
 6      174GB   314GB  140GB   logical   ext4            type=83
 7      314GB   320GB  6225MB  logical   linux-swap(v1)  type=82

This looks very good for what you intend to do.

From the output that you posted, on your “old” internal HDD you have a disk label (or partition table) of type ‘msdos’, which could have been expected, because you have a dual boot with windoze 7.
This means that you can not have more than 4 primary partitions, and that the mass storage device that you want to use (in this case your new SSD) can not have a capacity of more than 2TB. Presuming now that it does not have more capacity. Right? (you didn’t give no exact information about that)

Now the question is, how to copy.

It is a very good idea to not carry out the copy from a system that is running (means to not boot your 13.2 and do the copy from there).
So if you want to use ‘dd’, then you need to boot a Linux from a device that is not your old hard disk drive (the one with openSUSE 13.2 - I still love 13.2!).

There are 2 possibilities:

(1) You have another PC/laptop running a Linux where you can physically plug both devices (HDD and SDD).
(2) You have a USB stick of the size of 16GB (that is sufficient, more would not stand in the way) the contents of which are backed up elsewhere, and on which you could install 13.2, or Leap 15.1, e.g., and from which you can boot.

What do you prefer?

Forgot to say for case (2):
If you can’t plug both, the old HDD and the new SDD in your laptop at the same time, while booting from an USB stick, then you need external storage (like an external USB HDD) with free space of at least the size of your (old) HDD.

Assuming your laptop can even boot to MSATA, and the MSATA is not larger than 2TiB, there are several ways to proceed. The cloning should be the easy part. Once cloned, the original becomes a backup, so you can start all over from scratch and a fresh cloning if your repartitioning goes haywire.

With the clone I could try this first:
1-delete the swap and / partitions
2-move the home partition updisk to make room for a larger /
3-create a new / as a primary
4-create a new swap, either before home, or at the end of the disk
5-enlarge home to absorb the remaining freespace
6-install 15.1 on the new primary

Unless, you’d like to have more than one Linux partition, such as if you’d like to be a beta tester of upcoming releases, without having any impact on your normal operations. In that case I’d create two partitions for root filesystems between Windows and home.

Another option would be to take the opportunity to convert to GPT partitioning. I would do that as step 3, after the deletes and move.

The advantage of cloning disks one to one is that the UUIDs remain the same.
So windoze 7 may not conclude that it’s another installation of the same system.

Of course, cloning the (old) disk in this way, it can no longer be used as a second hard disk (because of the duplicate UUIDs), unless partitions are deleted and recreated, but it could still serve as a backup, as you said

I used this simple method of cloning with success when I copied the contents of a failing HHD with windoze 7 to a new HDD.
I did not want to change the type of partition table then, and I think that john_snow does not have an urgent need to change partition table type to ‘gpt’ now on the kind of hardware that he/she might have (whatever exactly that hardware is).

Hi
Any reason not to upgrade to Windows 10 (free upgrade from Windows 7)? What about fresh installs?

First of all I would like to thank you all for all the answers, the useful comments and the suggestions.
I plan to use a MSATA drive as an exchange for the old mechanical hard drive.
The size of the MSATA will be 500 gb. That is, I would go from 320 gb to 500 gb drive. In my laptop (lenovo x220) I have the possibility to plug both the HDD and the MSATA at the same time. I presume that this option is the simplest, since I don’t have to use any additional equipment. I can also easily find a 16 gb USB to install Suse 13.2 on.
Concerning the comment about windows 10 update. I don’t pan to do that for the time being. I guess that this will mess my dual boot and for what I am doing windows 7 is just fine.

And of course openSUSE Leap 15.1. Why stick to the very outdated 13.2?
You mention installing 13.2. You may still have the ISO image, but I assume all repos for bringing it to it’s end situation (2017-01-17) will be gone already.

I am willing to update the SUSE version to 15.1. Unfortunately during my last update from 13.1 to 13.2 grub stopped working and since then I am a bit afraid to update. I have to check the documentation how the update to 15.1 is done. In the past I used just to rename the repositories and then run update. If the update is easy to do, I can just use the same usb to copy the drives later.
In general, is the latest version of open suse really needed for the drive copy/cloning. I assumed that for this task I need only a few command line tools.

I think you must be aware of the fact that on the question “Advice needed how …”, you will get several answers from several people, each with their own ideas and preferences.

I e.g. would never do this with “cloning”. I would do this with fresh installs on the new disk (of course restoring my user’s data (not by e.g. "cloning /home, but by ofload and restore of the files).).

I would also not even try to make such a bit jump from 13.2 to 15.1 by changing the repos and zypper dup.

But that is just me. And saying that, I will not give any advice on the MS Windows side of this, because I do not use it and have no idea.

Thank you for the reply. I presumed that this type of disk clone can be done. Now I see that it is more complicated. I really don’t like to do fresh installs. If possible I would like to just clone the drive, with the part of fixing the different sizes remaining.
Since I can plug both drives to the same machine, copying with some linux tool looks promising to me.

Hi again!
What do you mean with later?

The plot would be the following:
(1) Install openSUSE (probably Leap 15.1, more on that below) on the USB stick. Then you have TWO installations of openSUSE, 13.2 on your HDD, and 15.1 on your USB stick.
(2) Boot from USB stick an check that Leap 15.1 works well (another reason to install Leap 15.1 on the USB stick instead of 13.2).
(3) Copy the contents of your HDD (including all partitions / installations) to the SSD.
(4) Shut down an unplug HDD.
(5) Boot from USB again and use gparted (to be installed under 15.1, and under 13.2 as well) to check if the extra space on your SSD is recognised, and try to create two additional partitions in your extended partition (partition number 3 in your output from “parted -l”) that take this extra space (which was not present on the HDD).
(6) Try to boot from SSD.
(7) Use the same 15.1 installer to install 15.1 in the two additional partitions (serving as / and /home) that were created in the extended partition on your SSD.
Result: Triple boot windoze 7 / openSUSE 13.2 / openSUSE Leap 15.1 .

You may later use the two partitions of openSUSE 13.2 to make a fresh install of Leap 15.2 when this will be available, if you like.

So it would be: firstly installation of 15.1 on USB, then copying, secondly installation of 15.1 on SSD, no update.
If you would like to have it that way.

Well, to have gparted installed is in general very useful, especially if you’re no professional on the command line, because gparted provides a graphical user interface.
And you probably would want to have a recent version of gparted.

As well as a recent version of firefox, for the case that you want to use a browser and access the internet from the openSUSE that is to be installed on the USB stick.

So, Henk is right:

I’ve been a bit too quick with my earlier suggestion to install 13.2 on the USB stick, I have to admit.
For the command line tools as such, 13.2 may be OK, and the dd command didn’t change much since, but for the other things …

And you don’t like updates either … but you should be aware of that it’s really not secure to use an outdated browser or have an outdated system exposed to the internet?

OK, so you probably could need a bit of guidance installing Leap 15.1 on the USB stick, right?

This looks promising to me. I would probably skip installing 15.1 for the time being and just use it for the file copy part. If understand this correctly, from the command line of the live usb I have to run dd. However, having multiple partitions, I am not sure how exactly is this going to work? I guess that it is not just

dd if=/dev/sdb1  of=/dev/sdc1 

Where sdb1 is the mechanical drive and sdc is the msata. Actually I don’t plan to format or reuse the old drive and will keep it as backup.

In the past I did all the updates from the command line by zypper update. This worked and all the files i had were unchanged. Is something like this possible going from 13.2 to 15.1.

Concerning the USB, if the method is the same as 13.x versions I think that I would be able to manage that.

Hi
Well a few months left of Win7 extended support, seems prudent to update? At least you still have a chance to get a free upgrade, then if not using windows much, just run a virtualized version…no need to dual boot…