LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-09-2022, 11:45 PM   #1
kkv1
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Rep: Reputation: 1
Unable to boot from nvme


I have a debian bullseye. I bought a new NVME via PCI that doesnt show in bios. However, I am able to install debian into it and that completes successfully. However, upon reboot, it shows up with the grub from original drive and cannot boot into the NVME. I dont mind grub in the original disk but want the entire OS in the NVME since that is the purpose of buying the drive.

Any thoughts how I can configure grub to boot from the new drive? I tried installing debian again into the original disk which created boot entries for the nvme disk (hence it does recognize it), but gives errors if I select it.
 
Old 01-10-2022, 12:40 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
would be nice to post those error messages and other details (like which hardware, which version...). Actually it (the same setup) works for me very well.
 
Old 01-10-2022, 04:47 AM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,504

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
What OS is running on the original drive? Have you run grub-mkconfig on that OS? Is this an EFI install or Legacy/CSM? WHen you install a Linux system, you should have an option for bootloader installation. WHich opton did you select? If the drive doesn't show in the BIOS I would expect problems. Could you post the outpt of this command run with root privileges: parted -l
 
Old 01-10-2022, 11:53 AM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
I bought a new NVME via PCI that doesnt show in bios.
If you have an M.2 slot on your motherboard and the drive is installed there but not detected, check your motherboard manual and bios setup; there may be a setting there which is required to activate the M.2 slot and NVME drive. Something is definitely amiss either with your bios setup settings or there may be some compatibility issue between your bios and the particular NVME drive. Posting the make and model of each would be helpful. Also, check to see if your motherboard has a bios update which may address this issue.

As to why it's not booting has to do with the way the linux boot process works. Basically, on power up, the bios loads grub which looks to the bios for the location of the linux kerenel and initrd.img and they are loaded into memory. Once the kernel and initrd is loaded, linux kisses the bios goodbye and all further hardware detection is done by the kernel. When you installed Debian from a flash drive, the kernel was on the installation flash drive and loaded into memory where your NVME drive was detected by the kernel. Since your bios doesn't detect the NVME drive, there's no way for the kernel on the NVME drive to load into memory.

You could try reinstalling and putting the /boot partition on another drive that the bios can detect along with installing the bootloader there. That way, your Debian grub and kernel can be loaded from that location since the drive is detected by the bios. After the kernel loads from that location on the bios detected drive, the Debian linux kernel can find and use your NVME drive.

Last edited by kilgoretrout; 01-10-2022 at 12:14 PM.
 
Old 01-10-2022, 11:59 AM   #5
kkv1
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Original Poster
Rep: Reputation: 1
The errors were before booting and didnt get to var/log. They are:
Quote:
error: No such device: <guid>
error: disk 'hostdisk //dev/nvme01,msdos1' not found
error: you need to load the kernel first
Same USB to install OS on both drives, not using efi and no M.2 on MB hence the PCI. Didnt run grub-mkconfig and avoided it by reinstalling OS in the old drive to leverage on the install finding all installed OSs. It found windows also which boots fine. parted results are :

Quote:
Disk /dev/nvme0n1: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 499GB 499GB primary ext4
2 499GB 500GB 1022MB extended
5 499GB 500GB 1022MB logical linux-swap(v1)

Last edited by kkv1; 01-10-2022 at 12:10 PM.
 
Old 01-10-2022, 12:29 PM   #6
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
error: you need to load the kernel first
So put it in a location where it can be loaded. Reread my above post on the boot process. Reinstall putting /boot, which contains the kernel, on a drive detectable by your bios. You will never be able to boot from a drive not detectable by your bios, but you can put the boot code(grub, kernel intrd.img) on a drive detectable by your bios and put everything else on your add-in card NVME.
 
Old 01-10-2022, 06:08 PM   #7
kkv1
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Original Poster
Rep: Reputation: 1
Does it mean I need to reinstall the OS or is there a console script that I can use ?
 
Old 01-11-2022, 06:29 PM   #8
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
Does it mean I need to reinstall the OS or is there a console script that I can use ?
That would be the easiest way; there is no magic script to make all the changes that would need to be made otherwise. You need to create a partition on your bios recognized drive that will be your /boot partition. It's probably easier to do that before installation with a livecd like gparted:

https://gparted.org/livecd.php

Size wise, 1GB should be more than enough. During installation select manual partitioning at the partitioning set up. Then select your previously made 1GB partition where you will be given a list of options for mount point. Select "other" or "manual" since none of the options listed will be appropriate. Then for mount point write:
Code:
/boot
Then go back and select your NVME drive and create a partition for your Debian installation and for its mount point select the "/" option which I believe would be the default. You will also have to direct the grub installation to install on the bios detected hard drive.

I don't know how familiar you are with linux installations so some or all of this may be over your head. The above procedure summarizes what needs to be done. If anything is not clear or you run into issues, feel free to post back with any questions.
 
1 members found this post helpful.
Old 09-14-2023, 02:24 PM   #9
GailH
LQ Newbie
 
Registered: Apr 2011
Location: Southfield, MI
Distribution: Ubuntu 14.4
Posts: 7

Rep: Reputation: 0
How to command Grub2 to do this

Quote:
Originally Posted by kilgoretrout View Post
That would be the easiest way; there is no magic script to make all the changes that would need to be made otherwise.
... ...
I don't know how familiar you are with linux installations so some or all of this may be over your head. The above procedure summarizes what needs to be done. If anything is not clear or you run into issues, feel free to post back with any questions.
Can you show how to steer Grub2 to boot from the first partition, (I guess just the initrd), then hand-off control to the NVME partition? (I have the same problem, using Ubuntu 18).

Last edited by GailH; 09-14-2023 at 02:25 PM.
 
Old 09-14-2023, 06:50 PM   #10
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
Quote:
Partition Table: msdos
The drive not being gpt may be your problem if this is a uefi system.
 
Old 09-17-2023, 01:01 PM   #11
only-connect
LQ Newbie
 
Registered: Sep 2023
Location: UK
Posts: 15

Rep: Reputation: 1
Quote:
Originally Posted by kilgoretrout View Post
So put it in a location where it can be loaded. Reread my above post on the boot process. Reinstall putting /boot, which contains the kernel, on a drive detectable by your bios. You will never be able to boot from a drive not detectable by your bios, but you can put the boot code(grub, kernel intrd.img) on a drive detectable by your bios and put everything else on your add-in card NVME.
bios? What do you mean by bios?
What if people are experiencing problems because of UEFI?
You understand what UEFI is right?
 
  


Reply

Tags
boot errors



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] unable to mount rootfs on unknown-block(0 0) using nvme drive Si1kn Linux From Scratch 2 01-06-2022 10:27 PM
Unable to use NVMe device on X570-P motherboard; refcount_t and percpu errors TheOneKEA Linux - Hardware 7 01-25-2021 02:51 PM
LXer: Data in a Flash, Part II: Using NVMe Drives and Creating an NVMe over Fabrics Network LXer Syndicated Linux News 0 05-20-2019 11:41 PM
Migrate Linux/win10 dual boot from MBR nvme drive to a new GPT nvme drive bluemoo Linux - Software 7 09-25-2018 06:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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