Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
My problem is related to installation to an SSD rather that normal HD. It results instead os SDA to "nvme".
I have read and read and tried different setups but have no clue how to fix it.
I have done in the past dual boot of Ubuntu and Kodi (OpenELEC and LibreELEC) but now since I have a new system that has a M2 SSD Samsung EVO960 I have a hell of the problems.
I have done the Ubuntu 16 installation from a USB stick with no problems. I have repartitioned the drive accordingly and set the proper boot flag.
I have installed grub customizer and my problem is to properly boot from grub menu in Kodi
In the past, or on a normal drive, it was SDA, SDB, and so on but with the SSD there "nvme0n1, nvme0n1p1, nvme0n1p2, etc. This screws things up for me in custom40 file. Here is what I did and what I got:
Code:
htpc@htpc:~$ sudo blkid -c /dev/null -o list
device fs_type label mount point UUID
------------
/dev/loop0 squashfs /snap/core/4571
/dev/nvme0n1 (in use)
/dev/nvme0n1p1 vfat /boot/efi 633C-3EBA
/dev/nvme0n1p2 ext4 / 85fb1049-5c04-4c50-ac8b-3c552dcda936
/dev/nvme0n1p3 ext4 LibreELEC (not mounted) c532fde5-0eeb-454c-8459-008f9fb64253
/dev/nvme0n1p4 ext4 LibreSYS (not mounted) 8449179d-34df-4d19-b63d-1247b4bef996
My custom40 file it looks like this but it was much longer since I have tried a lot of things. Something is wrong and someone knowledgeable probably will see my mistake immediately. Sometime in first variant1 it boots but most of the times it says "hd0,4 not found". Based on the info above what should I write in the custom40 file please?
Code:
#!/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 "Entertainment System1" {
set root=(hd0,4)
linux /KERNEL boot=/dev/nvme0n1p4 disk=/dev/nvme0n1p3 quiet
}
menuentry "Entertainment System6" {
search --file --no-floppy --set root=633C-3EBA
chainloader (${root})/efi/bootx64.efi
linux /KERNEL boot=/dev/nvme0n1p4 disk=/dev/nvme0n1p3 quiet
}
menuentry "Entertainment System7" {
search --file --no-floppy --set root=633C-3EBA
chainloader (${root})/boot/efi/bootx64.efi
linux /KERNEL boot=/dev/nvme0n1p4 disk=/dev/nvme0n1p3 quiet
}
menuentry "Entertainment System8" {
set root=UUID=633C-3EBA
chainloader (${root})/boot/efi/bootx64.efi
linux /KERNEL boot=/dev/nvme0n1p4 disk=/dev/nvme0n1p3 quiet
}
menuentry "Entertainment System9" {
search --set=root --LABEL LibreSYS --hint hd0,4
linux /KERNEL boot=LABEL=LibreSYS disk=LABEL=LibreELEC
}
menuentry "Entertainment System10" {
search --set=root --LABEL=LibreSYS --hint hd0,4
linux /KERNEL boot=LABEL=LibreSYS disk=LABEL=LibreELEC
}
menuentry "Entertainment System12" {
set root=633C-3EBA
linux /KERNEL boot=UUID=8449179d-34df-4d19-b63d-1247b4bef996 disk=UUID=c532fde5-0eeb-454c-8459-008f9fb64253
}
menuentry "Entertainment System21" {
set root=(nvme0n1,nvme0n1p3)
linux /KERNEL boot=UUID=8449179d-34df-4d19-b63d-1247b4bef996 disk=UUID=c532fde5-0eeb-454c-8459-008f9fb64253
}
menuentry "Entertainment System22" {
set root=(nvme0n1,nvme0n1p3)
linux /KERNEL boot=/dev/nvme0n1p4 disk=/dev/nvme0n1p3 quiet
}
menuentry "Entertainment System23" {
set root=(nvme0n1p1,nvme0n1p3)
linux /KERNEL boot=/dev/nvme0n1p4 disk=/dev/nvme0n1p3 quiet
}
The above from your initial post shows your / filesysttem partition which would be equivalent to sda2, n1 (drive one) p2 (partition two).
You don't seem to be using the Ubuntu grub.cfg, what are you using? Why do you not just use UUIDs. A standard Ubuntu entry will have a kernel line beginning with: linux /boot/vmlinuz?? and then the parameters Your set root line should be pointing to (hd0,gpt2). Not sure where you are getting the below from although some Linux systems use similar entries, not Ubuntu. Where do you get the /KERNEL in the entry from?
Thanks Keruskerfuerst! Yes, that's what I have now in Ubuntu 16.04, exactly what you are de describing. So it appears that Ubuntu 18 will do the same.
My problem is to use the correct syntax in "40_custom" file and that's what don't know how to do it.
Quote:
The above from your initial post shows your / filesysttem partition which would be equivalent to sda2, n1 (drive one) p2 (partition two).
You don't seem to be using the Ubuntu grub.cfg, what are you using? Why do you not just use UUIDs. A standard Ubuntu entry will have a kernel line beginning with: linux /boot/vmlinuz?? and then the parameters Your set root line should be pointing to (hd0,gpt2). Not sure where you are getting the below from although some Linux systems use similar entries, not Ubuntu. Where do you get the /KERNEL in the entry from?
Thank you yancek! I use Ubuntu 16.04 and I have also installed Grub customizer. The last of my quote is the content of "40_custom" file found in /etc/grub.d/ so I edited it and added the menuentries in different variants, many of them I have erased. /KERNEL as I understand is still used in Ubuntu and based on older files that worked, I have built the "40_custom" file as I thought, obviously wrong.
I would use anything to make this thing work so I tried with UUID's too as it is in one of the menuentry. Using the correct syntax is the problem with me.
Below is a basic Ubuntu 16.04 menuentry which works.
Quote:
menuentry 'Ubuntu 16.04' {
insmod part_gpt
insmod ext2
set root='hd0,gpt6'
linux /boot/vmlinuz-4.4.0-124-generic.efi.signed root=UUID=f98155d5-9c89-48ea-9118-bf686c346caa ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.4.0-124-generic
}
If you are using a Legacy or non-gpt system, replace the line: insmod part_gpt with insmod part_msdos but since you are using EFI, it is most likely a GPT partitioned drive. Your set root line needs to be similar to the above as Grub will not understand entries such as some you have in your first post: set root=(nvme0n1,nvme0n1p3)
Yours should be: set root='hd0,gpt2' or msdos2 as that is where your / (root) filesystem is and hopefully the kernel. Older versions of Linux used 'kernel' to point to the kernel file (vmlinuz in most cases) and newer versions use 'linux' so the line beginning with linux should point to the location where the kernel actually exists which on Ubuntu, should be in the boot directory. You would have to have the correct absolute path and the correct absolute name of the kernel (vmlinuz file). Ubuntu 16.04 should have the '.efi' extension.
If you installed Ubuntu last, this should all have been taken care of during the installation. Are the other two partitions different operating system or just media data? I would not expect any of the menuentries you have in your first post to boot Ubuntu. Some info on using Grub2 with Ubuntu including sample menuentries at the link below.
If you can't resolve this you should go to the site below from the Ubuntu install media if you can't boot the insttalled system and use the 2nd option to get boot repair. After downloading and running per the instructions, make sure you only select the option to Create BootInfo Summary and post the link to the output here. That should give more detailed information on your system and efi and other boot files.
from a ubuntu terminal: sudo ls /boot/efi/EFI to see what the different boot directories are on the efi partition. bootx64.efi maybe named something else and will have to change accordingly.
Last edited by colorpurple21859; 05-14-2018 at 05:27 AM.
The truth is I am all over the place and I cannot get a proper config to work reliably. I am running around like a chicken without head and it seem that is beyond my capability.
Here is an overview of what I have and what I did.
- The computer is a Intel NUC Skull Canyon NUC6i7KYK Kit with 6th Gen. Intel Core i7 Processor, 8Gb ram and 256 M2.SSD. This M2.SSD gave me the headaches since Ubuntu recognize it as "nvme0n1" instead of SDA.
- I have installed with no problems Ubuntu 16.04/64bit from a USB stick, it is formatted as GPT. As few times before on other PC configs, with GParted I have created another two partitions, so there is 1st partition EFI auto created by Ubuntu, the 2nd is with Ubuntu and two others formated in EXT4: "nvme0n1p4" called LibreSYS that is bootable (this is the 4th partition) and "nvme0n1p3" called LibreELEC that holds the data (3rd partition). As known by media community, Kodi (LibreELEC) requires two partitions, one for boot and one where the actual app resides.
- I have installed Kodi (LibresELEC) same as many times before and I was supposed to go back in Ubuntu, install the grub customizer, create the menuentry for Kodi and done so that at grub menu, I could choose to go into Ubuntu or Kodi.
I ran into problems at this point because what I knew and my old config of "40_custom" file did not work anymore.
Now here is the strangest thing... With this config,
Code:
menuentry "Entertainment System1" {
set root=(hd0,4)
linux /KERNEL boot=/dev/nvme0n1p4 disk=/dev/nvme0n1p3 quiet
}
sometimes it boots in Kodi when selected in menu but other times it shows "cannot find hd0,4) or /KERNEL not found. If I take out "/Kernel" doesn't work at all and this is weird!
Ever since I have tried a lot of combinations but none of them worked.
"yancek": I have wrote "set root='hd0,gpt2'" and in Ubuntu root I do have the vmlinuz file. I have tried various combinations based on your suggestions without luck. I am tempted to try boot repair app as suggested but I do not want to screwup the whole installation since I believe it is correct, it is just this damned menu to have correct pointing.
"colorpurple21859": the chainloader is something new for me and have no clue how to use it.
If LibreELEC was installed in efi mode then there should be a folder that was created by LibreELEC on the efi partition with a boot file in it. This boot file is what you chainload. I don't use LibreELEC but did download the install file to see what was on it. It looks like LibreELEC uses syslinux for booting and /kernel is the kernel that runs the system. similar to /vmlinuz on the Ubuntu partition. If your booting the system with a usb stick inserted maybe causing the grub confusion. See if it makes a difference if the usb stick is inserted or not when first turned on.
Last edited by colorpurple21859; 05-15-2018 at 07:47 AM.
grub hack to dual boot with Windows on an NVMe drive
I had a similar problem & found an odd solution that might work for some.
Windows 10 Pro was installed on an NVMe M.2 drive.
Wanted to install CentOS 7 and had a spare NVMe M.2 drive, so installed CentOS 7 on it.
Could boot into CentOS 7 but needed to add menu item & commands in grub to boot Windows.
Couldn't figure out how to reference NVMe M.2 drive & partition with Windows on it to get commands right.
In boot loader, happened to enter "c" to get to command line, still couldn't figure it out, so entered "exit" & hit return.
.... and the system then booted Windows. Aha moment followed. Hack implemented & tested & works for me (YMMV).
Solution:
1. Set boot order in UEFI/BIOS to boot CentOS drive first & Windows drive second (well, not first).
2. Edit /etc/grub.d/40_custom & add the following (obviously, use the menuentry label of your choice):
menuentry "Windows 10" {
exit
}
3. Run grub2-mkconfig --output=/boot/efi/EFI/centos/grub.cfg
4. Reboot.
5. Laugh.
Solution:
1. Set boot order in UEFI/BIOS to boot CentOS drive first & Windows drive second (well, not first).
2. Edit /etc/grub.d/40_custom & add the following (obviously, use the menuentry label of your choice):
menuentry "Windows 10" {
exit
}
3. Run grub2-mkconfig --output=/boot/efi/EFI/centos/grub.cfg
4. Reboot.
5. Laugh.
THIS IS AWSOME!! Works on Ubuntu20.04-LTS with M.2 SSD for windows.
I had the same problem and tried several solutions (which wasted hours). This really works. I have always been a little intimidated by GRUB. I used the GUI grub-customizer. The menuentry you create makes another one at runtime. This second entry only has
Code:
setparams "Windows 10" exit
. Nice solution but you still needed to select the new entry at runtime/grub boot. I wanted to default to my windows partition if I let the timer expire so I added this to grub-customizer and set it as the default. It works. I am impressed with this and had to give catmandew a big high 5. Sorry to bump an old thread, but this is clearly a somewhat common issue with dual booting and this is the first workaround I've seen work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.