completely move a windows partition

Hello,

Now I’ve changed nearly totally to linux and so I’d like to put my Windows back on the slower parts of the (notebook-)harddrive. :wink:

I have the following plan:
this is my HDD:

Windows Swap (NTFS)/Windows(NTFS)/Linux Swap(swap)/Linux(ext3)/Linux Home(ext3)/Windows Data(FAT32)

and I’d like to change it to this:

Linux Swap(swap)/Linux(ext3)/Linux Home(ext3)/Windows Swap(NTFS)/Windows(NTFS)/Windows Data(FAT32)

So I have to move the Windows partitions to an external HDD,
move the linux partitions to the beginning of the HDD (with gParted)
and then put the Windows partitions back

My question is, how do I completely move the Windows partitions to the external drive and which tools do I have to use?

Use Knoppix.
But first attach the external drive and prepare the three target partitions, use windows, make two ntfs and one fat32. Suppose they’re called target1, target2, target3.

Boot the computer using Knoppix Live CD. That will start Debian (I think) Linux using KDE – very usable.
Open a terminal window and enter “su” to get root privileges. Open Konqueror super user mode at the root location by using this command:

konqueror /

Make directories in there, just under “/”, one for each of the windows partitions on the internal drive. Call them win1, win2, win3
Mount the internal-drive windows partitions using these commands:
ntfs-3g /dev/sdax /win1
ntfs-3g /dev/sday /win2
mount /dev/sdaz /win3

sdax (change x) is the first ntfs
sday (change y) is the second ntfs
sdaz (change z) is the fat partition

Make directories /target1, /target2, /target3 and mount the partitions you made on the usb drive in similar fashion to the partitions you mounted for the internal drive.

Switch your Konqueror browser to “view hidden files”. Browse from one mount to another in Konqueror and use copy/paste to get all the files copied from their internal-drive mounts to their external-drive mounts

voila, sort of like that.

Hmmm, this solution might destroy the NTFS table, I need something to copy the whole partition not in file mode.
The Fat partition is already in the right place.

I didn’t realise you were going to put partitions 1 and 2 up in positions 4 and 5, which will make them sda5 and sda6 (or there abouts, depending where you set the extended partition), and were going to try for a working windows installation. I thought you were after simply moving the files. It’s not possible to have a bootable windows as sda5 or 6 AFAIK, because the way windows boots requires it to be on an “active” primary partition IIRC.

Oh, really? Is there no way to boot windows this partitions, even not with grub? :frowning:

None.

Don’t fret, the speed difference is marginal, probably not worth the effort of moving partitions given all the dangers that entails for new users.

Maybe around 10Mb/s, and thats a lot, especially for booting.

Actually, you can boot XP with almost any configuration if you remap the partitions with the appropriate grub map commands before chainloading it. I wouldn’t know if that goes for Vista too. As for moving your partitions around, I’ve found one of the most reliable tools to be GParted: you just boot a live Ubuntu CD, launch GParted, juggle/resize/delete any partitions you like and go to bed. In the morning, GParted will have finished its job and you’ll have your brand new partition configuration.
Good luck!

Fabulous – thanks for the tip – Even if you didn’t use Linux but knew how to install Grub, that would open a whole new world.

I’ll try it out. I’ve got a drive with windows and a string of Linux, distros on it. I’ll PartImage clone it to the spare space at the end and learn the method. So suppose I a clone of windows from sda1 onto sda8 for example, what map command would I use to boot it?

Yeah, the crazy operation was successful! :slight_smile:

You only need an external HDD, a GParted Live-CD, your OpenSUSE install-disk and your Windows install-disk.

  1. Make free space on your external HDD (unpartitioned)
  2. Boot the GParted Live-CD
  3. Copy your Windows partitions to the external drive (Copy & Paste in the menu)
  4. Delete the Windows partitions on your local drive
  5. Move your Linux partitions to beginning of your local drive
  6. Copy & Paste the Windows partitions back to the end of your local HDD
  7. Boot from your Windows DVD and make the automatic repair (I used a Vista Ultimate DVD and I had to do it twice)
  8. Boot from your OpenSUSE install disk and choose repair, then also use automatic repair, you probably need to edit the fstab entries and the Grub configuration
  9. Success!!!

@swerdna. I’m quoting from memory, so bear with me, but I think you’d use

map (hd0) (hd7)
map (hd7) (hd0)

.
This would fool Windows, residing in sda8, into thinking it’s actually located in sda1.
Cheerz!

OK I get the intent of it and can experiment if necessary, thanks.