You are not logged in.

#1 2021-02-22 13:42:41

rhearmas
Member
Registered: 2020-09-25
Posts: 52

[SOLVED] rEFIND & GRUB only booting one of two partitions

Hello, Arch Forums! I hope this post finds you well.

I've installed Arch on two partitions -- my primary partition (P2) and a school-based partition (P3). I've been unable to boot P3 through rEFInd for a while now, but I don't have the error logs on me. I'll update this post as I get more logs.

Later on, I've decided that I was going to switch to GRUB. So that's what I did: I installed GRUB to replace rEFInd as my bootloader. However, there's another problem: I can't boot my primary partition, but the schoolwork partition boots just fine. This time, I've brought some logs for you to evaluate:

scsi 2:0:0:1: Wrong diagnostic page; asked for 1 got 0
scsi 2:0:0:1: Failed to get diagnostic page 0x1
scsi 2:0:0:1: Failed to bind enclosure -19
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:1424023 != 15148607
GPT:Alternate GPT header not at the end of the disk.
GPT:1424023 != 15148607
GPT: Use GNU Parted to correct GPT errors.
A start job is running for / (40s / no limit)

I have no idea what is causing this. Keep in mind that this only happens with GRUB on my primary partition; this doesn't happen when I boot it from rEFInd. I've looked around on the forums for previous posts, but the solutions discussed in said posts did not lead anywhere. Other posts found online didn't help either, but please link me to them if needed.

Could I get some help on this? I appreciate any assistance you can provide.



EDIT 1: Forgot some information. I'll correct that here.
Firstly, here is my current partition table:

/dev/nvme0n1p1      2048     534527    532480   260M EFI System
/dev/nvme0n1p2    534528  865996799 865462272 412.7G Linux filesystem
/dev/nvme0n1p3 865996800 1000214527 134217728    64G Linux filesystem

And here is the output of blkid. Don't mind the label for P3; I thought I was going to use Parabola but I decided to stick through Arch because Parabola doesn't have the drivers for my wifi device.

/dev/nvme0n1p1: LABEL_FATBOOT="BOOT" LABEL="BOOT" UUID="4281-C511" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="eeff6aa8-f7a7-4afc-8c53-6012d6cb3425"
/dev/nvme0n1p2: LABEL="ARCH" UUID="aeb4402d-be5f-4ace-82de-0ed06a191688" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Arch Linux Root" PARTUUID="0693acf3-5b01-2145-a375-faf00674ce50"
/dev/nvme0n1p3: UUID="57a43922-4ce3-490e-bd43-eba98dc6d4ae" UUID_SUB="a5bfb603-38c4-4a1c-a454-ad37ed343187" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="Parabola Root" PARTUUID="462aad0c-4c1b-45b9-bfed-faa4a9eee2fa"

I installed GRUB on P2. The command I ran was grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --recheck --removable, and made the config with grub-mkconfig -o /boot/grub/grub.cfg.

On the topic of formatting, P2 is formatted to ext4, and P3 is in btrfs.

Last edited by rhearmas (2021-02-22 19:50:06)

Offline

#2 2021-02-22 15:28:26

respiranto
Member
Registered: 2015-05-15
Posts: 451
Website

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

How far do you get, that is, what do you mean by ``I can't boot my primary partition''?

Where are those logs from?

Anyways, you should probably fix the mentioned GPT errors.
Please post the output of `gdisk -l /dev/sdX', where `/dev/sdX' is the drive in question.  (Not sure if gdisk is the best tool here, fdisk and parted should work too.)

From which system did you install GRUB?
Also, please post your `/boot/grub/grub.cfg'.

Offline

#3 2021-02-22 15:55:05

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 5,723
Website

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

rhearmas wrote:

I installed GRUB to replace rEFInd as my bootloader

How? Please post the exact command(s) that you used.

We should probably also see

efibootmgr -v

Last edited by Head_on_a_Stick (2021-02-22 15:55:17)

Offline

#4 2021-02-22 17:10:15

rhearmas
Member
Registered: 2020-09-25
Posts: 52

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

Firstly, I'll respond to respiranto. My response to Head_on_a_Stick will be after this comment to avoid clutter.

respiranto wrote:

How far do you get, that is, what do you mean by ``I can't boot my primary partition''?

I have three partitions: my boot partition, primary Arch Linux partition, and my schoolwork Arch partition. To make things easier, I'll refer to the primary partition as P2 and the schoolwork partition as P3. I want to isolate my schoolwork into a different environment to try to focus a lot more. The errors provided in the OP are what appears when I boot P2 through GRUB.

respiranto wrote:

Where are those logs from?

The logs appear on my screen when I boot P2 from GRUB (after removing the quiet tag and setting loglevel to 5). The start job goes on until I reboot the system.

respiranto wrote:

From which system did you install GRUB?

I am using an ASUS Vivobook 15, with 12GB memory and 512GB SSD storage.

respiranto wrote:

Please post the output of `gdisk -l /dev/sdX', where `/dev/sdX' is the drive in question.
...
Also, please post your `/boot/grub/grub.cfg'.

Next 2 codeblocks contain the output of fdisk -l on the labeled partition.
/dev/nvme0n1p2 (main partition):

Disk /dev/nvme0n1p2: 412.68 GiB, 443116683264 bytes, 865462272 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

/dev/nvme0n1p3 (school partition):

Disk /dev/nvme0n1p3: 64 GiB, 68719476736 bytes, 134217728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

/boot/grub/grub.cfg: http://ix.io/2QnC

Offline

#5 2021-02-22 17:10:45

rhearmas
Member
Registered: 2020-09-25
Posts: 52

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

Now, I'll respond to Head_on_a_Stick.

Head_on_a_Stick wrote:

Please post the exact command(s) that you used.

Firstly, I ran grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB --recheck --removable. Then, I ran grub-mkconfig -o /boot/grub/grub.cfg.

Head_on_a_Stick wrote:

We should probably also see

efibootmgr -v

Output of efibootmgr -v is here: http://ix.io/2QnE

Offline

#6 2021-02-22 17:52:44

respiranto
Member
Registered: 2015-05-15
Posts: 451
Website

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

rhearmas wrote:
respiranto wrote:

From which system did you install GRUB?

I am using an ASUS Vivobook 15, with 12GB memory and 512GB SSD storage.

I meant system as in ``Arch installation'', i.e., P2 or P3.
Reading your grub.cfg, I assume it's P2.

Also, please post the output of `fdisk -l /dev/nvme0n1', i.e., have `fdisk' operate on the full disk.

rhearmas wrote:

/boot/grub/grub.cfg: http://ix.io/2QnC

I noticed `resume=', without value.  Is that valid?  Normally, it should hold a device path (probably `/dev/nvme0n1p2' in your case).
Maybe just try booting without `resume=' and `resume_offset=...'.

rhearmas wrote:

Firstly, I ran grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB --recheck --removable. Then, I ran grub-mkconfig -o /boot/grub/grub.cfg.

`esp' should be replaced with the mountpoint of the ESP (EFI System Partition), probably `/boot'.

Offline

#7 2021-02-22 18:08:14

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 955

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

rhearmas wrote:

Hello, Arch Forums! I hope this post finds you well.

I've installed Arch on two partitions -- my primary partition (P2) and a school-based partition (P3). I've been unable to boot P3 through rEFInd for a while now, but I don't have the error logs on me. I'll update this post as I get more logs.

Later on, I've decided that I was going to switch to GRUB. So that's what I did: I installed GRUB to replace rEFInd as my bootloader. However, there's another problem: I can't boot my primary partition, but the schoolwork partition boots just fine. This time, I've brought some logs for you to evaluate:

scsi 2:0:0:1: Wrong diagnostic page; asked for 1 got 0
scsi 2:0:0:1: Failed to get diagnostic page 0x1
scsi 2:0:0:1: Failed to bind enclosure -19
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:1424023 != 15148607
GPT:Alternate GPT header not at the end of the disk.
GPT:1424023 != 15148607
GPT: Use GNU Parted to correct GPT errors.
A start job is running for / (40s / no limit)

I have no idea what is causing this. Keep in mind that this only happens with GRUB on my primary partition; this doesn't happen when I boot it from rEFInd. I've looked around on the forums for previous posts, but the solutions discussed in said posts did not lead anywhere. Other posts found online didn't help either, but please link me to them if needed.

Could I get some help on this? I appreciate any assistance you can provide.

Presumably, although you did not say so, you also have an efi partition that is your P1?  If so then do you have your efi partition containing the refind.conf, as well as the necessary refind drivers to read the two P2 and P3 partitions? Are P2 and P3 ext4 or a different filesystem type?  Can you post your refind.conf file?  Also can you post any refind_linux.conf?    How did you get refind to boot the two paritions - were they auto-detected or did you have two specific stanzas to define the two arch systems on P2 and P3?  If so did you check that the stanzas have the correct UUID and/or PARTUUID for the two root paritions to boot from?  Once you provide this information it may be possible to guide you further in finding where the issue lies.


Mike C

Offline

#8 2021-02-22 18:08:42

rhearmas
Member
Registered: 2020-09-25
Posts: 52

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

respiranto wrote:

I meant system as in ``Arch installation'', i.e., P2 or P3.
Reading your grub.cfg, I assume it's P2.

Also, please post the output of `fdisk -l /dev/nvme0n1', i.e., have `fdisk' operate on the full disk.

Here's the output of that command:

Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: INTEL SSDPEKNW512G8
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: 1C4D324D-FCE3-4C7D-B5D5-5F0919F4EC8F

Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1      2048     534527    532480   260M EFI System
/dev/nvme0n1p2    534528  865996799 865462272 412.7G Linux filesystem
/dev/nvme0n1p3 865996800 1000214527 134217728    64G Linux filesystem

In addition, thanks for clarifying the question. I didn't completely understand it. P2 is the one that has trouble with GRUB, as that was the partition I ran the install command in.

respiranto wrote:

I noticed `resume=', without value.  Is that valid?  Normally, it should hold a device path (probably `/dev/nvme0n1p2' in your case).
Maybe just try booting without `resume=' and `resume_offset=...'.

I didn't notice that resume was blank! I'll adjust that accordingly, and I'll respond with the results.

respiranto wrote:

`esp' should be replaced with the mountpoint of the ESP (EFI System Partition), probably `/boot'.

My bad! I copy-pasted the command from the Arch wiki. I set the argument for --efi-directory to /boot.

Offline

#9 2021-02-22 18:25:27

rhearmas
Member
Registered: 2020-09-25
Posts: 52

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

mcloaked wrote:

Presumably, although you did not say so, you also have an efi partition that is your P1? If so then do you have your efi partition containing the refind.conf, as well as the necessary refind drivers to read the two P2 and P3 partitions?

Yes, that's correct; P1 is my EFI partition. it contains refind.conf, but I am unsure what drivers I'll need to install because I assumed they'd already be installed with rEFInd.

mcloaked wrote:

Are P2 and P3 ext4 or a different filesystem type?

P2 is in ext4, P3 is btrfs.

mcloaked wrote:

Can you post your refind.conf file?  Also can you post any refind_linux.conf?

Of course!
/boot/EFI/refind/refind.conf is here: http://ix.io/2Qoh
..and refind_linux.conf doesn't exist in the directory.

mcloaked wrote:

How did you get refind to boot the two paritions - were they auto-detected or did you have two specific stanzas to define the two arch systems on P2 and P3? If so did you check that the stanzas have the correct UUID and/or PARTUUID for the two root paritions to boot from?

I had to specify the partitions manually. I have ensured that they are correct -- and they are. I've added the key information from this comment to the OP, including the partition table and partition UUID/PARTUUIDs.

Offline

#10 2021-02-22 18:37:15

respiranto
Member
Registered: 2015-05-15
Posts: 451
Website

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

I am surprised that `fdisk' does not print any error.  Maybe try `gdisk -l /dev/nvme0n1' and possibly `parted /dev/nvme0n1 print'.

The GPT error to me looks like the backup header is not at the end of the disk.  This is fixable with gdisk (and probably also with parted, possibly fdisk).

With `gdisk', it should be `x', followed by `e'.  Possibly rather `r', then `e'.  In any case, read the help (`?') first.  And have backups of your data.

Offline

#11 2021-02-22 18:41:48

rhearmas
Member
Registered: 2020-09-25
Posts: 52

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

respiranto wrote:

I am surprised that `fdisk' does not print any error.  Maybe try `gdisk -l /dev/nvme0n1' and possibly `parted /dev/nvme0n1 print'.

I was surprised too! Here's what my output is of the gdisk command:

GPT fdisk (gdisk) version 1.0.6

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

Found valid GPT with protective MBR; using GPT.
Disk /dev/nvme0n1: 1000215216 sectors, 476.9 GiB
Model: INTEL SSDPEKNW512G8
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 1C4D324D-FCE3-4C7D-B5D5-5F0919F4EC8F
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 1000215182
Partitions will be aligned on 2048-sector boundaries
Total free space is 2669 sectors (1.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          534527   260.0 MiB   EF00  EFI system partition
   2          534528       865996799   412.7 GiB   8300  Arch Linux Root
   3       865996800      1000214527   64.0 GiB    8300  Parabola Root
respiranto wrote:

With `gdisk', it should be `x', followed by `e'.  Possibly rather `r', then `e'.  In any case, read the help (`?') first.  And have backups of your data.

I'll try that out and see what happens. Do you have any good suggestions for tools I can use to backup my data?

Also, r => e will load the main partition table from the disk, and x => e relocates backup data structures to the end of the disk. Should I try both? Or is there only one option I should use?

Offline

#12 2021-02-22 19:19:44

respiranto
Member
Registered: 2015-05-15
Posts: 451
Website

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

rhearmas wrote:

I'll try that out and see what happens. Do you have any good suggestions for tools I can use to backup my data?

For one-time backups: `bsdtar'/`tar', `rsync'.  For incremental backups: `rsync --link-dest', `rsnapshot', `duplicity', depending on your needs.  See the Arch Wiki [0] for some examples.

rhearmas wrote:

Also, r => e will load the main partition table from the disk, and x => e relocates backup data structures to the end of the disk. Should I try both? Or is there only one option I should use?

I just noticed there is a `v' command to ``verify the disk''.  Hopefully, that tells you what to do.
If `v' says everything is fine, then probably neither of `r/e' and `x/e' would help.  I'd nevertheless try; `x/e' before `r/e'.

In any case, I'd first try booting without the `resume=' and `resume_offset=' options, and/or with correct ones.
Btw, did you hibernate P2 the last time you used it?  In this case, things may break when removing the `resume*' options.


[0] https://wiki.archlinux.org/index.php/System_backup


Addendum: I'd also try `parted', given that that's what the error message suggested.

Last edited by respiranto (2021-02-22 19:23:54)

Offline

#13 2021-02-22 19:23:05

rhearmas
Member
Registered: 2020-09-25
Posts: 52

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

Thanks for your response!

Luckily I was able to figure out a super simple solution to this problem...

literally just set the resume variable in grub. Yes, I’m serious! Somehow that was the issue that caused all this time to be wasted, unfortunately.

Now that GRUB is working, is there an easy way to get rid of rEFInd completely?

Offline

#14 2021-02-22 19:28:43

respiranto
Member
Registered: 2015-05-15
Posts: 451
Website

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

rhearmas wrote:

literally just set the resume variable in grub. Yes, I’m serious! Somehow that was the issue that caused all this time to be wasted, unfortunately.

Great!  Please mark the thread as solved by prepending ``[solved]'' to the initial post.

If you use `grub-mkconfig', make sure to make the change not only in grub.cfg, but (also) in `/etc/default/grub'.

Now that GRUB is working, is there an easy way to get rid of rEFInd completely?

I assume it's a (properly named) folder in the EFI partition.  Also, you should delete the boot entry using `efibootmgr'.

Finally, don't forget to start making regular backups.

Offline

#15 2021-02-22 19:49:49

rhearmas
Member
Registered: 2020-09-25
Posts: 52

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

That makes sense. I've updated the file accordingly and deleted the entry with efibootmgr. However, what exact directories do I need to delete? Here's a tree of /boot: http://ix.io/2Qp5

I'll be sure to make regular backups from now on, as well. Thank you!

Offline

#16 2021-02-22 19:53:18

respiranto
Member
Registered: 2015-05-15
Posts: 451
Website

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

rhearmas wrote:

However, what exact directories do I need to delete? Here's a tree of /boot: http://ix.io/2Qp5

Probably only `/boot/EFI/refind'.

Offline

#17 2021-02-23 11:38:37

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 955

Re: [SOLVED] rEFIND & GRUB only booting one of two partitions

For refind, although you have now decided to abandon this boot manager, probably you would just have needed to put the driver directory in the right place by doing:

cp -R /usr/share/refind/drivers_x64 /boot/efi/EFI/refind/

Depending on how your efi is mounted the second path would be adjusted to suit.

This would then have the drivers to allow refind to read both ext4 and btrfs partitions:

$ ls /boot/efi/EFI/refind/drivers_x64/
btrfs_x64.efi  ext2_x64.efi  ext4_x64.efi  hfs_x64.efi  iso9660_x64.efi  reiserfs_x64.efi

However you may have by now already deleted the refind/ directory in your efi. Good that you have your two systems now working using grub instead.

Last edited by mcloaked (2021-02-23 11:40:29)


Mike C

Offline

Board footer

Powered by FluxBB