LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2014, 04:35 PM   #1
benf96
LQ Newbie
 
Registered: May 2014
Posts: 6

Rep: Reputation: Disabled
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!

Last edited by benf96; 05-29-2014 at 07:10 PM.
 
Old 05-30-2014, 06:42 AM   #2
benf96
LQ Newbie
 
Registered: May 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
can a mod move this to linux - general please?
 
Old 05-30-2014, 08:31 AM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,526

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
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
}
 
Old 05-30-2014, 01:30 PM   #4
benf96
LQ Newbie
 
Registered: May 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for the help man! I'll try it out later!
 
Old 05-31-2014, 08:10 AM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
/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.
 
Old 05-31-2014, 08:58 AM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,354

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
At the grub command prompt this might work
Code:
set root=(hd1)
chainloader +1
boot
 
Old 05-31-2014, 05:49 PM   #7
benf96
LQ Newbie
 
Registered: May 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-01-2014, 12:17 AM   #8
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
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.
 
Old 06-01-2014, 07:31 AM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I add Opensuse to Grub2 menu in a triple boot setup Speedy624 Linux - Software 4 03-20-2013 05:00 PM
Grub2 and my old menu.lst Pedroski Linux - Software 13 10-13-2011 06:35 PM
[SOLVED] GRUB2 menu nasa_pete Linux - Newbie 3 06-12-2011 10:44 PM
GRUB2 - FreeBSD-8.0 does not show up in triple boot menu, dual boot menu it does.. wiliweld *BSD 7 05-03-2010 01:05 PM
Struggling Add/Remove Packages gibbylinks Red Hat 8 12-07-2003 02:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration