Thank you lindi.
I am confused: Now I was finally able to chroot, but which is the boot partition then? I red that the boot partition should be the one with 512 MB but so far I haven't even encountered mmcblk1boot1. And it doesn't work anyway. What am I still missing?
A friend told me that it makes a difference which GRUB version I install. So I tried grub-efi, grub-pc and grub-legacy. But I am still lost:
Code:
user@debian:~$ cat /proc/partitionsmajor minor #blocks name 179 0 122138624 mmcblk1 179 1 524288 mmcblk1p1 179 2 120611840 mmcblk1p2 179 3 1000448 mmcblk1p3 179 256 4096 mmcblk1boot0 179 512 4096 mmcblk1boot1 8 0 7987200 sda 8 1 3103808 sda1 8 2 4768 sda2 7 0 2580448 loop0user@debian:~$ sudo mount /dev/mmcblk1p2 /mntuser@debian:~$ sudo mount --bind /dev /mnt/devuser@debian:~$ sudo mount --bind /proc /mnt/procuser@debian:~$ sudo mount --bind /sys /mnt/sysuser@debian:~$ sudo chroot /mnt bashroot@debian:/# grub-install --boot-directory=/mnt/boot /dev/mmcblk1 Installing for x86_64-efi platform.grub-install: error: cannot find EFI directory.root@debian:/# grub-install --boot-directory=/mnt/boot /dev/mmcblk1boot1Installing for x86_64-efi platform.grub-install: error: cannot find EFI directory.root@debian:/# grub-install --boot-directory=/mnt/boot /dev/mmcblk1boot0Installing for x86_64-efi platform.grub-install: error: cannot find EFI directory.
A friend told me that it makes a difference which GRUB version I install. So I tried grub-efi, grub-pc and grub-legacy. But I am still lost:
Code:
root@debian:/# apt-get install grub-pcReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneThe following additional packages will be installed: grub-pc-binThe following packages will be REMOVED: grub-efi-amd64The following NEW packages will be installed: grub-pc grub-pc-bin0 upgraded, 2 newly installed, 1 to remove and 219 not upgraded.Need to get 1134 kB of archives.After this operation, 3559 kB of additional disk space will be used.Do you want to continue? [Y/n] yGet:1 http://deb.debian.org/debian bookworm/main amd64 grub-pc-bin amd64 2.06-13+deb12u1 [997 kB]Get:2 http://deb.debian.org/debian bookworm/main amd64 grub-pc amd64 2.06-13+deb12u1 [137 kB]Fetched 1134 kB in 0s (2724 kB/s)perl: warning: Setting locale failed.perl: warning: Please check that your locale settings:LANGUAGE = (unset),LC_ALL = (unset),LANG = "en_US.UTF-8" are supported and installed on your system.perl: warning: Falling back to the standard locale ("C").locale: Cannot set LC_CTYPE to default locale: No such file or directorylocale: Cannot set LC_MESSAGES to default locale: No such file or directorylocale: Cannot set LC_ALL to default locale: No such file or directoryPreconfiguring packages ...E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)(Reading database ... 238328 files and directories currently installed.)Removing grub-efi-amd64 (2.06-13+deb12u1) ...Selecting previously unselected package grub-pc-bin.(Reading database ... 238324 files and directories currently installed.)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) ...Setting up grub-pc-bin (2.06-13+deb12u1) ...Setting up grub-pc (2.06-13+deb12u1) ...locale: Cannot set LC_CTYPE to default locale: No such file or directorylocale: Cannot set LC_MESSAGES to default locale: No such file or directorylocale: Cannot set LC_ALL to default locale: No such file or directoryProcessing triggers for man-db (2.11.2-2) ...root@debian:/# grub-install --boot-directory=/mnt/boot /dev/mmcblk1Installing for x86_64-efi platform.grub-install: error: cannot find EFI directory.root@debian:/# apt-get install grub-legacyReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneThe following packages were automatically installed and are no longer required: efibootmgr grub-efi-amd64-bin grub-pc-bin mokutil shim-helpers-amd64-signed shim-signed-common shim-unsignedUse 'sudo apt autoremove' to remove them.The following additional packages will be installed: libc6-i386Suggested packages: grub-legacy-doc multibootThe following packages will be REMOVED: grub-pc grub2-common shim-signedThe following NEW packages will be installed: grub-legacy libc6-i3860 upgraded, 2 newly installed, 3 to remove and 219 not upgraded.Need to get 2761 kB of archives.After this operation, 10.0 MB of additional disk space will be used.Do you want to continue? [Y/n] yGet:1 http://deb.debian.org/debian bookworm/main amd64 libc6-i386 amd64 2.36-9+deb12u8 [2459 kB]Get:2 http://deb.debian.org/debian bookworm/main amd64 grub-legacy amd64 0.97-80 [302 kB]Fetched 2761 kB in 1s (2947 kB/s)perl: warning: Setting locale failed.perl: warning: Please check that your locale settings:LANGUAGE = (unset),LC_ALL = (unset),LANG = "en_US.UTF-8" are supported and installed on your system.perl: warning: Falling back to the standard locale ("C").locale: Cannot set LC_CTYPE to default locale: No such file or directorylocale: Cannot set LC_MESSAGES to default locale: No such file or directorylocale: Cannot set LC_ALL to default locale: No such file or directoryE: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)(Reading database ... 238644 files and directories currently installed.)Removing grub-pc (2.06-13+deb12u1) ...locale: Cannot set LC_CTYPE to default locale: No such file or directorylocale: Cannot set LC_MESSAGES to default locale: No such file or directorylocale: Cannot set LC_ALL to default locale: No such file or directoryRemoving shim-signed:amd64 (1.44~1+deb12u1+15.8-1~deb12u1) ...locale: Cannot set LC_CTYPE to default locale: No such file or directorylocale: Cannot set LC_MESSAGES to default locale: No such file or directorylocale: Cannot set LC_ALL to default locale: No such file or directoryNo DKMS packages installed: not changing Secure Boot validation state.Removing grub2-common (2.06-13+deb12u1) ...Selecting previously unselected package libc6-i386.(Reading database ... 238605 files and directories currently installed.)Preparing to unpack .../libc6-i386_2.36-9+deb12u8_amd64.deb ...Unpacking libc6-i386 (2.36-9+deb12u8) ...Selecting previously unselected package grub-legacy.Preparing to unpack .../grub-legacy_0.97-80_amd64.deb ...Unpacking grub-legacy (0.97-80) ...Setting up libc6-i386 (2.36-9+deb12u8) ...Setting up grub-legacy (0.97-80) ...Installing new version of config file /etc/kernel/postinst.d/zz-update-grub ...Installing new version of config file /etc/kernel/postrm.d/zz-update-grub ...Processing triggers for man-db (2.11.2-2) ...Processing triggers for libc-bin (2.36-9+deb12u8) ...root@debian:/# grub-install --boot-directory=/mnt/boot /dev/mmcblk1Unrecognized option `--boot-directory=/mnt/boot'Usage: grub-install [OPTION] install_deviceInstall GRUB on your drive. -h, --help print this message and exit -v, --version print the version information and exit --root-directory=DIR install GRUB images under the directory DIR instead of the root directory --grub-shell=FILE use FILE as the grub shell --no-floppy do not probe any floppy drive --force-lba force GRUB to use LBA mode even for a buggy BIOS --recheck probe a device map even if it already existsINSTALL_DEVICE can be a GRUB device name or a system device filename.grub-install copies GRUB images into the DIR/boot directory specfied by--root-directory, and uses the grub shell to install grub into the bootsector.Report bugs to <bug-grub@gnu.org>.root@debian:/# grub-install --root-directory=/mnt/boot /dev/mmcblk1WARNING: tempfile is deprecated; consider using mktemp instead.WARNING: tempfile is deprecated; consider using mktemp instead.The file /mnt/boot/boot/grub/stage1 not read correctly.
Statistics: Posted by Onsemeliot — 2024-10-21 08:39