Leap 15.2 dual boot with windows 7

Dear all,

my suse leap 42.3 root partition broke and I decided to buy a Msata drive and install a fresh copy of LEAP 15.2. Since all other partitions on the old hard drive are functional, I was wondering if it is possible to clone the widnows partition with dd on the new msata and make it function in a dual boot with LEAP 15.2. I use windows very rarely and would like not to invest time in installing it once again.
In the past, I was always installing windows first and linux after. Therefore, I am not sure if the opposite is possible.

Thank you for your help

Hi
I think clonezilla may be a better option… but consider upgrading to windows 10 since 7 is EOL (free download/upgrade), or create a virtual machine and run windows in that?

Please be aware that 15.2 will not be released until end of May. During the development it might break ( having said that I test it in a VM and it’s doing fine AFAICS )

I would like to keep the dual boot and would like not to update. I don’t go online with windows 7 so it should not be a problem.
The question is a general one, will such a setup be possible. Will grub see windows 7.

Well I guess that I can go with 15.1 and do zyper dup once 15.2 is out. The question with windows 7 remains. Will this strategy work?

If meaning Windows first, then openSUSE … yeah, that should work. No idea about Windows 7 forcing you to move to 10 though.

And … How about this one to upgrade ( 15.1 -> 15.2 is supported ), when 15.2 is released and you want to upgrade 15.1 to 15.2


sudo zypper --releasever 15.2 dup

Tested this in a VM with only stock repos, and it worked like a charm.

Yes, this is very much possible. I have personally done something similar many times, but you have to be careful where to install the boot loader. Either MBR or the /EFI in the new mSATA drive.

First make sure and check if W7 is installed in Legacy or UEFI mode.

If Legacy (most W7 are installed this way),
be sure to initiate/setup the mSATA with MBR and Legacy mode. You can use dd or clonezilla then to transfer W7 to the mSATA drive. Now, after the transfer you will have to do a bit of research on how to copy MBR from the old installation to the new one. Easiest option is to use a W7 recovery media to do its job.
When this is done, you can then fresh install OpenSUSE LEAP 15.2 in a new partition.

Just be careful as MBR partition table only allows 4 physical partitions.

If UEFI,
use dd or clonezilla to copy the /efi partition of the W7 installation, and the main W7 installation, then install LEAP 15.2 in a new partition. There won’t be limit on how many partition you can have for UEFI.

Thank you for your reply.
I have never done this before, so I have some follow-up questions.

  1. At which point the mSATA is setup in legacy mode. In the past I used to install suse on the space made available by shrinking the windows partition. This time it will be the other way round. I will be installing Linux first.
  2. I have no CD drive, is it possible to use the live usb to copy the MBR with dd?

You do not say whether both drives are to be permanently installed or you intend to replace the older drive with the new. Does the new drive have substantially more capacity.

During an installation or upgrade from a USB openSUSE image it is possible to press the <Ctrl><Alt><F2> keys to enter a virtual console logged in as root. This wil provide access to the essential command line tools like mount, dd, parted, fdisk etc.

If you do this before the installer writes the new partitiions, you could use fdisk or parted to determine which drive was which and then dd to copy the old to the new. You could then disconnect the old drive and start the insrallation again. This time you would be installing Leap after Windows. If anything goes wrong, you still have the old drive in its present state. When in the virtual console <Ctrl><Alt><F2> will return to the installation screen.

If the broken root partition beans a broken filesystem and there is no physical damage, Why not just install a new Leap into the existing root partition? This will reformat the partition and create a new filesystem. Once you are working you then have the opportunity of cloning to the new drive and adjusting partition sizes etc.

Hi
Consider the time spent so far and about to with cloning the drive (it will be hours copying too and from) versus just installing win7?

Note in MBR boot Windows will take over the boot so you may need to reinstall grub to get openSUSE to boot. There are several different way th MBR boot can be setup. Generic code in boot and grub installed on the boot/root or grub in MBR. WIndows will replace any MBR code with generic and use the boot flag to indicate which partitions controls boot. If you installed grub to the boot/root then simply changing boot flag after Windows install will allow Linux to boot. first. In any case if you install Windows after Linux then grub does not know about Windows and will not offer to boot it. You can reinstall grub in Yast with prob for foreign OS box ticked to allow grub to find Windows.

…but personalization of Win7 can be a pain for days. And activation lately worked for me only via phone.

I would copy over win7 first and make it functional (new activation needed due to change in hardware? I would not bet against…). Afterwards install Leap 15.1 and you are done.

Hi
The joys of obsolete software… :slight_smile: The user doesn’t want to go online with it, why should activation matter, will it even activate or re-activate due to a hardware change?

.

Exactly my point, I have old lab software which runs on this machine only. Otherwise I would never do such complicated things. Concerning copying the windows 7 partition. The new mSATA would be 500 GB, where the windows partition is about 117.2 GB. The exact scheme of the old drive printed by

lsblk

is


>lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT loop0    7:0    0    58M  1 loop 
loop1    7:1    0    12M  1 loop 
loop2    7:2    0  41.4M  1 loop 
loop3    7:3    0    44M  1 loop 
loop4    7:4    0   4.1M  1 loop 
sda      8:0    0 298.1G  0 disk 
├─sda1   8:1    0   100M  0 part 
├─sda2   8:2    0 117.2G  0 part 
├─sda3   8:3    0     1K  0 part 
├─sda5   8:5    0    45G  0 part /
├─sda6   8:6    0   130G  0 part /home
└─sda7   8:7    0   5.8G  0 part 

What I plan is to copy

dd if=/dev/sda2 of=/dev/msata bs=64M status=progress

The former step is more or less clear. Subsequently, I would have to install suse leap 15.1 from the live USB. Will the install see the 500GB-117.2GB unpartitoned space? If the latter is the case, I could install linux on the unpartitioned space. This resembles things I have done in the past, namely, making free space (by shrinking) the windows partition, to install linux. Having done this, will grub from Suse leap 15.1 be able to understand that I have windows 7 on one of the partitions and boot it?

What about cloning the windows partition and if possible installing linux on the remaining unpartitioned space?

If the install of MS win7 is not activated, the desktop turns black after a month or so and you get nag screen terror more often than not (“your copy of win is not activated, might be a terror murder islamic state copy blah blah”).

I will use win7 until I die. The machines are in dedicated networks, have no internet for years (except for antivirus updates…) and are updated via WSUSoffline. Internet and email via VNC on linux machines in other networks.

I installed win10 on 1-2 machines, it was such a pain, I dumped all of them after some weeks. This OS can not be used productively in my use case (not just clicking a browser and writing some emails). And the telemetry and mandatory updates make it malware by design.

Sorry for OT.


Mr. Snow, give it a try and safe the HDD with win7, so you can alsways start over again if there are some problems. Cloning of M$ trash is not an intended use case, so be prepared for a ruff ride, I tried it the last time some 5-6 years ago with some commercial windows software for disk cloning.

Is that 100MiB /dev/sda1 an important part of the MS Win7 installation?

Is it possible to boot a legacy (MBR) Win7 partition in a UEFI/GPT drive? I wonder about that because on a larger drive DOS partitioning and extended partitions is a pain.

In my experience this 100 MB thing is important. I lately had 2 win7/TW dual boots not booting win7 after some updates to win7, had to recover them with win7 DVD, afterwards I had 2 entries in grub menu for win7, one for sda, one for sdb, actually only the one for sdb was booting win7 (I masked the second entry in grub, found a method here on the forum).

If you copy over the win7 with dd, clonzilla or alike the partitioning is no problem in the first place, or? Subsequently start the normal Leap installation using the rest of the SSD and you should be good.

Alternative: Copy only Win7 to the new SSD, install Leap to a second SSD and insert the second only if you need it (eSATA or USB3 adapter)…

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 is the printout of parted -l. I don’t know what exactly is the 105 MB partition. I remember that the dual boot broke once and I re-installed grub

mount /dev/sd5 /mnt
sudo mount -t proc none /mnt/proc
sudo mount --rbind /dev /mnt/dev
sudo mount --rbind /sys /mnt/sys

Then I used the command line yast to make it boot from the extended partition. Before that it was set to boot form the MBR. It looks like that 1 & 2 are both windows.
I am a bit lost now. Should I copy only 126 GB ntfs and omit the 105 MB one?

Copy the 105 MB. I just checked on one win7/TW dual boot machine, there is a 100 MG NTFS partition set as bootable (run fdisk -l).