LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Struggling to add disk to grub2 menu (https://www.linuxquestions.org/questions/linux-newbie-8/struggling-to-add-disk-to-grub2-menu-4175506428/)

benf96 05-29-2014 04:35 PM

Struggling to add disk to grub2 menu
 
Hi, im not a complete newbie but am having a bit of trouble with GRUB2.

I am trying to boot a Kali Linux live usb to test the security of my pc but my computer's bios does not boot from usb very well, so i am going to use grub to do this instead.

I have read both of the dedoimedo tutorials and feel fairly confident with grub now, but trying to get it to all come together isn't quite happening.

The kali linux listing isn't in the grub menu at all

I have made a file in the /etc/grub.d/ directory named 09_kalios and made it executable with chmod, the contents of said file is below:

Code:

#!/bin/sh -e
echo "boot option added"
cat << EOF
menuentry "Kali OS" {
set root=(hd1,1)
linux /live/vmlinuz
initrd /live/initrd.img
}
EOF

just to check i have the naming convention right, under disks, the partition is listed as sbd1.

I have tried to change the boot parameters to "chainload (hd1,1)+1", but to no avail, I have also made sure to update-grub.

I have managed to run the usb in a vm successfully too so that is definitely working, i have a screenshot of the disks page here:

>> screenshot <<

Any help would be appreciated, as im struggling to see what is wrong and a fresh pair of eyes is useful, thanks!

benf96 05-30-2014 06:42 AM

can a mod move this to linux - general please?

yancek 05-30-2014 08:31 AM

Check the Ubuntu site for more details on Grub at the link below. I would start by adding: insmod iso9660 just below the menuentry line. If Kali is on sdb1 a chainload entry such as below might work. If you have a Live CD on the flash, you are booting isolinux/syslinux from Grub. I don't know if Kali is bootable directly as an iso as most ubuntu derivatives are but you could try it.

Code:

menuentry 'Kali' {
insmod iso9660
set root=(hd1,1)
chainloader +1
}


benf96 05-30-2014 01:30 PM

Thanks for the help man! I'll try it out later! :)

Shadow_7 05-31-2014 08:10 AM

/etc/grub.d/40_custom is meant for custom entries. You have to run update-grub to have that entry make it to your menu (/boot/grub/grub.cfg). But putting it in 40_custom should prevent it from getting removed at the next update. Since grub versions and new kernels can run update-grub and change things.

colorpurple21859 05-31-2014 08:58 AM

At the grub command prompt this might work
Code:

set root=(hd1)
chainloader +1
boot


benf96 05-31-2014 05:49 PM

i think it may be a problem with GRUB not being able to access the usb ports at boot, when the commandline method is used it cannot find the drive and when updating grub.cfg it doesnt mention that it has found either vmlinuz or the other images, but then again i seem to remember that you have to manually add a string in to make it print something? Oh well, im going to just use dvds, which is a shame as this issue happened with my last laptop too. thanks for your help either way.

EDDY1 06-01-2014 12:17 AM

What OS is controlling grub? This tells us how to help you with grub.
What is make & model of computer?
Have you checked in bios to see if you can enable usb from there.
If OS is installed to usb:
Does the usb drive power on when booting?
Have you checked to see if the usb is being read as a hdd usb or removable device?
There is a lot of information that hasn't been given to allow anyone to really help.

Shadow_7 06-01-2014 07:31 AM

If you boot to a grub command line you have to insmod some usb parts to "see" the usb options.

GRUB> insmod ohci
GRUB> insmod usb
GRUB> ls
(could be uhci, instead of ohci depending on your usb chipset)

Normally steps like that will be in your grub.cfg for the item that is attached via USB.

The update-grub process looks at bootable options "CURRENTLY" attached to the system. If it's not attached, aka plugged in when update-grub runs and you don't have the 40_custom manual config for it it'll be removed from your grub.cfg. Noting that every time the kernel gets an update, or grub gets an update the package manager will run update-grub.


All times are GMT -5. The time now is 12:32 PM.