Which do I fix first?

Lets first remove those two with the suggested command. You may follow up with apt purge grub-pc-bin grub2-common (maybe in two separate commands) to get rid of leftovers.

I am not sure whether removing grub will impact the ability of your system to boot, or that it will leave the current /boot and files in place. Let’s not reboot at first :wink:

After that, maybe try installing grub2 instead of grub-pc, and similarly, reconfigure grub2.

My timezone says bedtime, I’ll look if there’s an update tomorrow. Success!

Sleep well … sunday morning here

root@****:~# sudo apt autoremove grub-pc-bin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  grub-pc grub-pc-bin grub2-common
0 upgraded, 0 newly installed, 3 to remove and 95 not upgraded.
1 not fully installed or removed.
After this operation, 5,116 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 73352 files and directories currently installed.)
Removing grub-pc (2.06-13+deb12u1) ...
Removing grub-pc-bin (2.06-13+deb12u1) ...
Removing grub2-common (2.06-13+deb12u1) ...
Processing triggers for man-db (2.11.2-2) ...
root@****:~# sudo apt autoremove grub2-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'grub2-common' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 95 not upgraded.
root@****:~# apt purge grub-pc-bin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'grub-pc-bin' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 95 not upgraded.
root@****:~# apt purge grub2-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  grub2-common*
0 upgraded, 0 newly installed, 1 to remove and 95 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 73008 files and directories currently installed.)
Purging configuration files for grub2-common (2.06-13+deb12u1) ...
root@****:~#
root@****:~# sudo apt install grub2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  grub-pc grub-pc-bin grub2-common
Suggested packages:
  desktop-base
The following NEW packages will be installed:
  grub-pc grub-pc-bin grub2 grub2-common
0 upgraded, 4 newly installed, 0 to remove and 95 not upgraded.
Need to get 1,614 kB/1,750 kB of archives.
After this operation, 5,128 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.debian.org/debian bookworm/main amd64 grub2-common amd64 2.06-13+deb12u1 [614 kB]
Get:2 http://ftp.debian.org/debian bookworm/main amd64 grub-pc-bin amd64 2.06-13+deb12u1 [997 kB]
Get:3 http://ftp.debian.org/debian bookworm/main amd64 grub2 amd64 2.06-13+deb12u1 [2,364 B]
Fetched 1,614 kB in 3s (558 kB/s)
Preconfiguring packages ...
Selecting previously unselected package grub2-common.
(Reading database ... 73007 files and directories currently installed.)
Preparing to unpack .../grub2-common_2.06-13+deb12u1_amd64.deb ...
Unpacking grub2-common (2.06-13+deb12u1) ...
Selecting previously unselected package grub-pc-bin.
Preparing to unpack .../grub-pc-bin_2.06-13+deb12u1_amd64.deb ...
Unpacking grub-pc-bin (2.06-13+deb12u1) ...
Selecting previously unselected package grub-pc.
Preparing to unpack .../grub-pc_2.06-13+deb12u1_amd64.deb ...
Unpacking grub-pc (2.06-13+deb12u1) ...
Selecting previously unselected package grub2.
Preparing to unpack .../grub2_2.06-13+deb12u1_amd64.deb ...
Unpacking grub2 (2.06-13+deb12u1) ...
Setting up grub2-common (2.06-13+deb12u1) ...
Setting up grub-pc-bin (2.06-13+deb12u1) ...
Setting up grub-pc (2.06-13+deb12u1) ...
grub-pc: Running grub-install ...
You must correct your GRUB install devices before proceeding:

  DEBIAN_FRONTEND=dialog dpkg --configure grub-pc
  dpkg --configure -a
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of grub2:
 grub2 depends on grub-pc (= 2.06-13+deb12u1); however:
  Package grub-pc is not configured yet.

dpkg: error processing package grub2 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.11.2-2) ...
Errors were encountered while processing:
 grub-pc
 grub2
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@****:~#

Nope

I

Sorry, I started a reply but was distracted and didn’t come back to finishing it earlier.

Let’s give that a try by running dpkg --configure -a

If it doesn’t like to go forward, give dpkg-reconfigure grub-pc a try once again.

With none of those completing successfully, still try installing GRUB manually (–skip-fs-probe was a hint from stackexchange):

grub-install /dev/sdb  --skip-fs-probe 
update-grub  #or update-grub2; on my system they're the same

Usually GRUB installs with no problems nowadays, but if it doesn’t, it’s quite a pain. (Mostly we have to deal with grub-efi for newer installations/devices, which adds its own confusion but does not seem applicable here)

I hope it’s ok to post all the output as one. If not let me know. no luck I’m afraid

login as: root
root@***.***.***.***'s password:
Linux ****.nohost.me 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (20                   24-11-22) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Jan 26 23:01:30 2025 from 192.168.50.4
root@****:~# sudo dpkg --configure -a
Setting up grub-pc (2.06-13+deb12u1) ...
grub-pc: Running grub-install ...
You must correct your GRUB install devices before proceeding:

  DEBIAN_FRONTEND=dialog dpkg --configure grub-pc
  dpkg --configure -a
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error ex                   it status 1
dpkg: dependency problems prevent configuration of grub2:
 grub2 depends on grub-pc (= 2.06-13+deb12u1); however:
  Package grub-pc is not configured yet.

dpkg: error processing package grub2 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 grub-pc
 grub2
root@****:~# sudo dpkg-reconfigure grub-pc
/usr/sbin/dpkg-reconfigure: grub-pc is broken or not fully installed
root@****:~# ^C
root@****:~# sudo fdisk -l
Disk /dev/sdb: 1.82 TiB, 2000394706432 bytes, 3907020911 sectors
Disk model: WDC WD2003FZEX-0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sda: 476.94 GiB, 512105963008 bytes, 1000206959 sectors
Disk model: Crucial_CT512M55
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x70e85e7f

Device     Boot  Start        End   Sectors   Size Id Type
/dev/sda1  *      2048     499711    497664   243M 83 Linux
/dev/sda2       501758 1000206335 999704578 476.7G  5 Extended
/dev/sda5       501760 1000204287 999702528 476.7G 8e Linux LVM

Partition 2 does not start on physical sector boundary.


Disk /dev/mapper/system-root: 475.74 GiB, 510820089856 bytes, 997695488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/system-swap: 976 MiB, 1023410176 bytes, 1998848 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/system-nextcloud: 1000 GiB, 1073741824000 bytes, 2097152000 sec                   tors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/system-audiobookshelf: 300 GiB, 322122547200 bytes, 629145600 s                   ectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
root@****:~# ^C
root@****:~# grub-install /dev/sdb  --skip-fs-probe
Installing for i386-pc platform.
grub-install: warning: Attempting to install GRUB to a partitionless disk or to                    a partition.  This is a BAD idea..
grub-install: error: embedding is not possible, but this is required for cross-d                   isk install.
root@****:~# update-grub
Generating grub configuration file ...
/usr/sbin/grub-probe: warning: Couldn't find physical volume `pv1'. Some modules may be missing from core image..
Found linux image: /boot/vmlinuz-6.1.0-28-amd64
Found initrd image: /boot/initrd.img-6.1.0-28-amd64
Found linux image: /boot/vmlinuz-5.10.0-33-amd64
Found initrd image: /boot/initrd.img-5.10.0-33-amd64
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done
root@****:~#

It is not too much :wink:

root@****:~# grub-install /dev/sdb  --skip-fs-probe
Installing for i386-pc platform.
grub-install: warning: Attempting to install GRUB to a partitionless disk or to                    a partition.  This is a BAD idea..
grub-install: error: embedding is not possible, but this is required for cross-d                   isk install.

Did you notice the disk order got shuffled back to what it was? At least it seems rebooting is not impacted so far.

With your HDD not having a DOS partition table, grub-pc can’t install to the MBR.

The ‘good’ thing about that is that we now can still try installing grub to your SSD as we intended in the first place.

Even though apt and dpkg complain, do grub- commands run? Does it let you

$ sudo grub-install /dev/sda --skip-fs-probe

Looking at a minor problem in all this:

To check the information in LVM matches the actual volumes, you could run:

$ sudo pvscan
$ sudo vgscan
$ sudo lvscan

The output should match your expectation.

Slightly off-topic, did you on purpose use the unpartitioned HDD as physical volume for LVM ?

No I didn’t. I havent rebooted as per instructions.

Regarding the unpartitioned hdd which is sdb? I didn’t plan to do it. I did my initial install on the sdd. I had a few troubles, reformatted once, did a disk image of the second attempt using rescuezilla,
Had troubles with rescuzilla, posted on the forum and the developer said I’d found a bug, nice guy btw.
I ran out of space and started researching how to add more space. I found this on the YH forums:

I had a lot of trouble but persevered, watched more youtube videos than I’d like to count.
Got it working eventually and didn’t want to F with it. It all worked fine and applied updates until I bookworm.

I’d have to say I’m a bit of a trained monkey and don’t always understand. I can follow the guides step by step. I have no programming experience and have picked up bits and pieces along the way.

When I said I was an extreem newby I was telling the truth. For what we have been doing here I have been running it through chatgpt to get it to explain whats happening at times as well as technical terms. They give the most trouble.

I didn’t even know how to post the logs properly till you showed me. That screen shot was very helpful btw :smiley:

My life story lol.

The outputs were

login as: root
root@****.****.****.****'s password:
Access denied
root@****.****.****.****'s password:
Linux ****.nohost.me 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (20                                                                                                                                                                                                                                             24-11-22) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jan 27 09:17:56 2025 from 192.168.50.4
root@****:~# sudo grub-install /dev/sda --skip-fs-probe
Installing for i386-pc platform.
Installation finished. No error reported.
root@****:~# sudo pvscan
  PV /dev/sda5   VG system          lvm2 [476.69 GiB / 0    free]
  PV /dev/sdb    VG system          lvm2 [<1.82 TiB / 563.01 GiB free]
  Total: 2 [2.28 TiB] / in use: 2 [2.28 TiB] / in no VG: 0 [0   ]
root@****:~# sudo vgscan
  Found volume group "system" using metadata type lvm2
root@****:~# sudo lvscan
  ACTIVE            '/dev/system/root' [<475.74 GiB] inherit
  ACTIVE            '/dev/system/swap' [976.00 MiB] inherit
  ACTIVE            '/dev/system/nextcloud' [1000.00 GiB] inherit
  ACTIVE            '/dev/system/audiobookshelf' [300.00 GiB] inherit
root@****:~# ^C

If you are interested, here is an example of chatgpt take on the above.

Your setup seems to involve managing logical volumes using LVM (Logical Volume Manager) on a Debian-based system. Here's a breakdown of what you're doing:

GRUB Installation:

Command: sudo grub-install /dev/sda --skip-fs-probe
GRUB was installed successfully on /dev/sda for the i386-pc platform, with no errors reported. The --skip-fs-probe option skips probing for file systems.
Physical Volume Scan:

Command: sudo pvscan
It shows two physical volumes:
/dev/sda5 (476.69 GiB) is fully allocated to the volume group (VG) system.
/dev/sdb (<1.82 TiB) has 563.01 GiB free space in the same VG.
Volume Group Scan:

Command: sudo vgscan
The system volume group is detected.
Logical Volume Scan:

Command: sudo lvscan
There are four active logical volumes (LVs) under the system volume group:
root: Main system partition with 475.74 GiB.
swap: Swap space with 976 MiB.
nextcloud: Presumably for a Nextcloud instance with 1,000 GiB.
audiobookshelf: For audiobookshelf, a media server, with 300 GiB.
If you need help with further steps, such as resizing volumes, managing the Nextcloud or Audiobookshelf data, or troubleshooting, feel free to ask!

Best,

I

Everyone starts somewhere, and takes steps from there :slight_smile:

That looks promising, doesn’t it?

Let’s have another go at trying apt/dpkg to believe everything is fine,

$ sudo dpkg --configure grub-pc

If the options there are the same as for running dpkg-reconfigure grub-pc, you’ll get some screens where most of the defaults are fine.

My system boots with EFI on GPT partitions, so it runs grub-efi-amd64 instead.

When I run $ sudo dpkg --configure grub-efi-amd64, these questions are asked:

$ dpkg-reconfigure grub-efi-amd64
(blue screen with grey text box:)
 # The following Linux command line was extracted (....) allowed to be empty
   ... (empty)
   --> <OK>
 # The following string will be used as Linux parameters (...)
  quiet 
  --> <OK>
 # GRUB can use the os-prober tool  (...)
  --> <NO>
 # Some EFI-based systems are buggy 
  (I don not think this option will show on your end)
  --> <YES>
 # GRUB can configure your platform's NVRAM 
 --> <YES>
(exit blue screen, back to regular command line)
Installing for x86_64-efi platform.
File descriptor 3 (pipe:[263531]) leaked on vgs invocation. Parent PID 1671423: grub-install
  WARNING: PV /dev/sdb2 in VG system is missing the used flag in PV header.
File descriptor 3 (pipe:[263531]) leaked on vgs invocation. Parent PID 1671423: grub-install
  WARNING: PV /dev/sdb2 in VG system is missing the used flag in PV header.
Installation finished. No error reported.
Generating grub configuration file ...
  WARNING: PV /dev/sdb2 in VG system is missing the used flag in PV header.
Found linux image: /boot/vmlinuz-6.1.0-30-amd64
Found initrd image: /boot/initrd.img-6.1.0-30-amd64
(...)
Warning: os-prober will not be executed to detect other bootable partitions.
done
Processing triggers for shim-signed:amd64 (1.44~1+deb12u1+15.8-1~deb12u1) ...
$

Let’s see how it works out!

sadly it did not work

root@*****:~# sudo dpkg --configure grub-pc
Setting up grub-pc (2.06-13+deb12u1) ...
grub-pc: Running grub-install ...
You must correct your GRUB install devices before proceeding:

  DEBIAN_FRONTEND=dialog dpkg --configure grub-pc
  dpkg --configure -a
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error ex            it status 1
Errors were encountered while processing:
 grub-pc

Is any of the following useful? When I run it through chatgpt it suggests the following: I know it can just output crap so it may be meaningless.

The error you encountered indicates that the grub-pc package's post-installation script failed during the configuration process. This typically happens when GRUB doesn't know where to install itself, or there's a mismatch in the GRUB configuration. Here's how to troubleshoot and resolve the issue:

Steps to Fix the GRUB Installation Issue
Reconfigure GRUB Installation: Run the following command to manually reconfigure the grub-pc package:
 
sudo dpkg-reconfigure grub-pc

During the interactive process, it will ask you where to install GRUB.
Select the correct disk(s) (e.g., /dev/sda) to install the GRUB bootloader. Do not select a specific partition like /dev/sda5.

Use the arrow keys to navigate and the spacebar to select a disk. Press Enter to confirm your choices.

Ensure Proper Boot Device: If you're unsure about which device to select:
Check which disk is your primary boot device in your BIOS/UEFI settings.
Run this command to identify your system's boot disk:

lsblk

Look for the disk that contains your root (/) file system. This is typically where GRUB should be installed.

Retry Configuration: After reconfiguring GRUB, retry the configuration command to ensure it completes successfully:


sudo dpkg --configure -a

Check for Errors During GRUB Installation: If the problem persists, manually run the grub-install command to check for specific issues:


sudo grub-install /dev/sda

Replace /dev/sda with the correct disk if necessary. If this command outputs errors, share the details so we can address them.
Update GRUB Configuration: After successfully installing GRUB, update its configuration to include all the detected operating systems:


sudo update-grub

Check for Missing Dependencies: Ensure all required packages are installed and up to date:

sudo apt update
sudo apt install --fix-missing
sudo apt install -f

If the Problem Persists:
Inspect the logs for detailed error messages:

journalctl -xe
Look for GRUB-specific logs:

cat /var/log/boot.log

In this case it makes sense; condensed for overview:

$ sudo lsblk                    # check SSD is at /dev/sda,
$ sudo dpkg-reconfigure grub-pc # use the /dev/sdx that is your SSD
$ sudo dpkg --configure -a      # hopefully no proceeds
$ sudo grub-install /dev/sda    # or sdb, if your SSD moved
$ sudo update-grub              # in my experience, dpkg-reconfigure already ran this, but it won't hurt
$ sudo apt update
$ sudo apt install --fix-missing
$ sudo apt install -f

Good luck!

Hi @wbk ,

Success! You got me across the line! I just wanted to take a moment to thank you sincerely for your help with my server upgrade issue. Your perseverance through many attempts, as well as the occasional kick up the pants when I wasn’t thoroughly reading your posts, really made all the difference in solving the problem.

To show my appreciation not only for your help but also for the amazing Yunohost project, I’ve made a donation of $100 (about $160 Australian bananas!) to the project. It’s people like you who make the Yunohost community such a welcoming and supportive space. Your generosity in sharing your knowledge is greatly appreciated, and I’m sure it’s made a difference for many others like me.

Thanks again for taking the time to help. I truly appreciate it!

Warm regards,
Ian / Uncertain

1 Like

Hi uncertain,

It was fun working through the attempts with you, and I am happy we got it, also through your own perseverance, to a working conclusion. Just to check: installing new apps runs without warnings?

Thank you for your kind words. Your donation is very much appreciated, but seeing the amount make sure it’s not outside your means.

Have fun with your server, spread the word :wink:

No it’s all good. I’ve installed immich without errors, updated everything and it is running fine!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.