Grub expert needed, my dual boot does not load GRUB anymore
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
I followed a number of steps
there is something wrong with my fdisk -l ?
Code:
billy-pc% sudo fdisk -l
Disk /dev/nvme0n1: 238.49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: PM961 NVMe SAMSUNG 256GB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B03E0E64-DB72-43F2-A2D5-70A2D2848690
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1026047 1024000 500M EFI System
/dev/nvme0n1p2 1026048 1288191 262144 128M Microsoft reserved
/dev/nvme0n1p3 1288192 369770495 368482304 175.7G Microsoft basic data
/dev/nvme0n1p4 464975872 465995775 1019904 498M Windows recovery environmen
/dev/nvme0n1p5 465995776 497776639 31780864 15.2G Windows recovery environmen
/dev/nvme0n1p6 497778688 500117503 2338816 1.1G Windows recovery environmen
/dev/nvme0n1p7 378720256 462116863 83396608 39.8G Linux filesystem
/dev/nvme0n1p8 369770496 378720255 8949760 4.3G Linux swap
Partition table entries are not in disk order.
and i get this error
Code:
billy-pc% sudo grub-install /dev/nvme0n1p1
Installing for i386-pc platform.
grub-install: warning: File system `fat' doesn't support embedding.
grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.
billy-pc%
I added in /etc/fstab this third line:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=bb57f30f-5414-42a4-a8ac-a18aad047d55 swap swap defaults,noatime 0 2
UUID=cc71e759-e197-45d1-aa7c-65db99f02915 / ext4 defaults,noatime 0 1
UUID=BC76-3943 /boot/efi vfat defaults,noatime 0 2
It's a gpt disk, and fdisk is for the older MBR system with it's size limit. This is supposed to end all battles with the system BIOS. MBR has a max of 4 primary partitions; if there's more, you have to make an extended partition and then subdivide that. You have no extended partition, so it's gpt. It wasn't uncommon for some windows things to overwrite the MBR. I don't know if it's still common.
Use gdisk, and I think 'gdisk -l' does a similar job. It's as alike to fdisk in options as possible.
We need to know where your /boot partition is, where grub is/was installed, and where boot was. You can then try something like this from your live cd:
Code:
cat /etc/fstab # then note your / and /boot drives.
# From your output, I'd guess p2 is your /boot and p7 is your /. don't guess!
mount <your boot drive> /mnt
mount <your boot drive> /mnt/boot
chroot /mnt # Gets you into your linux system in runlevel 3
# set up grub bearing in mind X or fancy utilities probably won't work.
# As a last resort just get your linux system looking half right, and save it.
vi /boot/grub/grub.cfg # most systems link vi to SOME editor
grub-install /dev/sda # or whatever your disk is called
It would be useful to members trying to assist you to inform them of the reason for using the partition manager and specifically, what you did!
Quote:
I followed a number of steps
To do what? What steps were they? You need to post more details.
You have an EFI partition which means at least one of the OS's is an EFI install. THis is the default for windows 10. Did you install Manjaro EFI? Were you ever able to boot Manjaro and if so did windows also boot after installing Manjaro?
The message you posted about "Installing for i386-pc platform" would indicate that you are booting in Legacy mode and trying to install Grub which should be installed EFI as it appears your Manjaro is also EFI. THe wiki below at the manjaro site gives detailed instructions on dual booting EFI with windows. Hopefully it will help.
@business_kid
@yancek
@colorpurple21859
thank you for your support, first of all I,I am booting from Legacy mode, not UEFI it worked really good, I was switching to UEFI only to use Linux.
It's a gpt disk, and fdisk is for the older MBR system with it's size limit. This is supposed to end all battles with the system BIOS. MBR has a max of 4 primary partitions; if there's more, you have to make an extended partition and then subdivide that. You have no extended partition, so it's gpt. It wasn't uncommon for some windows things to overwrite the MBR. I don't know if it's still common.
Use gdisk, and I think 'gdisk -l' does a similar job. It's as alike to fdisk in options as possible.
We need to know where your /boot partition is, where grub is/was installed, and where boot was. You can then try something like this from your live cd:
Code:
cat /etc/fstab # then note your / and /boot drives.
# From your output, I'd guess p2 is your /boot and p7 is your /. don't guess!
mount <your boot drive> /mnt
mount <your boot drive> /mnt/boot
chroot /mnt # Gets you into your linux system in runlevel 3
# set up grub bearing in mind X or fancy utilities probably won't work.
# As a last resort just get your linux system looking half right, and save it.
vi /boot/grub/grub.cfg # most systems link vi to SOME editor
grub-install /dev/sda # or whatever your disk is called
gdisk cannot be run with -l it gives me error:
I tried to execute this command on nvme0n1 and nvme0n1p1(I guess is only this last one that makes sense)
Quote:
[billy-pc billy]# gdisk /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.4
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
but
Quote:
[billy-pc billy]# gdisk /dev/nvme0n1p1
GPT fdisk (gdisk) version 1.0.4
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************
Exact type match not found for type code 6E00; assigning type code for
'Linux filesystem'
Exact type match not found for type code 7400; assigning type code for
'Linux filesystem'
Warning! Main partition table overlaps the first partition by 34 blocks!
You will need to delete this partition or resize it in another utility.
Warning! Secondary partition table overlaps the last partition by
3649239541 blocks!
You will need to delete this partition or resize it in another utility.
So i start to be afraid that I installed a kind of mbr, gbt hybrid...
so now you know where my boot is (actually
boot/efi that maybe is wrong, was suggested me yesterday)
I need before to change /boot/efi/ or convert from legacy to UEFI before to follow the command you gave me I guess.
@yancek,
thank you, I used GParted to increase the linux partition and reduce Windows(that is needed for two software)
these are the step i did
1) from windows I reduced the space unallocating 10G
2) with GParted I tried to allocate this unallocate space on my ext4 partition with Linux Manjaro, did not work because I had between the unallocate space(the 10G created from window) and the ext4 another partition, the SWAP partition, so I cancelled the SWAP partition,and as consequence the unallocate space become bigger roughly 14G, then I "expanded" via GPARTED GUI tool ext4 to make Linux Manjaro bigger of 10G, and finally I created a linux swap partition
3) the system did not boot so I asked to the folks in the official forum and was suggested me to create a /boot/efi partition, adding a third line with UID in /etc/fstab.
I do not know if I installed manjaro EFI, i guess not because after the succesful installation, I log with Legacy in the Bios, and not with UEFI that I have to reselect in the BIOS instead any time I want to connect to Windows 10. So I guess I missed the things up yesterday, because I did not have to add a /boot/efi partition.
I read the link you gave me, is really useful if I want to do a fresh installation, but a) I would like to maintain my present installation b) I do not know what I should cancel, if need to reinstall everything
@colorpurple21859
thank you, if I boot in EFI mode, I get an error as soon as I try to do manjaro-chroot -a
ls /sys/firmware does not show any efi folder but: acpi, devicetree, dmi, memap
I will try again to boot in efi mode, but please see above, it looks as I have to modify before the /boot/efi partition?
If you installed manjaro in legacy, there are a couple of ways this can be fixed without reinstalling.
To fix so installation will boot in efi mode, boot live iso in efi mode,
follow steps in my post #4 above, I add a mkddir and grub-mkconfig command to post #4, you do not have to chroot for this to work.
If any errors other than already mentioned in post 4 let us know.
To install bootloader in efi mode while booting iso in legacy mode, will have to chroot into /mnt after mounting the partitions and issue above commands starting with grub-install after chroot into /mnt. will get error about nvram and will have to select from bios to boot, then if you reinstall grub again all should be fixed.
To boot installation in legacy mode, boot iso in legacy mode, chroot into system and install lilo as bootloader, If you want to use grub as boot loader create a 1MB partition flagged as boot-boot/bios-grub before install grub.
Last edited by colorpurple21859; 07-31-2019 at 10:48 AM.
If you installed manjaro in legacy, there are a couple of ways this can be fixed without reinstalling.
To fix so installation will boot in efi mode, boot live iso in efi mode,
follow steps in my post #4 above, I add a mkddir and grub-mkconfig command to post #4, you do not have to chroot for this to work.
If any errors other than already mentioned in post 4 let us know.
To install bootloader in efi mode while booting iso in legacy mode, will have to chroot into /mnt after mounting the partitions and issue above commands starting with grub-install after chroot into /mnt. will get error about nvram and will have to select from bios to boot, then if you reinstall grub again all should be fixed.
To boot installation in legacy mode, boot iso in legacy mode, chroot into system and install lilo as bootloader, If you want to use grub as boot loader create a 1MB partition flagged as boot-boot/bios-grub before install grub.
I am sorry for Efi mode you mean that in the BIOS I have to activate UEFI/deactivate Legacy and then run the USB stick? I did it but I cannot pass from there your commands
Quote:
[manjaro-lxde manjaro]# mount /dev/nvme0n1p7 /mnt
mount: /mnt: special device /dev/nvme0n1p7 does not exist.
[manjaro-lxde manjaro]#
In other words from UEFI all the nvm* devices are not properly recognized.
Ehy I have an hint, what about this message I get before in the previous post? I think maybe is not a warning and I have to eliminate nvme0n1p1?
Quote:
[billy-pc billy]# gdisk /dev/nvme0n1p1
GPT fdisk (gdisk) version 1.0.4
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************
Exact type match not found for type code 6E00; assigning type code for
'Linux filesystem'
Exact type match not found for type code 7400; assigning type code for
'Linux filesystem'
Warning! Main partition table overlaps the first partition by 34 blocks!
You will need to delete this partition or resize it in another utility.
Warning! Secondary partition table overlaps the last partition by
3649239541 blocks!
You will need to delete this partition or resize it in another utility.
EDIT: booting from USB, deselecting legacy, selecting UEFI(that I assume is efi mode), GPARTED shows me only one partition
/dev/sda filesystem:iso96660 size :3,75G
I guess this is the reason why I cannot pass the /dev/mvn* commands
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1026047 1024000 500M EFI System
/dev/nvme0n1p2 1026048 1288191 262144 128M Microsoft reserved
/dev/nvme0n1p3 1288192 369770495 368482304 175.7G Microsoft basic data
/dev/nvme0n1p4 464975872 465995775 1019904 498M Windows recovery environment
/dev/nvme0n1p5 465995776 497776639 31780864 15.2G Windows recovery environment
/dev/nvme0n1p6 497778688 500117503 2338816 1.1G Windows recovery environment
/dev/nvme0n1p7 378720256 462116863 83396608 39.8G Linux filesystem
/dev/nvme0n1p8 369770496 378720255 8949760 4.3G Linux swap
Partition table entries are not in disk order.
and gdisk /dev/nvme0n1 (PLEASE CONSIDER that fdisk shows not nvme0n1 but nvmeon1p1 above, and this latter gives error/warning that I need to delete the partition and that secondary partition overlaps last partition)
Quote:
billy-pc% gdisk /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.4
Problem opening /dev/nvme0n1 for reading! Error is 13.
You must run this program as root or use sudo!
billy-pc% sudo gdisk /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.4
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
and finally
Quote:
billy-pc% sudo gdisk: p
sudo: gdisk:: command not found
That is strange that you can't see your drive when booting in uefi mode only, unless there is more than one item in your system bios your are changing to allow to boot in efi mode and one of them you shouldn't be changing. What system is this so someone that has one can better help on that.
Quote:
billy-pc% sudo gdisk /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.4
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
enter the p here to print out partition table.
Code:
Command (? for help): p
/dev/nvme0n1 is your drive, /dev/nvme0n1p1 is the first partition on that drive
as stated earlier to get booting in either mode while booting in legacy mode will have to chroot into system to install a bootloader. To keep from having to create another partition to install bootloader in legacy mode lilo is a good choice. If you want to use grub looks like you have enough room between some of your partitions to create 1mb empty partition flagged as bios-boot
That is strange that you can't see your drive when booting in uefi mode only, unless there is more than one item in your system bios your are changing to allow to boot in efi mode and one of them you shouldn't be changing. What system is this so someone that has one can better help on that.
enter the p here to print out partition table.
Code:
Command (? for help): p
Ah I see here you are
Quote:
Command (? for help): p
Disk /dev/nvme0n1: 500118192 sectors, 238.5 GiB
Model: PM961 NVMe SAMSUNG 256GB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): B03E0E64-DB72-43F2-A2D5-70A2D2848690
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 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 2863725 sectors (1.4 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 1026047 500.0 MiB EF00 EFI system partition
2 1026048 1288191 128.0 MiB 0C01 Microsoft reserved ...
3 1288192 369770495 175.7 GiB 0700 Basic data partition
4 464975872 465995775 498.0 MiB 2700
5 465995776 497776639 15.2 GiB 2700
6 497778688 500117503 1.1 GiB 2700
7 378720256 462116863 39.8 GiB 8300
8 369770496 378720255 4.3 GiB 8200 SWAP ADDED BY ME
Quote:
Originally Posted by colorpurple21859
/dev/nvme0n1 is your drive, /dev/nvme0n1p1 is the first partition on that drive
Ah I see I am starting to connect the dots, hopefully I will be able to play with partitions easier in the future.
Quote:
Originally Posted by colorpurple21859
If you want to use grub looks like you have enough room between some of your partitions to create 1mb empty partition flagged as bios-boot
Please could expand a bit this concept with my actual situation, if you have time? I am really starting to enjoying this post. I do not get these three points, while I am reading the link you gave me on restoring the GRUB bootloader, and having decided to give a try to UEFI instead of Legacy.
1) is normal that the partition 1 starts at 2048 and is half giga?
2) where I need/or should be GRUB in an EFI installation?
3)what is the relation with ` /dev/nvme0n1p1 vfat 496M 72M 425M 15% /boot/efi` do I need to cancel and flag it as a bios boot( I am assuming /boot/efi is correct, should not be /boot)
is normal that the partition 1 starts at 2048 and is half giga?
I think that is kilobytes and is normal on gpt drive.
Quote:
what is the relation with ` /dev/nvme0n1p1 vfat 496M 72M 425M 15% /boot/efi` do I need to cancel and flag it as a bios boot( I am assuming /boot/efi is correct, should not be /boot)
leave that partition alone, it is needed to boot in uefi mode and is normally mounted /boot/efi. When grub-installed is invoked in legacy mode grub code is installed on the drive mbr, in uefi grub boot code is installed as a file in /boot/efi/EFI/manjaro/grubx64.efi.
When grub is installed in legacy mode on msdos type drive there is room between the mbr and first partiitont to store the core.img, This space doesn't exist on a gpt drive, so a 1mb partition is needed for this. https://en.wikipedia.org/wiki/BIOS_boot_partition
On my system, I have an efi partition and 1mb bios-boot/bios-grub partition so I can boot in either efi or legacy mode. Some distros you will need to install additional grub package grub-pc and/or grub-efi because they only install the grub files that is only needed for what mode the installation was done in.
Last edited by colorpurple21859; 08-01-2019 at 11:01 AM.
The correct form is gdisk /dev/nvme0n1 as this refers to the whole drive itself analogous to /dev/sda for a SATA drive.
Code:
billy-pc billy]# gdisk /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.4
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
However /dev/nvme0n1p1 refers to the first partition on this NVMe SSD analogous to /dev/sda1 for the first partition on a SATA drive. There is no partition table inside an individual partition. The second gdisk command using /dev/nvme0n1p1 was very wrong.
guys I took two days off from the office but is solved, and the satisfaction to work around that other operative system is noticeable
1)open window select as admin right clicking the window icon to have a prompt as admin and write bcdedit /set safeboot minimal
1) Change SATA settings to AHCI
2)set windows as first UEFI, open again the command prompt as admin and write bcdedit /deletevalue safeboot
3) run manjaro and give
Quote:
manjaro-chroot -a #check is mounted the /boot/efi directory
4) move in the UEFI settings manjaro on top of the HD
5) <In my case I got a problem, the SWAP partition I changed with gparted had another uid, so i run `blkid` to find the new UUID and changed accordingly the value in /etc/fstab>
6) I repeat with a voice algorithm recursion, W$ we won, we won, we won
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.