PDA

View Full Version : Unable to boot kali linux on surface pro 4



eddioot85
2017-03-06, 22:28
Hi all,

I am trying to install kali linux on a Micro SD in my Surface Pro 4. I got the bootable USB with the /EFI/Boot folder with grub.config, grubx64.efi and bootx64.efi. I use the latest Kali Linux build 2016.2 x64. The bootable USB is created in Rufus as an ISO image (DD image does not boot on the surface).

Booting from the USB goes well and I am able to install Kali on a new partition on the Micro SD. I don't get any errors regarding the installation. It tells me it is finished and I should be able to boot to my new OS.

When I try to boot from the micro SD it doesn't work, I get to see:

error: no such device : {long id}
Entering rescue mode
grub rescue>

I tried the ls command as suggested in some posts I found but it only returns: (hd0)

Any advise on how to get this to work? I did the installation twice with the same result.

eddioot85
2017-03-10, 07:51
I found a video for repairing this. Need to boot the Kali live usb and run some commands but it goes wrong at the first step.

I run gparted and see my partition as /dev/sda5. In need to run 'mount /dev/sda' and 'mount /dev/sda5' I get the error:
Mount: can't find /dev/sda5 in /etc/fstab

When I check that file the contents are:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=b16ca6a8-482c-41e7-bab7-e8c5f5bc3c82 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=50DF-F5D0 /boot/efi vfat umask=0077 0 1
# swap was on /dev/sda6 during installation
UUID=848f47d8-a778-47e5-be4e-3337ca3da83e none swap sw 0 0

_defalt
2017-03-10, 17:50
Your micro SD card is removable so grub has to be updated with that partition which contains kali else grub won't boot kali because it doesn't know where kali filesystem is. Thus, entering into grub rescue mode. By default, grub uses /dev/sda to boot kali but you can make it to boot partition by their UUID. UUID is remain unchanged even after ejecting it.

eddioot85
2017-03-15, 13:46
I formatted my internal harddrive and installed Kali and Windows on the harddrive. I now have a dual boot option and will use the microSD for storage :)

Now I only need to get the drivers for the typecover to work but that is a whole other issue.

@_defalt, thanks for the advise!

tobiabocchi
2017-07-12, 17:30
Hello, I am facing the same issue, I am trying to install Kali on a microSD on my surface pro 4, the whole installation process goes fine except for the installation of GRUB, the installation process says
"Unable to install GRUB in dummy Executing 'grub-install dummy' failed.
This is a fatal error."
do you know if it's even possible to get this to work? to install Kali on a removable drive such as a microSD?
what should io do to complete the installation?

_defalt
2017-07-12, 18:12
Hello, I am facing the same issue, I am trying to install Kali on a microSD on my surface pro 4, the whole installation process goes fine except for the installation of GRUB, the installation process says
"Unable to install GRUB in dummy Executing 'grub-install dummy' failed.
This is a fatal error."
do you know if it's even possible to get this to work? to install Kali on a removable drive such as a microSD?
what should io do to complete the installation?

Where do you want to install grub?

tobiabocchi
2017-07-13, 13:18
Thank you for your quick response!!
Where should i install it? I don't really care as long as Windows still works and kali boots, should i install it on the microSD card on on my main drive where Windows is installed?

_defalt
2017-07-14, 17:08
By default grub is installed in the EFI partition of your hard drive where Windows bootloader is. Follow the instructions given here:
https://forums.kali.org/showthread.php?36601-UEFI-How-to-repair-kali-linux-grub-dual-boot-with-Windows-10

tobiabocchi
2017-07-15, 11:05
ok thank you for helping me _defalt, i read that thread you reported and i am a little confused because my windows EFI partition is not on the same disk as the Linux filesystem's partition.
this is the output i'm getting from fdisk -l:
root@kali:/# fdisk -l
Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 730A6DC1-3AF0-4A93-B272-68BF93817077

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 923647 921600 450M Windows recovery environment
/dev/nvme0n1p2 923648 1128447 204800 100M EFI System
/dev/nvme0n1p3 1128448 1161215 32768 16M Microsoft reserved
/dev/nvme0n1p4 1161216 500117503 498956288 237.9G Microsoft basic data


Disk /dev/sdb: 14.5 GiB, 15552479232 bytes, 30375936 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbad74d2f

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 64 5456223 5456160 2.6G 17 Hidden HPFS/NTFS
/dev/sdb2 5456224 5457631 1408 704K 1 FAT12
/dev/sdb3 5457920 30373887 24915968 11.9G c W95 FAT32 (LBA)


Disk /dev/loop0: 2.4 GiB, 2558234624 bytes, 4996552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 59.5 GiB, 63864569856 bytes, 124735488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 11DEF76A-9D92-4264-AFEC-60E9E2638857

Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 91332607 90281984 43.1G Linux filesystem
/dev/sda3 91332608 124733439 33400832 15.9G Linux swap


can you help me editing the list of commands to install grub properly?
these are the commands

mount /dev/sda* /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mkdir /mnt/boot/efi
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
mkdir /run/lvm
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/hostrun
umount /mnt/run/lvm
umount /mnt
REBOOT

_defalt
2017-07-15, 18:50
The commands I'm listing below will install grub where your kali filesystem is.

mount /dev/sda2 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mkdir /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi
mount -o remount,rw /dev/sda1 /mnt/boot/efi
mkdir /mnt/hostrun
mount --bind /run /mnt/hostrun
chroot /mnt
mkdir /run/lvm
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/hostrun
umount /mnt/run/lvm
umount /mnt
REBOOT

tobiabocchi
2017-07-15, 23:02
I tried running those commands, but i'm getting an error:


root@kali:~# mount /dev/sda2 /mnt
root@kali:~# mount --bind /dev /mnt/dev
root@kali:~# mount --bind /proc /mnt/proc
root@kali:~# mount --bind /sys /mnt/sys
root@kali:~# mkdir /mnt/boot/efi
mkdir: cannot create directory ‘/mnt/boot/efi’: File exists
root@kali:~# mount /dev/sda1 /mnt/boot/efi
root@kali:~# mount -o remount,rw /dev/sda1 /mnt/boot/efi
root@kali:~# mkdir /mnt/hostrun
root@kali:~# mount --bind /run /mnt/hostrun
root@kali:~# chroot /mnt
root@kali:/# mkdir /run/lvm
root@kali:/# mount --bind /hostrun/lvm /run/lvm
root@kali:/# grub-install /dev/sda
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.

_defalt
2017-07-18, 08:21
Then install it in your hard drive.

tobiabocchi
2017-07-18, 08:34
then, correct me if i'm wrong, would it be:

nvme0n1p2 as sda+
and
nvme0n1p3 as sda*

thank you for your help!

_defalt
2017-07-18, 13:28
/dev/sda* will be /dev/sda2 which is your kali filesystem on your SD card.

/dev/sda+ is your /dev/nvme0n1p2 which is your EFI partition on your hard disk.

The grub-install command will also get changed as you are installing grub on your hard disk whose name is /dev/nvme0n1.

Use this command: grub-install /dev/nvme0n1

It is important that your sd card is plugged in before applying the operation. The names of partition may get changed after reboot so always use fdisk -l to list all partitions and their corresponding names.

I'm still trying to find out how to install grub on USB. I didn't understand the cause of your error. I thought it would work.

There are solutions on internet if you search how to install grub on USB.

tobiabocchi
2017-07-18, 14:35
ok I'll try it later today and let you know, I had it installed on a flash drive before, it was on a microSD but it was a 64 GB one, not a 32, do you think the space or brand of the microSD could affect the installation of grub?
hopefully, it'll work.. I'll let you know and thank you again for your help

_defalt
2017-07-18, 15:18
I found a better way: https://askubuntu.com/questions/180023/can-i-install-grub-on-an-usb-and-make-it-a-rescue-disk

Boot into kali-live:
sudo mount /dev/sda1 /mnt
sudo grub-install –boot-directory=/mnt/BOOT /dev/sda

/dev/sda is the name of your SD card. It may be different after reboot. Always use fdisk -l to check.

I hope it works. USB manufacturer and maximum capacity don't affect installation.

_defalt
2017-07-18, 19:14
Boot into kali-live:
sudo mount /dev/sda1 /mnt
sudo grub-install –boot-directory=/mnt/BOOT /dev/sda

This one solution is completely broken. I've tested it. Without chrooting into the installed kali filesystem one can't use the grub-install command. It will show you grub-install command not found error.

This step should have worked https://forums.kali.org/showthread.php?35570-Unable-to-boot-kali-linux-on-surface-pro-4&p=72862&viewfull=1#post72862 . I just tried this as an experiment to install grub in USB and it worked for me. Try this one again. Note that it requires your SD card to be plugged in and another kali live USB.

_defalt
2017-07-19, 12:17
Boot into kali-live. Mount your EFI partiton of your SD card. Go to /mnt and copy the EFI folder present in this zip file (http://s000.tinyupload.com/index.php?file_id=67567493033474139891). Now you have grub where you want it to be.

http://s000.tinyupload.com/index.php?file_id=67567493033474139891

tobiabocchi
2017-07-22, 02:12
ok I tried to re install the whole thing from zero, got the same error again and tried solution 1 with all those commands but I got the same error I was getting before... then I tried to mount the EFI partition and copy that folder, reboot, and select USB as a boot option but it doesn't find anything and brings me directly into the UEFI settings.. this is so frustrating.. I had the exact same system working with that microSD card a few weeks ago!

_defalt
2017-07-22, 06:59
I tried to mount the EFI partition and copy that folder, reboot, and select USB as a boot option but it doesn't find anything
You have to boot it manually. Go to boot menu options and select Boot from EFI. Select your USB>EFI>kali>grubx64.efi

tobiabocchi
2017-07-22, 15:10
I think I can only do as explained here:

https://www.microsoft.com/surface/en-ie/support/storage-files-and-folders/boot-surface-from-usb-recovery-device?os=windows-10&=undefined

Surface Studio, Surface Book, Surface Pro 4, Surface 3, or Surface Pro 3 with a configured boot order in UEFI

Step 1: Shut down your Surface.
Step 2: Insert the bootable USB drive into the USB port on your Surface.
Step 3: Press the power button to turn it on.
Step 4: Follow the on-screen instructions to boot from your USB drive.

how do I select it manually?

_defalt
2017-07-22, 15:48
Set the boot order to your hard drive again. As soon as you power on go to boot menu options. Make a quick search which key lets you go to boot menu options in your model. It can be f9,f11,f12. Once you reach boot menu select Boot from EFI just below the windows os manager. Rest i already told you how to proceed.

tobiabocchi
2017-07-22, 15:52
I think i can't do that on my surface pro 4 the only thing i can do is select the boot device which can be PXE network, internal storage or USB device

_defalt
2017-07-22, 16:25
New method
Boot into kali live. Run mount /dev/nvme0n1p2 /mnt. Go to /mnt/EFI and delete kali folder from there. Restart. Again boot into kali live. Run this



mount /dev/sda2 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mkdir /mnt/boot/efi
mount /dev/nvme0n1p2 /mnt/boot/efi
mount -o remount,rw /dev/sda1 /mnt/boot/efi
mkdir /mnt/hostrun
mount --bind /run /mnt/hostrun
chroot /mnt
mkdir /run/lvm
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/hostrun
umount /mnt/run/lvm
umount /mnt
REBOOT

SD card should be in.

tobiabocchi
2017-07-22, 20:14
2612just tried.. and again same error:



root@kali:/# mount /dev/sda2 /mnt
root@kali:/# mount --bind /dev /mnt/dev/
root@kali:/# mount --bind /proc /mnt/proc/
root@kali:/# mount --bind /sys/ /mnt/sys/
root@kali:/# mkdir /mnt/boot/efi
mkdir: cannot create directory ‘/mnt/boot/efi’: File exists
root@kali:/# mount /dev/nvme0n1p2 /mnt/boot/efi/
root@kali:/# mount -o remount,rw /dev/nvme0n1p2 /mnt/boot/efi/
root@kali:/# mkdir /mnt/hostrun
mkdir: cannot create directory ‘/mnt/hostrun’: File exists
root@kali:/# mount --bind /run /mnt/hostrun/
root@kali:/# chro
chrome-gnome-shell chromeos-tpm-recovery chroot
root@kali:/# chroot /m
media/ mnt/
root@kali:/# chroot /mnt/
root@kali:/# mkdir /run/lvm
mkdir: cannot create directory ‘/run/lvm’: File exists
root@kali:/# mount --bind /hostrun/lvm/ /run/lvm/
root@kali:/# grub-install /dev/sda
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.


i tried to run the command again with verbose output, I'll attach the file to my post

_defalt
2017-07-23, 05:43
If you have deleted the kali folder from EFI partition you can reinstall kali. It won't show you dummy failed error again.

tobiabocchi
2017-07-23, 18:55
Still doesn't work, I even tried to install it on my main hard drive but still getting the same errors

_defalt
2017-07-23, 19:46
It's hard to tell from your response what you are doing wrong . You should use some other linux distribution. They also work the same.

OR install kali in a virtual machine.

_defalt
2017-07-25, 10:27
Can you show the picture of Boot Configuration from your UEFI settings?

This post will help you to troubleshoot that error. https://unix.stackexchange.com/questions/379774/grub-installation-failed/379824

ApPLe76
2017-10-24, 09:58
The commands I'm listing below will install grub where your kali filesystem is.

mount /dev/sda2 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mkdir /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi
mount -o remount,rw /dev/sda1 /mnt/boot/efi
mkdir /mnt/hostrun
mount --bind /run /mnt/hostrun
chroot /mnt
mkdir /run/lvm
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/hostrun
umount /mnt/run/lvm
umount /mnt
REBOOT
I have further narrowed down my issue, I managed to mount the correct drives, when it came to grub-install /dev/sda I get:
grub-install /dev/nvme01
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.
How do I fix this. Please disregard my initial post.

_defalt
2017-10-24, 17:50
I have further narrowed down my issue, I managed to mount the correct drives, when it came to grub-install /dev/sda I get:
grub-install /dev/nvme01
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.
How do I fix this. Please disregard my initial post.

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

I added a line. Let me know if you face more errors.

ApPLe76
2017-10-24, 20:42
Thank you so much, GRUB now works however it is missing a Windows entry, this is ok as I can simply interrupt the boot and change to Windows but it would be nice to be able to choose Windows through GRUB.
Thank you!

_defalt
2017-10-25, 02:43
Thank you so much, GRUB now works however it is missing a Windows entry, this is ok as I can simply interrupt the boot and change to Windows but it would be nice to be able to choose Windows through GRUB.
Thank you!
Once you boot kali:
sudo update-grub
sudo grub-install /dev/sda

ApPLe76
2017-10-25, 06:02
Once you boot kali:
sudo update-grub
sudo grub-install /dev/sda

Legend. Thank you for your time!

I have done as you mentioned however it only takes me to grub after I run the reboot command, any time after that it boots straight to Windows. I have checked my boot order and I there is no Kali or GRUB option, only PXE, USB, Windows boot manager and Internal storage.

_defalt
2017-10-25, 10:13
Legend. Thank you for your time!
there is no Kali or GRUB option, only PXE, USB, Windows boot manager and Internal storage.
If you click on Windows boot manager, a sub-menu will open which changes boot priority of boot-loaders. You have to got to your BIOS SETUP to see these settings.

ApPLe76
2017-10-25, 11:39
If you click on Windows boot manager, a sub-menu will open which changes boot priority of boot-loaders. You have to got to your BIOS SETUP to see these settings.

By BIOS SETUP do you mean the Surface UEFI that you get by Power + Volume up? If so nothing happens when I click Windows Boot Manager.

_defalt
2017-10-26, 02:37
By BIOS SETUP do you mean the Surface UEFI that you get by Power + Volume up? If so nothing happens when I click Windows Boot Manager.
Yes. The boot priority settings is there somewhere in your UEFI settings. Search for how to change boot priority in Surface.

ApPLe76
2017-10-26, 11:35
Yes. The boot priority settings is there somewhere in your UEFI settings. Search for how to change boot priority in Surface.
There is nothing in my UEFI settings to change this, after going through your steps or reinstalling Kali it boots me once into the GRUB menu, after that if I select Windows it only boots Windows.

_defalt
2017-10-26, 12:22
it boots me once into the GRUB menu, after that if I select Windows it only boots Windows.
If you select Windows it obviously boots Windows. What you want your PC to do when you power it on? There is a boot configuration option in your UEFI settings in which you can drag and drop to arrange boot order. I don't know if microsoft allows to change boot priority for dual boot PC. Play with your settings until you learn them.