Firmware, the nightmare part 3: How to install Linux on a machine with a Windows boot partition already installed

Errata: A year has passed and I have to correct myself. My machine did not have a UEFI. What I had was a boot partition. The solution remains the same.

More than an opinion article it is a tutorial, but let's go to the background.

In the forum I mentioned that I was going to buy a new computer, and indeed I bought it last Saturday. Me Ideapad z570 It has an Intel core i7 processor, 4G of RAM (I'll add 4G more), Intel HD 3000 graphics (with 64M dedicated, and like I am not to play I don't care), intel n-1000 wireless controller (if you don't use a free kernel, you will have one) and 500G hard disk, which is what we are going to focus on. The disk had 4 partitions (3 primary and one logical), 2 partitions were factory (you know, for recovery), one was the Windows partition (7 home premium) and the other (the one that came at the beginning of the disk) had 200Mb.

The challenge: Install Debian Wheezy (Beta 4) on that machine (and if possible, a dual boot).

What was happening? I could use a live CD (for this case I used Xubuntu) and starts off as good. But even if you install some distribution, it only booted windows. In the liveCD I found out that this 200Mb partition had the boot flag. And as I could see when starting the liveCD, before the grub appeared it showed a sign that said "Secure boot not enabled". That is, is disk has EFI but does not have Secure Boot enabled (bah, I didn't find anywhere that can be activated …………… ..hehehehehe). This message appears depending on the distribution and is to indicate that it has support for EFI. Installing Linux was not going to be impossible, but it would be different (and less comfortable).

First I started googling about how to install Debian with EFI and they said you have to assign what the boot partition will be. It didn't help me, it was still the same.

Then it occurred to me to find out how to install linux (any linux), on a machine like mine. I come across the lenovo support forum and they tell me that it depends on how the disk is partitioned, if it has EFI, the disk you have than have a partition table GPT.

Guess ………………………………… yes, my disk has a partition table MBR. I checked it in Windows.

I kept googling efi and mbr and I find this nice information where the different types of partition tables are compared. GPT was created to improve limitations which has MBR:

MBR only supports up to 4 primary partitions, or up to 3 primary and one extended, which can have up to 128 logical partitions.
GPT supports up to 128 partitions primary.

MBR supports all 32 and 64 bit machines
GPT supports only 64-bit ones

MBR supports up to 2T per partition
GPT supports up to 256T per partition

(I guess since my disk was 500G, they created it as MBR)

4) Removable discs only they can be MBR.

5) And the most important
MBR uses the old BIOS (it was created 20 years ago)
GPT works with EFI (was created a couple of years ago)

In summary: EFI + MBR = CACA

You are thinking that I am going to blow up windows, format the whole disk, create a GPT and start over …………………… ..THEY ARE WRONG!!!! Not only did I get to boot Debian installed, but I kept my dual boot.

It turns out that what happened was that the grub was not installed on that 200 mb partition. How to do it? First I boot the LiveCD and there I open a terminal and do these steps: I did this with Xubuntu 12.10 and assuming that in / dev / sda1 there is the efi partition and in / dev / sda6 the root partition of the distribution already installed.

sudo -i
mount / dev / sda6 / mnt
mount / dev / sda1 / mnt / boot
grub-install –root-directory = / mnt / / dev / sda
mount –bind / proc / mnt / proc
mount –bind / dev / mnt / dev
mount –bind / sys / mnt / sys
chroot / mnt update-grub
umount / mnt / sys
umount / mnt / dev
umount / mnt / proc

Still no reboot. With this grub is installed in the efi partition, but it will only show windows there. Must include Linux entry:

sudo -i
mkdir / media / linux
mkdir / media / winBoot
mount / dev / sda6 / media / linux
mount / dev / sda1 / media / winBoot
cp /media/linux/boot/grub/grub.cfg /media/winBoot/grub/grub.cfg

Now I can restart and I find Windows and Debian. YUPI !!!!!!!!

Now that I finished the college classes, I install what I need (this time I opted to use KDE, and it works great) and migrate my things.

Sources: (This was the tutorial that helped me, I recommend that you read it because it includes instructions for the case in which the wifi does not work)

The content of the article adheres to our principles of editorial ethics. To report an error click here!.

42 comments, leave yours

Leave a Comment

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



  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Antonio Rosales placeholder image said

    I am still in the arduous battle of being able to install Debian, since my computer comes with Windows 8, Y_Y

  2.   eVeR said

    Some concepts are half medium, I think. Absolutely almost all disks use MBR table, GPT is used in very specific circumstances (come on, who uses more than 4 partitions ...)
    I build PCs, and this year they all came with EFI, and I always used MBR without problems, with both OS. GPT is not very widespread yet and just in case I avoid it.
    Your problem must have come from another side.

    1.    diazepan said

      Then tell me how you installed Linux while keeping Windows.

      Could it be that the grub is no longer installed?

  3.   frame said

    I think that now they debian in addition to grub, it brings grub-efi, could you install it? I would understand that with that there should be no problems
    Did you try to "disable" uefi from the bios before installing debian ???

    1.    diazepan said

      There was nothing in the bios to disable uefi

      1.    frame said

        if the uefi is not deactivated but it is the security boot uefi or something like that (they will correct me).

        we have to stand firm and not buy equipment that does not have the option to disable the uefi security boot.

        PS: did you notice the grub-efi issue ????


  4.   Rots87 said

    I thank God I did not have many complications when installing linux on my machine with the dual boot ... it may be that mine does not have the uefi 0.0

  5.   Yoyo Fernandez said

    He said Shit !!! :OR

    1.    helena_ryuu said


    2.    dwarf said

      I always say shit, or almost always, in my articles xD

  6.   hexborg said

    It's a good job. UEFI always gives problems when installing linux, I hope that will change shortly when they release the famous loader.

  7.   someone said

    There are things that money and other distros cannot buy, for everything else there is ubuntu and boot repair

  8.   ICeman said

    What would be the simplest procedure in case you want to delete Windows and all the partitions it brings, and make a small ext4 partition for / boot and a large partition (to use LVM for example)? In that case, would it be convenient to use GPT since there are only 2 primary partitions? (always talking about EFI hardware)
    Thank you

    1.    diazepan said

      1) I ever knew that using efi with mbr wouldn't be the problem, so I wouldn't know

      2) The boot partition uses ext2 because you don't need journaling

    2.    Hugo said

      I usually use dd to clean about 100MB from the start of the disk (where the partition table is located), and then create my partitioning scheme.

      Incidentally, I have personally had the experience that when I have tried to put all partitions inside an LVM it works but some errors occur so I am finally stuck with this scheme:

      primary (boot, 100M, ext3)
      primary (swap, 2G)
      primary (root, 8G, ext3)
      primary (lvm, rest of disk)

      Inside the LVM I create volumes for these partitions:
      / usr (12GB, ext4)
      / tmp (ext4, 10GB (sometimes when burning a double layer DVD this path is used to create the image))
      / home (ext4, a size suitable for the number of concurrent users)
      / var (ext4, the rest of the free space)

      After using this scheme, I have had no error messages. Actually the partition for / boot is not essential, but I like to have it independent of the root.

      Also, to optimize a bit I usually optimize the noatime or relatime options, to ensure noexec and nosuid, etc.

  9.   oscar said

    My deepest condolences.
    You shouldn't have bought LENOVO. Their technical support is the worst = ((at least here in Mexico) I bought it urgently and I spent two months without it because the DVD reader failed and they took a long time to deliver it T_T
    Well this is not the topic xD

  10.   Hugo said

    Diazepan, it seems to me that if after installing GRUB you had executed the update-grub command, you would have saved yourself creating the entry by hand.

    1.    Hugo said

      Sorry, to explain myself better:
      - First do chroot / mnt
      - Once the chroot is done, run update-grub
      (not all in one line)

      1.    diazepan said

        in that case, you would also have to add an exit (to exit the chroot)

        1.    Hugo said


          What surprises me is that you had to generate the input by hand, when update-grub was supposed to have done the work for you.

          Could it be that the os-prober package was not installed correctly?
          It would be interesting to list it to see if this is the case, and also before exiting the chroot or executing update-grub, verify that in / etc / default / grub there is the line:

          GRUB_DISABLE_OS_PROBER = false

          Anyway, perhaps it is a peculiarity of GPT partitions, I must admit that so far I have only worked with MBR partitions

          Still a good article.

  11.   Blaire pascal said

    You can't be more graphic: "How to install Linux on a machine with crappy EFI" hahaha. In fact, for G +, I stated my solution, install BIOS, switch to GPT, but I honestly didn't think I would make it. Very Good the post.

  12.   msx said

    "GPT was created to improve the limitations of MBR" I mean, what GPT does is make the limitations of MBR more robust ...

    or rather that GPT tries to overcome the limitations of MBR?

    1.    diazepan said


  13.   Oscar said

    It is certainly good, but it hurts that the Fedora 18 live cd does not start with UEFI, you have to deactivate it and use Legacy and have it like that and no longer use UEFI, although the truth is that I would like to use it, for a whim, if Ubuntu 13.04 can, Why not Fedora?

    1.    diazepan said

      Support for UEFI is as of fedora 19

      1.    Oscar said

        Fedora 18 is also supposed to have support…. Well, wait a couple of months for fedora 19, so while I'll have to use windows again, because Ubuntu gives me a lot of problems.

        1.    diazepan said

          Yes. I was wrong. Support is from 18.

        2.    pandev92 said

          sabayon has UEFI / EFI support

  14.   eliotime3000 said

    Wait, why didn't you use rescue mode? It worked for me when I first installed Debian and then Windows on the other half of my IDE hard drive [OH WAIT!].

    Anyway, I hope Debian Wheezy can fix this UEFI problem with SecureBoot enabled in the next updates.

  15.   Bryanakd1994 said

    Excuse me, I have a question. I installed Ubuntu 13.04 on a laptop that had Windows 8 (for that I had to access the Advanced Start / Start from Usb option, I had no problem). However, I want to install Sabayon now, but since I don't have access to the option present in Windows, I don't know how to boot Live Usb. What should I do? Thanks in advance.

    1.    diazepan said

      use a program like unetbootin that grabs an iso and puts it on the usb

      1.    Bryanakd1994 said

        Yes, I used Unetbootin to create Sabayon's live Usb. The problem is that it does not recognize it when starting the laptop. In the case of Windows, I could run the live Usb from Advanced Start but with Ubuntu I don't know how to do it.

  16.   Eclipse said

    Dual boot doesn't work for me, I hate EFI, yeah, it's shit

  17.   I said



  18.   chowitox said

    the steps are correct but they are not fool proof (like everything in linux: D)
    you have certain details, for example, first you get out of the cage and then you unmount dev prox and sys.

    But it was very helpful

  19.   David said

    Have if they help me or direct me to another publication.

    The MBR and GPT everything is fine, my machine came with dual, I mean I have grub (windows 8 and Debian).

    A few days ago I got the "grub rescue" error 🙁

    Try the SuperGrubDisk2 thing (and it only locates partitions and doesn't boot supports UEFI (GPT) mode boot).

    How do I fix it? (I'm thinking with LinuxLive and correcting the error directly in grub.cfg - hope you can)

  20.   Francisco said

    I have a question, I tried to install Debian 7.7 on an external ssd disk, my computer is an HP Pavillion laptop AMD A8 processor with Windows 8.1, I managed to complete most of the Debian installation except for a small great detail; can't load grub in main registry, I tried loading grub in sdc5, which was the only option where the installation process could be completed, but at system startup it doesn't offer me any option to boot Debian instead of Windows, with the process that you indicate in this article, is it possible to solve it? Please, I am looking for help in this regard! Thank you in advance.

  21.   Demian Kaos said

    It's been a long time since the article, but the truth is that you want to complicate your life by taking the most difficult path.
    And the worst: users who interpret that GPT partitions are the best for their 500 gig hard drives hahahaha ...

  22.   William said

    Idolooooooooo ……… ..
    your MBR and GPT instruction. I think they solved my problem.
    I must reboot and verify it… .. but the error did not appear anymore …….