Results 1 to 26 of 26

Thread: How do you boot Kali Linux from a flash drive on a UEFI system

  1. #1
    Join Date
    2017-Mar
    Posts
    1

    Question How do you boot Kali Linux from a flash drive on a UEFI system

    I've been trying to get Kali Linux to boot on my Acer Switch One SW1-011 from a flash drive but every time I try to boot it boots into windows instead. I've tried the 32 bit and 64 bit versions of Kali Linux 2016.2 and moved the EFI folder from the efi.img file to the drive and it still doesn't boot. I use Rufus to image the iso to the flash drive with the partition scheme MBR and 7zip to get the EFI file from efi.img.

  2. #2
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    You must be using 2016.2 original image which doesn't come with efi files to boot kali in UEFI. Yeah you have to MANUALLY create a folder EFI>BOOT>efi files for this image. If you find this step confusing then You don't have to do this. You should use kali weekly image. It is the latest kali image and currently it is Week 12 image. You will be able to choose GPT partition scheme for UEFI in rufus. Make sure Secure BOOT is disabled.

    kali weekly image

  3. #3
    Join Date
    2016-Jan
    Posts
    50
    Quote Originally Posted by Iamaboard26 View Post
    I've been trying to get Kali Linux to boot on my Acer Switch One SW1-011 from a flash drive but every time I try to boot it boots into windows instead. I've tried the 32 bit and 64 bit versions of Kali Linux 2016.2 and moved the EFI folder from the efi.img file to the drive and it still doesn't boot. I use Rufus to image the iso to the flash drive with the partition scheme MBR and 7zip to get the EFI file from efi.img.
    mehn...i have the same issue!, i was using kali 2.0, usually after windows update grub hides, i'll have to use boot repair disk to bring grub back. unfortunately after the anniversary update or whateva they call that ****, it didnt work anymore so i decided to get kali 2016 rolling. but still doesnt boot. according to what i read online kali doesnt have EFI support, i tried the examples i saw online of creating the efi folder. still didnt work, please if u know any better method that works i'll appreciate.
    using a Lenovo ideapad 100.

  4. #4
    Join Date
    2016-Jan
    Posts
    50
    Quote Originally Posted by _defalt View Post
    You must be using 2016.2 original image which doesn't come with efi files to boot kali in UEFI. Yeah you have to MANUALLY create a folder EFI>BOOT>efi files for this image. If you find this step confusing then You don't have to do this. You should use kali weekly image. It is the latest kali image and currently it is Week 12 image. You will be able to choose GPT partition scheme for UEFI in rufus. Make sure Secure BOOT is disabled.

    kali weekly image
    please if u dont mind can u try explaining the creating folder part and where would u get the efi files from? tho am downloading the weekly image already and hoping it works. but all the same i'll like to know.

  5. #5
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    If you open kali weekly image, you will notice a folder named efi. Inside the folder there is a sub-folder named boot. It contains bootia32.efi and bootx64.efi. These are boot files by which UEFI recognizes the image during boot. This folder is not present in original kali 2016.2, you have to copy that folder manually in it. Weekly image is better.

  6. #6
    Join Date
    2016-Jan
    Posts
    50
    Quote Originally Posted by _defalt View Post
    If you open kali weekly image, you will notice a folder named efi. Inside the folder there is a sub-folder named boot. It contains bootia32.efi and bootx64.efi. These are boot files by which UEFI recognizes the image during boot. This folder is not present in original kali 2016.2, you have to copy that folder manually in it. Weekly image is better.
    wow....cool...i'll try it out once am done downloading. network is very poor here. tnx

  7. #7
    Join Date
    2016-Jan
    Posts
    50
    Quote Originally Posted by _defalt View Post
    If you open kali weekly image, you will notice a folder named efi. Inside the folder there is a sub-folder named boot. It contains bootia32.efi and bootx64.efi. These are boot files by which UEFI recognizes the image during boot. This folder is not present in original kali 2016.2, you have to copy that folder manually in it. Weekly image is better.
    successfully downloaded the weekly image, runs fine and looks much more better, it gets to installation of grub and fails saying cannot install grub to dummy this is a fatal error, searched google already, non of the solutions have worked so far. well i'll keep digging and see what i can find. incase u've encountered similar issues please let me know how you were able to conquer.

  8. #8
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    It's because grub is already there in your EFI boot partition though it must be corrupted or not configured to boot kali. You can reinstall grub using these commands.

    You can re-install grub by booting into kali live USB. Here is the list of commands you need to enter-

    mount /dev/sda* /mnt
    mount --bind /dev /mnt/dev
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    mount /dev/sdb2 /mnt/boot/efi (why did you skip this command?)
    mount -o remount,rw /dev/sda2 /mnt/boot/efi
    mkdir /mnt/hostrun (skip this command)
    mount --bind /run /mnt/hostrun
    chroot /mnt
    mount --bind /hostrun/lvm /run/lvm
    grub-install /dev/sdb (/dev/sdb is the name of your hard drive)
    update-grub
    exit
    umount /mnt/dev
    umount /mnt/proc
    umount /mnt/sys
    umount /mnt/boot/efi
    umount /mnt
    Last edited by _defalt; 2017-04-10 at 18:36.

  9. #9
    Join Date
    2016-Jan
    Posts
    50
    Quote Originally Posted by _defalt View Post
    It's because grub is already there in your EFI boot partition though it must be corrupted or not configured to boot kali. You can reinstall grub using these commands.

    You can re-install grub by booting into kali live USB. Here is the list of commands you need to enter-
    Code:
    sudo mount /dev/sda* /mnt
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
    sudo mount /dev/sda** /mnt/boot/efi
    sudo chroot /mnt
    grub-install /dev/sda
    exit
    sudo umount /mnt/dev
    sudo umount /mnt/proc
    sudo umount /mnt/sys
    sudo umount /mnt/boot/efi
    sudo umount /mnt
    Replace * in sudo mount /dev/sda* /mnt with your linux partition assigned value.
    Replace ** in sudo mount /dev/sda** /mnt/boot/efi with your EFI partition assigned value.
    Use fdisk -l to list all partitions.
    i saw this solution all over the net, even after the running the commands successfully, still doesn't work boots str8 to windows.
    i tried to install ubuntu and it worked although i had to goto my bios and rearrange the boot order, and ran update-grub. and it works very well now. so i guess i'll try again if it still doesnt work, then i'll leave ubuntu and kali so i can use ubuntus grub.

    Thanks alot for your quick response, i really appreciate it.

  10. #10
    Join Date
    2016-Jan
    Posts
    50
    At the command
    grub-install /dev/sda
    It says :
    Installing grub for x86_64-efi platform.
    Could not prepare boot variable : no such file or directory.
    grub-install : error: efibootmgr failed to register the boot entry : Input/output error.

  11. #11
    Join Date
    2016-Jan
    Posts
    50
    Any suggestions on how to get past this?

  12. #12
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    Quote Originally Posted by Chunkingz View Post
    At the command
    grub-install /dev/sda
    It says :
    Installing grub for x86_64-efi platform.
    Could not prepare boot variable : no such file or directory.
    grub-install : error: efibootmgr failed to register the boot entry : Input/output error.
    I added a line in my previous post to troubleshoot this error. See my edit. I need to know what exactly you replaced with * and ** so also show the output of fdisk -l. I'm hoping you are replacing asterisks with the correct partition identifier number. My kali linux is installed in /dev/sda5. It can be different for yours. Though most of the time EFI partition tends to be /dev/sda1.
    Last edited by _defalt; 2017-04-03 at 20:27.

  13. #13
    Join Date
    2016-Jan
    Posts
    50
    my kali is installed in /dev/sda6
    my efi partition is /dev/sda2
    and yes i understood your post and i replaced the asterix accordingly.unfortunately even using bootrepair disk via ubuntu live disk doesnt work, says an error occured, i think the grub install is corrupted but if thats the case it must be an issue in the weekly kali distro.
    cos i can install ubuntu just fine and see ubuntus grub.

  14. #14
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928

  15. #15
    Join Date
    2016-Jan
    Posts
    50
    Quote Originally Posted by _defalt View Post
    Well i already saw the post and tried it, still didnt work.
    at the command

    grub-install /dev/sda

    i still receive same error,

    b4 you posted your solution, i found the solution on this site to be working almost perfectly, but i think it still didnt boot.
    https://www.pckr.co.uk/arch-grub-mkc...hroot-install/
    anyways since they look alike i decided to go with urs, but when i got to this command

    mount --bind /hostrun/lvm /run/lvm

    i get an error, so i had to follow the instructions on the other site, and exit chroot and run


    chroot /mnt /bin/bash

    mkdir /run/lvm

    mount --bind /hostrun/lvm /run/lvm


    after that i could proceed but was shortly cut off by an error while running the grub-install /dev/sda

    was kinda wondering tho, why are we installing grub into just sda and not sda2 where my efi partition is?
    anyways, I'll continue to look into it tho, lemme see if i can overcome this.
    Thanks all the same.
    Last edited by Chunkingz; 2017-04-10 at 08:05.

  16. #16
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    Quote Originally Posted by Chunkingz View Post
    Well i already saw the post and tried it, still didnt work.
    at the command

    grub-install /dev/sda

    i still receive same error,
    I've already added mount -o remount,rw /dev/sda** /mnt/boot/efi to resolve this error. It's is supposed to work. I don't know why it's not working for you. What is the exact error message?

    Quote Originally Posted by Chunkingz View Post
    b4 you posted your solution, i found the solution on this site to be working almost perfectly, but i think it still didnt boot.
    https://www.pckr.co.uk/arch-grub-mkc...hroot-install/
    anyways since they look alike i decided to go with urs, but when i got to this command

    mount --bind /hostrun/lvm /run/lvm
    i get an error
    What was the error message?

    Quote Originally Posted by Chunkingz View Post
    after that i could proceed but was shortly cut off by an error while running the grub-install /dev/sda
    was kinda wondering tho, why are we installing grub into just sda and not sda2 where my efi partition is?
    Thanks all the same.
    NO. You are installing grub through your bootable USB to the destination hard drive whose name is /dev/sda.

    I've edited my post in this thread and replaced it with the working solution of that thread. Try it again.

  17. #17
    Join Date
    2016-Jan
    Posts
    50
    Quote Originally Posted by _defalt View Post
    It's because grub is already there in your EFI boot partition though it must be corrupted or not configured to boot kali. You can reinstall grub using these commands.

    You can re-install grub by booting into kali live USB. Here is the list of commands you need to enter-

    mount /dev/sda* /mnt
    mount --bind /dev /mnt/dev
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    mount /dev/sda** /mnt/boot/efi
    mount -o remount,rw /dev/sda** /mnt/boot/efi
    mkdir /mnt/hostrun
    mount --bind /run /mnt/hostrun
    chroot /mnt
    mount --bind /hostrun/lvm /run/lvm
    grub-install /dev/sda
    update-grub
    exit
    umount /mnt/dev
    umount /mnt/proc
    umount /mnt/sys
    umount /mnt/boot/efi
    umount /mnt

    Replace * in mount /dev/sda* /mnt with your linux partition assigned value.
    Replace ** in mount /dev/sda** /mnt/boot/efi with your EFI partition assigned value.
    Use fdisk -l to list all partitions.
    Now m running live these are my screenshots of output from fdisk -l and running the above commands, take note dat my hdd shows as sdb instead of sda, while the flash drive shows as sda.

    http://imgur.com/a/hYejT
    Attached Images Attached Images
    Last edited by Chunkingz; 2017-04-10 at 17:49.

  18. #18
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    I can see mistakes. You are entering mount -o remount,rw /dev/sdb2 /mnt/boot/efi directly after mount --bind /sys /mnt/sys without mounting /dev/sdb2. You are skipping this command mount /dev/sdab /mnt/boot/efi. You can't create the same directory again if it already exists. You can skip this command mkdir /mnt/hostrun. The main reason of your failure was that you were not mounting /dev/sdb2.

    Your hard drive name is /dev/sdb so your command will be grub-install /dev/sdb. The quality of screenshot is not clear enough to see whether you have written /sda or /sdb.

    I'm updating the commands to make it clear what you have to enter.
    Last edited by _defalt; 2017-04-10 at 18:41.

  19. #19
    Join Date
    2016-Jan
    Posts
    50
    i was able to scale the following warning:
    WARNING: Failed to connect to lvmetad. Falling back to device scanning.

    by first disabling lvmetad and restarting it. b4 updating grub could work.


    /etc/init.d/lvm2 stop

    gedit /etc/lvm/lvm.conf

    and then set use_lvmetad = 0
    after that use
    /etc/init.d/lvm start

    that completely got rid 0f the lvmetad error.
    after that running update-grub shows this


    Generating grub configuration file ...
    Found background image: /usr/share/images/desktop-base/desktop-grub.png
    Found linux image: /boot/vmlinuz-4.9.0-kali3-amd64
    Found initrd image: /boot/initrd.img-4.9.0-kali3-amd64
    Adding boot menu entry for EFI firmware configuration
    done


    i believe i should be seeing an entry for microsoft windows?? but theres none...
    anyways i'll keep digging, lets know what you think.

    ps: got the trick from this site http://unix.stackexchange.com/questi...-directory-but
    Last edited by Chunkingz; 2017-04-10 at 18:40.

  20. #20
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    Quote Originally Posted by Chunkingz View Post
    i believe i should be seeing an entry for microsoft windows?? but theres none...
    anyways i'll keep digging, lets know what you think.

    ps: got the trick from this site http://unix.stackexchange.com/questi...-directory-but
    Can you boot kali with grub now? To add entry of windows 10 in grub, run sudo update-grub after login to kali. I think even if windows boot loader doesn't appear in grub boot menu, you can still boot windows from UEFI boot menu options.
    Last edited by _defalt; 2017-04-10 at 18:47.

  21. #21
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    Quote Originally Posted by Chunkingz View Post
    i was able to scale the following warning:
    WARNING: Failed to connect to lvmetad. Falling back to device scanning.

    by first disabling lvmetad and restarting it. b4 updating grub could work.


    /etc/init.d/lvm2 stop

    gedit /etc/lvm/lvm.conf

    and then set use_lvmetad = 0
    after that use
    /etc/init.d/lvm start
    I've a question. Did you stop lvm2 of kali live or did you make these changes in mounted /dev/sdb6 because it doesn't matter if you forget to start lvm2 of kali live, after reboot everything is reset but if you make these changes in /dev/sdb5/etc/lvm/lvm.conf it will be permanent. I'm assuming you must have gone to kali live filesystem.
    Last edited by _defalt; 2017-04-10 at 18:58.

  22. #22
    Join Date
    2016-Jan
    Posts
    50
    Quote Originally Posted by _defalt View Post
    It's because grub is already there in your EFI boot partition though it must be corrupted or not configured to boot kali. You can reinstall grub using these commands.

    You can re-install grub by booting into kali live USB. Here is the list of commands you need to enter-

    mount /dev/sda* /mnt
    mount --bind /dev /mnt/dev
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    mount /dev/sdb2 /mnt/boot/efi (why did you skip this command?)
    mount -o remount,rw /dev/sda2 /mnt/boot/efi
    mkdir /mnt/hostrun (skip this command)
    mount --bind /run /mnt/hostrun
    chroot /mnt
    mount --bind /hostrun/lvm /run/lvm
    grub-install /dev/sdb (/dev/sdb is the name of your hard drive)
    update-grub
    exit
    umount /mnt/dev
    umount /mnt/proc
    umount /mnt/sys
    umount /mnt/boot/efi
    umount /mnt
    at the the grub-install /dev/sdb command.
    i still get an error view the screenshot.
    ps:ignore the lvm stop command.

    screenshot: http://imgur.com/a/nojtg
    Last edited by Chunkingz; 2017-04-10 at 18:58.

  23. #23
    Join Date
    2016-Jan
    Posts
    50
    lol...i made the changes in the chroot, therefore its on the already installed kali on sdb6

  24. #24
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    Quote Originally Posted by Chunkingz View Post
    lol...i made the changes in the chroot, therefore its on the already installed kali on sdb6
    Can you exactly tell when do you make these changes to lvm.conf? After which command, is it after entering chroot /mnt? Just an off-topic question, i'm curious about this solution.

    Now as you are saying that grub is giving you an error Cannot find EFI directory. Reboot kali live and try again.

  25. #25
    Join Date
    2016-Jan
    Posts
    50
    Quote Originally Posted by _defalt View Post
    Can you exactly tell when do you make these changes to lvm.conf? After which command, is it after entering chroot /mnt? Just an off-topic question, i'm curious about this solution.
    not really after chroot /mnt, i had typed a couple of commands, b4 that.

    Quote Originally Posted by _defalt View Post
    Now as you are saying that grub is giving you an error Cannot find EFI directory. Reboot kali live and try again.
    I've just done that, no success, at grub-install /dev/sda
    i get the message.

    Installing for x86_64-efi platform.
    Could not prepare Boot variable: No such file or directory
    grub-install: error: efibootmgr failed to register the boot entry: Input/output error.

  26. #26
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    Quote Originally Posted by Chunkingz View Post
    at grub-install /dev/sda
    i get the message.

    Installing for x86_64-efi platform.
    Could not prepare Boot variable: No such file or directory
    grub-install: error: efibootmgr failed to register the boot entry: Input/output error.
    no luck with grub-install /dev/sdb?

    I've one more solution. Boot into kali live and mount your EFI partition using mount /dev/sdb2 /mnt/boot/efi. Then remount it for read write access using mount -o remount,rw /dev/sda2 /mnt/boot/efi. Go to /mnt/boot/efi/EFI and delete the folder of kali. Do not touch any other thing. Take the backup of EFI folder before entering into it and erasing kali folder. Then run those list of commands again after reboot.
    Last edited by _defalt; 2017-04-10 at 20:45.

Similar Threads

  1. Corrupting Flash Drive WIth linux Kali
    By Aggelos in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2016-10-21, 10:30
  2. Can't get kali linux to boot from a USB flash drive on any notbooks
    By vuther316 in forum TroubleShooting Archive
    Replies: 4
    Last Post: 2016-04-15, 08:23
  3. Installing Kali Linux on USB Flash Drive Error
    By ShaneF in forum Installing Archive
    Replies: 7
    Last Post: 2016-01-26, 16:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •