0

I have Ubuntu 16.10 on my laptop and I'm planning on dual-booting with Windows 7. The problem is, after I install Windows 7, it will break GRUB. I need to know if I have a separate boot partition so I can restore GRUB to the correct place using an Ubuntu live USB.

This is a picture from GParted. sda3 is the partition I created for Windows 7.

enter image description here

8
  • Is this an UEFI system? sda2 looks like it might be an EFI boot partition, and it has the boot flag set. An EFI boot partition is not the same as a traditional Ubuntu /boot partition as described here: help.ubuntu.com/community/BootPartition Oct 21, 2016 at 20:32
  • Nope this is a BIOS system. Oct 21, 2016 at 20:33
  • That's good news. So how did that 100 M ntfs partition with the boot flag set get there? Oct 21, 2016 at 20:35
  • I have no clue I just installed Ubuntu, so do I have a seperate boot partition? Oct 21, 2016 at 20:36
  • 1
    All Windows after XP add a small Boot partition for Windows boot files. Not required, but the default Windows install. Only if you had boot flag on a primary NTFS partition will Windows install to only that partition. But do not confuse a Windows Boot partition with a LInux /boot partition. You only have / (root) which then has all the Linux folders.
    – oldfred
    Oct 21, 2016 at 20:39

1 Answer 1

1

You don't have any separate /boot partition.

  • /dev/sda1 is your Ubuntu root partition (mount point /, which includes all folders that are not mounted from anywhere else, including /boot in your case)

  • /dev/sda2and/dev/sda3are partitions for Windows, the small one is probably going to be the hidden system partition while the big one will show up as yourC:` drive in Windows.

  • /dev/sda4 is not a "real" partition for data, it's a so-called "extended partition" which means it's just a container that may hold any number of logical volumes (which behave like normal partitions again). Extended partitions are needed because an msdos/MBR partition table can only have 4 primary partitions or 3 primary and one extended (containing any number of logical) partitions.

  • /dev/sda5 is your Linux Swap partition, which is used to swap memory pages out of your RAM when it gets full.

However, to boot using GRUB, you must install it to the disk (/dev/sda) and not to any of the partitions, using e.g. sudo grub-install /dev/sda. This should be done from either your running Ubuntu installation on the disk (which will not be possible as you will need to restore GRUB first) or from a chroot from a live Ubuntu environment into your mounted Ubuntu partition. It works like this:

  1. Boot an Ubuntu live DVD or USB drive. Should be the same architecture (32/64bit) and ideally same release as your installed Ubuntu. Select "Try Ubuntu without installing".
  2. Open a terminal (Ctrl+Alt+T) and run the following commands to mount your Ubuntu partition and chroot into it:

    sudo mount /dev/sda1 /mnt
    for x in /dev /dev/pts /proc /sys ; do sudo mount --bind "$x" "/mnt/$x" ; done
    sudo chroot /mnt
    
  3. Your terminal prompt should have changed now, as you are now logged in a shell session as root user to your Ubuntu installation on the disk, not the live system. Here type these commands to reinstall GRUB to the disk. Note that we don't need sudo here for that reason. Also, the second command could probably be omitted, but it doesn't hurt:

    grub-install /dev/sda
    update-grub
    
  4. Exit the chroot session again by typing exit or pressing Ctrl+D. Unmount all the mounted partitions again:

    sudo umount -R /mnr
    
  5. Exit the terminal and reboot from the disk, ejecting the live medium you booted from.

6
  • hey, but I havent installed Windows 7 yet Oct 21, 2016 at 20:52
  • But you said you have prepared partitions for it, right? /dev/sda2 and /dev/sda3 are both NTFS partitions (Windows file system) and not mounted by Ubuntu at the moment, so they are not used by it. They're also empty, so it seems like you just manually created them.
    – Byte Commander
    Oct 21, 2016 at 20:54
  • yes, but I only created one partition and that was /dev/sda3/ Oct 21, 2016 at 20:58
  • 2
    Well, obviously someone or something must have created it... v(^_^)v
    – Byte Commander
    Oct 21, 2016 at 21:02
  • 2
    Do with it whatever you want. It's probably empty anyway, at the moment. I'd just delete both NTFS partitions and let the Windows installer create the partitions there itself. (Make sure you have a backup of your important data though, in case something goes wrong and it attempts to overwrite a used partition. With Windows one never knows...)
    – Byte Commander
    Oct 21, 2016 at 21:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .