1

I have just installed Ubuntu 16.04 (on legacy) alongside Windows 10 (on UEFI) on a Dell Inspiron 5567. It works fine.

I have arranged it so that Ubuntu boots first. Windows can be booted from BIOS. I can reach Window files from Ubuntu.

On GParted GRUB appears between Windows and Ubuntu, but it doesn't appear at the startup of the computer. It's not a big problem, because I don't think I need it.

I want to expand the partition of Ubuntu. The problem is that my free space lays between the partition of Windows on one side, and GRUB and the Ubuntu partition in the other side.

  1. Do I still need GRUB or can I just delete it?
  2. Can I expand the Ubuntu partition over the GRUB to the free space?
wjandrea
  • 14,236
  • 4
  • 48
  • 98
  • 2
    Of course you need Grub. –  Mar 15 '17 at 18:12
  • Dual-booting in two different boot modes may cause headaches later on. If I were in your shoes, I would back up everything and reinstall Ubuntu. – wjandrea Mar 16 '17 at 18:35

3 Answers3

4

I have just installed Ubuntu 16.04 (on legacy) alongside Windows 10 (on UEFI) on a Dell Inspiron 5567. It works fine.

This type of mixed-mode configuration is sub-optimal at best. You've clearly gotten it working, but you should be aware that there are easier ways to do it. You may want to consider switching to one of them as part of the solution to your problem. For some general information on this topic, see my Web page on the CSM.

I have arranged it so that Ubuntu boots first. Windows can be booted from BIOS.

Technically speaking, you don't have a BIOS; you have an Extensible Firmware Interface (EFI). What you refer to as a "BIOS" is better called a "boot manager" generically, or the EFI's built-in boot manager specifically; but in online forums, the term Basic Input/Output System (BIOS) is often used synonymously with the term firmware, which is in fact a more generic term. That is, BIOS and EFI (or its version-2.x variant, UEFI) are two different types of firmware. One feature provided by most EFIs and most modern BIOSes is a built-in boot manager; but that's a feature of the firmware, not the BIOS, EFI, or firmware itself. Unfortunately, many manufacturers muddy these waters by referring to their EFIs as "BIOSes" or "UEFI BIOSes."

Note that I'm not trying to be pedantic or picky here; I'm trying to be clear. I infer from your question that you have an incomplete mental model of the various components and how they fit together, but a more complete model will help you navigate these waters.

On GParted GRUB appears between Windows and Ubuntu, but it doesn't appear at the startup of the computer. It's not a big problem, because I don't think I need it.

By "GRUB" (or later references, using the word "it"), you're referring to at least three different but related things:

  • The BIOS Boot Partition, which GParted identifies by a bios_grub flag.
  • The GRUB 2 boot loader menu, which you see when you boot the computer.
  • The GRUB 2 boot loader code, which loads the Linux kernel into memory and executes it.

GRUB 2 is a boot loader, which is a program that loads an OS kernel into memory and executes it. GRUB 2 also provides boot manager functions, which means it presents a menu of boot options. These two general types of programs are distinct; a program can be a boot loader but not a boot manager or vice-versa. GRUB 2, though, provides both functions in one program. That said, if Ubuntu is installed as the only OS on a computer, or if the scripts that configure GRUB don't recognize another OS as being bootable, GRUB will be configured in such a way that it presents no boot menu -- that is, GRUB will operate as a boot loader but not as a boot manager. It's critical to understand, though, that GRUB is still running and is still doing a critical task in booting the computer, even though you never see its menu.

Depending on the boot method (BIOS vs. EFI) and other factors, GRUB can reside in several different places on the hard disk. In a BIOS-mode boot from a GPT disk (which is what you've got), GRUB will be scattered about in various locations, one of which is in the BIOS Boot Partition. Thus, deleting the BIOS Boot Partition will render Ubuntu unbootable until the problem is fixed. Also, moving the BIOS Boot Partition will render the computer unbootable. Thus, if I understand your situation correctly, you do need the BIOS Boot Partition on your computer -- at least, in its current configuration.

I want to expand the partition of Ubuntu. The problem is that my free space lays between the partition of Windows on one side, and GRUB and the Ubuntu partition in the other side.

If I understand correctly, your partition layout looks something like this:

+-----------+-------+----------+
|  Windows  |  BBP  |  Ubuntu  |
+-----------+-------+----------+

You want to expand the Ubuntu partition and shrink the Windows partition. If so, you have several options:

  • Shrink the Windows partition, create a new partition in the freed space, and add it to Ubuntu as a separate filesystem -- perhaps mounted at /var or /home, say. This will likely involve moving some files from the old to the new location. Details would have to depend on the specific sizes involved. See this question and answers for some more information on this approach.
  • Resize the Windows partition, move (or delete and re-create) the BIOS Boot Partition, resize the Ubuntu partition, and then re-install GRUB. The last step would require use of an Ubuntu emergency disk booted in BIOS mode. A tool like Boot Repair might help with this.
  • Delete the BIOS Boot Partition, resize your partitions, and install an EFI-mode boot loader for Linux. Two options will be easiest to handle for this:
    • You can install an EFI-mode version of GRUB by booting an Ubuntu emergency disk in EFI mode and either installing it manually or running Boot Repair.
    • You can install my rEFInd by installing it from Windows or by preparing a USB flash drive or CD-R (image for both are available on its downloads page), booting with it, and then installing the Debian package or PPA.
  • Since you say your Ubuntu installation is new, you might consider completely deleting it and re-installing it from scratch with a larger partition size, after you shrink the Windows partition.

There may be other options if you've installed Ubuntu using the Logical Volume Management (LVM) system.

Note that either of the second and third options requires resizing the Ubuntu partition from its start point, which is more time-consuming and riskier than adjusting a partition's size from its end point. Thus, the first option is likely to be safer and faster; but splitting your Ubuntu installation into multiple partitions at this point may be awkward, depending on the sizes involved.

If you "bite the bullet" on the resizing operation, I recommend going for an EFI-mode boot loader, since that's likely to be less awkward and confusing in the long run. Likewise if you choose to re-install Ubuntu from scratch.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
2
  1. You can't boot Ubuntu without a boot loader which happens to be Grub by default. You can use a different compatible boot loader but that doesn't appear to be your aim.

    This is unrelated to the dual-boot capabilities of Grub.

  2. Boot loaders occupy a few megabytes of space at best.

    $ du -sh /boot/grub
    7.2M    /boot/grub
    

    If ±50 MB matter to you should look for a leaner Linux distribution than Ubuntu. This choice would have a far larger impact than boot loader optimization.

    I don't know how you partitioned your Ubuntu installation but it may be possible to shrink the partition containing /boot or merge it with the partition containing the root file system (/). Don't forget to adjust /etc/fstab and update/repair Grub if you do the latter!

    Note that /boot contains other things beyond (parts of) the boot loader, most prominently one or more Linux kernel images.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
0

GRUB is so small that I don't know that you'll recover much space with which to expand the Ubuntu partition. However..... a safer way to go would be to rename the grub partition mount point to something like:

sudo mv /boot/grub /boot/grub.BAK

Your explanation sounds unclear. If yours is a true dual boot machine then you need the GRUB partition. If you are doing something "odd" perhaps you don't.

A more realistic way (IMHO) to accomplish what you want would be to buy a larger capacity drive (or an additional drive) and increase the Ubuntu file system size that way.

Running bleachbit will probably recover a lot more disk space than nuking the grub partition.

jones0610
  • 2,157
  • 3
    sudo mv /boot/grub /boot/grub.BAK will probably leave the system unbootable. Grub partition is needed because Ubuntu is installed in legacy-mode on GTP-drive, I think you can't even move this partition. Grub-partition holds core.img which is stored on sectors 1-62 of the disk if MBR-drive. But on GPT-drive sector 1 is GPT-header and sectors 2-33 are partition-table. `core.img could be stored starting with sector 34, but if not enough space until first partition starts, Grub-partition is needed. – mook765 Mar 16 '17 at 06:49