So I have two 40GB raw image backups from an old laptop that I use. One image is debian, the other is windows xp. I’ve installed a new, larger drive that is big enough for both images to fit at once.
I thought I would be able to dd the debian image, then the xp behind it, and after configuring grub end up with a dual boot arrangement.
The debian image went smoothly, boots and runs perfectly, but I’m stuck on the XP image. From a livecd, I tried creating a new ‘unformatted’ partition (larger than the XP image) in gparted, so I would have an of= target, then dd-ing the XP image to that. The write happened, but lsblk and gparted still only show an unformatted partition. I might have better luck if I match the format of the partition to the format of the image, but before I try any of that. . .
Is there a simple way to achieve what I’m trying to do? Or perhaps is what I’m trying to do impossible because I’m trying to write a disk image to a partition? I suspect there is more to it than I’m realizing.
Did you originally image the entire laptop disk (including partition table), or did you image partitions separately?
If the former, I suspect you’ll need to extract the partitions from your disk images somehow, create a new partition table with two correctly sized partitions, and then write the imaged partitions to those.
Yes, that’s your problem. If you had 2 physically separate disks, things would be easy, but you haven’t. Just reinstall your Win-XP in the empty partition (make d@mn sure the installer doesn’t choose the Linux partition instead!), reinstall Grub on the Linux side and you should be done. Note emphasis on “should”
Sounds like you have two images with their own partition table and partitions. If so, you need to mount(not sure this is the right term, basically setup a loop device for the image file) the two images such that you can only copy the exact partitions you want off each, and not the whole partition table. How i do it is one by one make a matching partition on the new drive matching the partition on the image and copy from image to new drives matching partition. Then expand that freshly copied partition to final size. Then make a new matching partition for the next partition from some image, copy, expand. Repeating as necessary. When i say matching i mean same size in bytes. So if i have a 2,568,214,523byte(2.568214523gb) partition on the image on the new drive i make a 2,568,214,523byte partition, then copy just the partition, then go back and expand it to size on the new drive.
Set up the loop device for the XP image, dd-d the sole ntfs partition onto a larger NTFS partition on my new drive, os-prober in debian detected the xp install and updated grub2 to suit and. . . xp hangs at a black screen with a cursor.
I’m not sure if this is an issue with how I handled the backup image or if this is just grub/xp nonsense.
It’s been so long since I messed with XP I forgot how much it wants to be the first partition on the drive. I ended up dd-ing that image into the drive (booted just fine) and I’m going to try to sneak the Linux partitions in next to it after the holidays.