Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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 ?.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.