How do I remove Windows 7 from my dual boot system with Ubuntu?

These instructions are only valid if you're not using a Wubi installation

  1. Start a disk manager (GParted or Gnome Partition Manager will be fine)
  2. Select the Windows partition (be sure to select the right one!, if you're selecting a partition with the ext* filesystem, you're wrong. A partition with the NTFS filesystem is more likely to be your windows partition)
  3. Remove the windows partition
  4. Windows 7 installs its bootloader to a 100MB partition, the first one. If this partition exists, remove it.
  5. Create a new partition for your data and format it with the ext4 filesystem
  6. If you're using Gnome Partition Manager, you will be offered to take the ownership of the partition. Otherwise, close the partition manager, mount the partition, open a terminal and run:

    sudo chown "$USER": /media/name-of-your-partition
    
  7. Since the windows partition is missing, GRUB's OS prober won't find it when detecting OSes. To remove the windows boot entry, open a terminal and run:

    sudo update-grub
    

    This assumes that GRUB is your bootloader which is always the case if you installed Ubuntu after windows 7.

If you've previously configured Ubuntu to auto-mount your Windows partition, you need to remove that. Edit the /etc/fstab file as root and remove the line regarding windows. Beware that you do not remove other lines as it may render your system unbootable which can be recovered with a Live CD only! Such a line may look like:

/dev/sda2 /media/windows fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0