LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2015, 06:45 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 328

Rep: Reputation: 6
Adding to GRUB


I would like to add my Windows 8.1 partition to me GRUB menu but I' not sure how I need to go about that. I was just reading one of my Linux books and can't even get any of the grub commands to work that the book wants me to try out. The book wants me to try the 'ls' command while and grub and it also wanted me to run 'echo $root' but in both cases I'm getting Error 27: Unrecognized command, Any ideas?

So here's what I've found as far as adding Windows to my boot menu.

garrett@mint-desktop /etc/grub.d $ ls
00_header 01_otheros 05_debian_theme 06_mint_theme 10_linux 10_lupin 20_linux_xen 20_memtest86+ 30_os-prober 30_uefi-firmware 40_custom 40_custom.orig 41_custom README
garrett@mint-desktop /etc/grub.d $ cat README

All executable files in this directory are processed in shell expansion order.

00_*: Reserved for 00_header.
10_*: Native boot entries.
20_*: Third party apps (e.g. memtest86+).

The number namespace in-between is configurable by system installer and/or
administrator. For example, you can add an entry to boot another OS as
01_otheros, 11_otheros, etc, depending on the position you want it to occupy in
the menu; and then adjust the default setting via /etc/default/grub.
garrett@mint-desktop /etc/grub.d $

I also found this
garrett@mint-desktop /etc/grub.d $ cat 40_custom.orig
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

So I don't know if I would start a new file with the prefix 01 or if I should just place the Windows boot in the 40_custom file?

Here's some more helpful info
garrett@mint-desktop /etc/grub.d $ mount | grep /dev/sd
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
/dev/sdb1 on /home/other type ext4 (rw)
/dev/sdc on /home/garrett type ext4 (rw)
/dev/sdd7 on /media/garrett/Files type ext4 (rw)
/dev/sdd4 on /media/garrett/Windows2 type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
garrett@mint-desktop /etc/grub.d $ blkid /dev/sdd4
/dev/sdd4: LABEL="Windows" UUID="008ECADA8ECAC77E" TYPE="ntfs"

Also, if I cat the file /boot/grub/grub.cfg one of the first things I see is a comment saying DO NOT EDIT

And finally here's what I've started. I started editing the 40_custom file (don't know if that was the right way to go or not) and here's what I have.

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Windows 8.1' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 008ECADA8ECAC77E
else
search --no-floppy --fs-uuid --set=root 008ECADA8ECAC77E
fi
echo 'Loading Winows 8.1 ...'
linux /boot/vmlinuz-3.13.0-24-generic root=UUID=008ECADA8ECAC77E ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.13.0-24-generic

Note that I replaced all the Linux UUIDs with the Windows device UUID. What else do I need to edit or is this a completely wrong approach?
 
Old 08-01-2015, 10:01 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,947

Rep: Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070
First, when posting output, use [code]...[/code] tags - that way layout (and readability) is maintained.
If you are running a current Mint, a simple "sudo update-grub" should fix things. That update to 40_custom won't work, but it is where you'll need to fix things if the update-grub doesn't.

I did find reference to a UEFI issue in Ubuntu - are you UEFI or BIOS firmware ?.
 
Old 08-02-2015, 10:23 AM   #3
Garrett85
Member
 
Registered: Jan 2011
Posts: 328

Original Poster
Rep: Reputation: 6
Pretty sure I'm BIOS. sudo update-grub actually doesn't work, I've tried it several times in the past. I usually don't ever even see my GRUB screen, after the Gigabyte BIOS screen loads it goes straight to the Mint login.
 
Old 08-02-2015, 11:18 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware, Ubuntu
Posts: 10,094

Rep: Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369
The 'ls' command they are referring to you should be run when you see the Grub menu, not after you have booted Mint. It will show the drives/partitions on which boot files reside.

Your partition information shows a windows partition on sdd4, which would be the fourth partition on the fourth hard drive. Your menuentry you show for windows points to sda1 which is what the set root line below indicates:

Code:
set root='hd0,msdos1'
Quote:
Also, if I cat the file /boot/grub/grub.cfg one of the first things I see is a comment saying DO NOT EDIT
If you read the next line in that file you will see why they suggest you not edit. If you run update-grub, any changes in grub.cfg will not be saved, the changes need to be made in one of the /etc/grub.d files. If you don't run update-grub the change will stay. If you have an installed system you are better off doing it this way.

Did you install windows 8.1 or was it pre-installed? Almost all pre-installed windows 8 and later are UEFI/GPT. You need to verify that. Simples way to do that is to boot Mint, go to the site below and download and run the bootinfoscript. It will output a results.txt file which you can post here as it will give a lot of details on your system boot files.
 
Old 08-02-2015, 06:32 PM   #5
Garrett85
Member
 
Registered: Jan 2011
Posts: 328

Original Poster
Rep: Reputation: 6
go to the site below and download and run the bootinfoscript. Site below, what are you talking about? Also, I was running the `ls` command after getting the GRUB menu, or the GRUB prompt.
 
Old 08-02-2015, 07:36 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,947

Rep: Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070
Try here.
 
Old 08-02-2015, 09:56 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware, Ubuntu
Posts: 10,094

Rep: Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369
Sorry, forgot to post the link but syg00 posted it.

Quote:
Also, I was running the `ls` command after getting the GRUB menu, or the GRUB prompt.
I was basing that comment on what you posted in the initial post which was the output of ls in the /etc/grub.d directory while booted into the system. Posting the results.txt file from the bootinfoscript would go a long way to getting an answer as it will provide much more detailed information on drives/partitions. It would also tell us whether you are using MBR or UEFI. If you are using MBR, your windows entry is incorrect based on the info you provided initially.
hd0, msdos1 is the same as sda1 which you show as a Linux filesystem and can't contain windows.

Last edited by yancek; 08-02-2015 at 09:59 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Adding to Grub zchoyt Linux - Software 3 08-15-2005 10:34 PM
Adding to GRUB stolieman Linux - General 1 11-20-2004 12:42 AM
adding OS to Grub jturnbul Fedora 6 09-16-2004 08:29 PM
1st HDD = RH9.0 (grub) ... How do I modify grub when adding 2nd hard disk ? Onyx^ Linux - Software 1 09-05-2003 09:16 AM
Help adding XP to Grub? superdigg Linux - Newbie 1 01-09-2003 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:57 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