LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-05-2021, 01:55 AM   #31
marco70
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 103

Rep: Reputation: 40

Hello
I converted my system from MBR to GPT slackware-current.
How to install EFI grub on /dev/nvme0n1p1 ?

the only way to boot the system is this way.
Is this correct ?

Code:
# mkdir /mnt/usb/boot
# mount /dev/nvme0n1p1 /mnt/usb
# grub-install --target=x86_64-efi --removable --boot-directory=/mnt/usb/boot --efi-directory=/mnt/usb
Code:
# efibootmgr -v
BootCurrent: 0009
Timeout: 0 seconds
BootOrder: 0009
Boot0009* UEFI OS       HD(1,GPT,57fd1441-8ff4-4444-de5e-85ffcd68b9b0,0x800,0x96000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
I tried to install grub in
Code:
/boot/efi
but can't see the disk in GPT

Code:
# gdisk -l /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/nvme0n1: 976773168 sectors, 465.8 GiB
Model: CT500P5PSSD8                            
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): A2D2048A-AC44-48F2-CC50-B6CFE2D9F99E
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          618495   301.0 MiB   EF00  Basic data partition
   2          618496       240312319   114.3 GiB   0700  Basic data partition
   3       240312320       262279167   10.5 GiB    0700  Basic data partition
   4       262279168       976773119   340.7 GiB   0700  Basic data partition
Attached Thumbnails
Click image for larger version

Name:	gparted.jpg
Views:	23
Size:	69.6 KB
ID:	37138  

Last edited by marco70; 09-05-2021 at 02:14 AM.
 
Old 09-05-2021, 02:07 AM   #32
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,700

Rep: Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381
Are you trying to install grub from a fresh install?
 
Old 09-05-2021, 02:19 AM   #33
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
Hi OP.

I had some issues with LILO booting Windows 10 from a NVME. I solved them by adding this option to /etc/lilo.conf:

disk=/dev/nvme0n1 bios=0x80 max-partitions=7

Here's the original read:
https://rlaanemets.com/post/show/computer-upgrade

and a post in my humble blog:
https://slackalaxy.com/2020/10/31/lilo-and-nvme/
 
2 members found this post helpful.
Old 09-05-2021, 02:59 AM   #34
marco70
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 103

Rep: Reputation: 40
Quote:
Originally Posted by Daedra View Post
Are you trying to install grub from a fresh install?
No this is my old system converted to GPT.
 
Old 09-05-2021, 03:01 AM   #35
marco70
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 103

Rep: Reputation: 40
Quote:
Originally Posted by solarfields View Post
Hi OP.

I had some issues with LILO booting Windows 10 from a NVME. I solved them by adding this option to /etc/lilo.conf:

disk=/dev/nvme0n1 bios=0x80 max-partitions=7

Here's the original read:
https://rlaanemets.com/post/show/computer-upgrade

and a post in my humble blog:
https://slackalaxy.com/2020/10/31/lilo-and-nvme/
Lilo is out.
Must be a grub.
 
Old 09-05-2021, 03:18 AM   #36
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by marco70 View Post
Hello
I converted my system from MBR to GPT slackware-current.
How to install EFI grub on /dev/nvme0n1p1 ?
I'm confused by what you're trying to do. You say you want to install GRUB to the NVMe drive, but then showed how you installed it to USB?

Also, I'm not sure if you can "convert" an MBR partition table to GPT.

Are you wanting to preserve the data on this disk? Will you be dual booting with Windows?

Your partition types appear to be incorrect. Linux-swap is type 82 or 8200. Linux-data is type 83 or 8300.

Have you looked at the man page for grub-install?
 
Old 09-05-2021, 03:39 AM   #37
marco70
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 103

Rep: Reputation: 40
Quote:
Originally Posted by rkelsen View Post
I'm confused by what you're trying to do. You say you want to install GRUB to the NVMe drive, but then showed how you installed it to USB?

Also, I'm not sure if you can "convert" an MBR partition table to GPT.

Are you wanting to preserve the data on this disk? Will you be dual booting with Windows?

Your partition types appear to be incorrect. Linux-swap is type 82 or 8200. Linux-data is type 83 or 8300.

Have you looked at the man page for grub-install?
slackware boots from a partition /dev/nvme0p1, where grub is installed in usb mode.

Code:
blkid
/dev/nvme0n1p1: LABEL="ESP" UUID="CC98-79E4" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="57fd1441-8ff4-4444-de5e-85ffcd68b9b0"
/dev/nvme0n1p2: LABEL="root" UUID="37937c0d-aa62-4a3c-8e12-9235e2d0e028" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="21c0bb05-21dd-452b-2cb4-fe382adb26ea"
/dev/nvme0n1p3: TYPE="swap" PARTLABEL="Basic data partition" PARTUUID="bc159aeb-5838-4e32-fc9e-07cb5ff1d80d"
/dev/nvme0n1p4: LABEL="home" UUID="70d998e2-31fc-4203-924e-86cc4062bec6" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="15f9c53f-e05b-4f18-9904-54e33b92350c"
Can be converted -> paragon software.
No windows sytem.
in GPT mode the system loads faster and grub runs in 1920x1200 resolution

https://docs.slackware.com/howtos:sl...based_hardware
 
Old 09-05-2021, 03:54 AM   #38
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by marco70 View Post
slackware boots from a partition /dev/nvme0p1, where grub is installed in usb mode.
Why USB mode?

What do you get when you do:
Code:
# grub-install /dev/nvme0n1p1
Where it says "0700" for partitions 2, 3 & 4, it should say: 8200 for partition 3 and 8300 for partitions 2 & 4.
Code:
   1            2048          618495   301.0 MiB   EF00  Basic data partition
   2          618496       240312319   114.3 GiB   0700  Basic data partition
   3       240312320       262279167   10.5 GiB    0700  Basic data partition
   4       262279168       976773119   340.7 GiB   0700  Basic data partition
0700 is a Microsoft partition.
Quote:
Originally Posted by marco70 View Post
Can be converted -> paragon software.
Not sure if I like that idea, but anyhow... Paragon only runs in Windows, no? I guess you did it from Windows which is why your partition types are wrong.
Quote:
Originally Posted by marco70 View Post
No windows sytem.
Is there any data on this disk that you need to keep?
 
Old 09-05-2021, 04:02 AM   #39
marco70
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 103

Rep: Reputation: 40
Code:
# grub-install /dev/nvme0n1p1
Instalowanie dla platformy x86_64-efi.
Installation complete. No bugs were reported.
Code:
# efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0002,0001
Boot0000* slackware-15.0        HD(1,GPT,57fd1441-8ff4-4444-de5e-85ffcd68b9b0,0x800,0x96800)/File(\EFI\slackware-15.0\grubx64.efi)
I'll make a copy of the files and reinstall.
Paragon boot usb -> convert disk to GPT

Last edited by marco70; 09-11-2021 at 05:10 AM.
 
Old 09-05-2021, 04:19 AM   #40
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,700

Rep: Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381
I am not 100% sure what you are trying to do. Are you now going to do a reinstall of Slackware and use grub as your bootloader instead of elilo? If so that's as simple as not install lilo or elilo when promoted and at the very end of the install do not restart but select no to drop down to a shell then just run...

Code:
chroot /mnt
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub (Or whatever name you want instead of grub)
grub-mkconfig -o /boot/grub/grub.cfg
exit
reboot
 
Old 09-05-2021, 04:23 AM   #41
marco70
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 103

Rep: Reputation: 40
Yes, I will be installing again.
Thanks to everyone for your help.

It is like this now:
Code:
# gdisk -l /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/nvme0n1: 976773168 sectors, 465.8 GiB
Model: CT500P5PSSD8                            
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): A2D2048A-AC44-48F2-CC50-B6CFE2D9F99E
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 4077 sectors (2.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          575487   280.0 MiB   EF00  
   2          577536       240312319   114.3 GiB   8300  
   3       240312320       262279167   10.5 GiB    8200  
   4       262279168       976773119   340.7 GiB   8300
It worked without reinstallation with gparted, I changed the flags.
two commands were enough. Time to start 25s
Thanks rkelsen

Code:
# mount /dev/nvme0n1p1 /boot/efi
# grub-install /dev/nvme0n1p1
# efibootmgr -c -L "slackware-15.0" -l '\EFI\slackware-15.0\grubx64.efi'
# efibootmgr -c -d /dev/nvme0n1 -p 1 -L "slackware-15.0" -l '\efi\boot\bootx64.efi'
# grub-mkconfig -o /boot/grub/grub.cfg
Code:
# tree /boot/efi/ -L 3
/boot/efi/
├── EFI
│** ├── BOOT
│** │** └── BOOTX64.EFI
│** └── slackware-15.0
│**     └── grubx64.efi
└── System Volume Information
    ├── IndexerVolumeGuid
    └── WPSettings.dat
Code:
# efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000
Boot0000* slackware-15.0        HD(1,GPT,57fd1441-8ff4-4444-de5e-85ffcd68b9b0,0x800,0x8c000)/File(\EFI\BOOT\BOOTX64.EFI)

Last edited by marco70; 09-11-2021 at 05:11 AM.
 
Old 09-05-2021, 02:47 PM   #42
Loomx
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 184

Rep: Reputation: Disabled
Just FYI:

You can easily convert a disk from MBR to GPT (there is some risk but I have have done it successfully with a classroom of computers)

Simply open the disk as root with gdisk and it will prompt you to convert it.
You need a small amount of unused space at the start and end of the disk (from memory I used 1MB, which was overkill) as the GPT table takes more room than the MBR one, so you do need to be able to shrink that first partition. Luckily for me the first partition was swap.

I used dd to backup the MBR as a precaution.
 
1 members found this post helpful.
Old 09-06-2021, 02:27 AM   #43
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by Loomx View Post
Just FYI:

You can easily convert a disk from MBR to GPT (there is some risk but I have have done it successfully with a classroom of computers)

Simply open the disk as root with gdisk and it will prompt you to convert it.
Thanks!
 
  


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
rEFInd and GRUB messups of NuTyX under BtrFS hd_scania NuTyX 6 02-02-2021 04:54 AM
[SOLVED] Booting huge kernel with Grub or rEFInd gives kernel panic. Daedra Slackware 9 12-14-2020 08:56 PM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
lilo x elilo x grup2 x UEFI afreitascs Slackware 5 09-09-2012 10:55 AM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM

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

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