Install Windows after Ubuntu Lucid Lynx

Ubuntu (featured logo)

Sh*t happens. There is no more applications to manage my 6th generation iPod Classic 160 GB under Linux/Ubuntu. I have to install Windows as the second operating system along with newly installed Ubuntu Lucid Lynx (it rocks but this is for another post) to run iTunes.

For rather long time I’ve been using gtkpod, amarok, banshee, exaile or rhythmbox to sync my ipod under Linux/Ubuntu and load my music collection there. As we all know The Elder Brother Apple fights with interoperability and makes ipod/iphone users to use iTunes only. Any other applications that can read/write to ipod data format are prohibited by Apple. This also concerns Rockbox and ipod4linux alternative firmwares — once Apple encrypted ipod firmware it became impossible to use them. It definitely sucks. At least due to the fact there are millions of Linux users who are real or potential customers of Apple products. Anyways these facts have been discussed in various forums, blogs like this and similar but this post about how to install Windows as the second operating system along with Ubuntu or any other Linux.

gparted exampleThe first that we need to do is to create new partition for Windows and format it to NTFS. Exact steps to accomplish this depend on your HDD partition table e.g. there is one large ext3/ext4 partition for Ubuntu or there are several partitions for various distributions or mount points. Anyway you should use partition manager to create and/or format NTFS partition. I use gparted. It is graphical and it just works (use ‘sudo apt-get install gparted‘ if you run Ubuntu/Debian).

Second you should backup your MBR record and restore it after Windows installation that silently erases existing bootloader and installs windows one, use “dd if=/dev/sda of=/mbr.bin bs=446 count=1” to save MRB into mbr.bin file and “dd if=/media/sda/mbr.bin of=/dev/sda bs=446 count=1” to restore it from file to HDD.

To sum everything up here is the algorithm:

0. BACKUP ALL YOUR DATA!
1. Create NTFS partition using gparted.
2. Backup MBR using dd command e.g. “dd if=/dev/sda of=/mbr.bin bs=446 count=1” (/dev/sda means your HDD).
3. Boot Windows installation CD and install it onto newly created NTFS partition.
4. Boot into Linux live CD  e.g. Ubuntu Live CD.
5. Restore MBR using dd e.g. “dd if=/media/sda/mbr.bin of=/dev/sda bs=446 count=1”.
6. Reboot.
7. Select Ubuntu in grub menu and boot it.
8. Setup grup for Windows booting.

In order to accomplish the last 8th item you should add the following text block to the end of grub config (read this article for detailed information):

title Microsoft Windows XP
root (hd0,1)
savedefault
makeactive
chainloader +1

Good luck!

P.S. If something goes wrong or you need more details you can take a look at the following article at ubuntu.com: Recovering Ubuntu After Installing Windows. It’s written in rather tangled manner but still informative.

SHARE:
nv-author-image

Stefan Durand

My name is Stefan, I'm the admin of LinuxScrew. I am a full-time Linux/Unix sysadmin, a hobby Python programmer, and a part-time blogger. I post useful guides, tips, and tutorials on common Linux and Programming issues. Feel free to reach out in the comment section.

7 thoughts on “Install Windows after Ubuntu Lucid Lynx”

  1. Just drop Ubuntu altogether and run Windows. Most of the good software is cross-platform, like Firefox and Inkscape, and the rest can be run in VirtualBox or andLinux, so it integrates seamlessly with your Windows desktop.

    I've been using Ubuntu for years, but if Canonical's too incompetent to make an OS that works, I'm not going to support them or waste my time any further.

  2. This looks like the former system where you install windows and then you partition it and install ubuntu with grub. Still Ubuntu depends on windows

  3. @Mark

    I did the opposite. I have drop Windows for Linux, Reasons? There’s no Virus and no “blue windows”. Ubuntu is far more stable than windows.

  4. Win XP might give you the old blue screen of death routine after copying it’s installation files and you won’t be able to continue. As usual you’ll get a totally useless error message regarding how you should check your disk with the check disk utility. Don’t. What you may want to try is to hold down the F2 key prior to booting from the XP installation disk. Then, change your hard disk mode from ATAPI to IDE. Then, save your changes and continue. Made my day.

  5. Worked here, good simple instructions. However when I tried to reinstall from ubuntu disk it couldn’t find mbr.bin. I then mounted linux partition on /mnt and found mbr.bin there so whein if directed dd if=/mnt/mbr.bin of=/dev/sda bs=446 count=1 then that worked. Rebooted and grub came up. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *