GRUB : Grand Unified Boot Loader
update-grub /usr/sbin/update-initramfs -u
GRUB_CONFIG=/boot/grub/grub.cfg sudo grep 'menuentry ' $GRUB_CONFIG | cut -f 2 -d "'" | nl -v 0 sudo grub-reboot $index # wont work sudo grub-reboot $name # will raise warning sudo grub-set-default 0 sudo grub-reboot 'Advanced options for Debian GNU/Linux>Debian GNU/Linux, with Linux 4.9.0-9-amd64' sudo update-grub sudo reboot
grub screw syslinux or is it gag ?
"Welcome to GRUB!"
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=463081
mv /etc/default/grub /etc/default/grub.orig sudo os-prober /dev/sda2:Microsoft Windows XP Professional:Windows:chain
cat<<EOF > /root/reboot.sh #! /bin/sh #TODO: update that one ie 0=l 1=r 2=w MENU_ENTRY=2 sudo grub-reboot $MENU_ENTRY sync sync sync echo "About to reboot : Press control+C to cancel" sleep 10 sudo reboot EOF
http://forum.ubuntu-fr.org/viewtopic.php?id=358656
GRUB loading. error: no such disk grub rescue> set prefix=(UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)/boot/grub root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX grub rescue> ls (hd0) (hd0,6) (hd0,5) grub rescue> ls (hd0,5)/ error: unknown filesystem grub rescue> ls (hd0,6)/ ./ ../ lost+found/ boot/ grub rescue> set prefix=(hd0,6)/boot/grub grub rescue> insmod sh ...//... rescue:grub> ls (hd0,6)/boot ./ ../ vmcoreinfo-2.6.31-20-generic System.map-2.6.31-20-generic initrd.img-2.6.31-20-generic vmlinuz-2.6.31-20-generic config-2.6.31-20-generic grub/ memtest86+.bin abi-2.6.31-20-generic rescue:grub> set root=hd0,6 rescue:grub> insmod linux rescue:grub> linux /boot/vmlinuz-2.6.31-20-generic root=/dev/sda6 quiet [Linux-bzImage, setup=0x3400, size=0x3c400] rescue:grub> initrd /boot/initrd.img-2.6.31-20-generic [Initrd, addr=0x177fb000, size=0x83874e] rescue:grub> boot ...//...
drivemap error: no such partition.
root=(hd0,5) search.file device.map
cat /etc/grub.d/90_sda7 #!/bin/sh exec tail -n +3 $0 menuentry "sda7" { set root=(hd0,msdos6) # search --no-floppy --fs-uuid --set 147e39c87e39a400 chainloader +1 }
Did not work from me :
root@nrv:/home/rzr# cat /etc/grub.d/WXHOEM_FR #! /bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry "Windows XP installer" { insmod part_msdos insmod ntfs insmod ntldr insmod fat set root='(hd0,msdos1)' search -f /i386/setupldr.bin -s root ntldr /i386/setupldr.bin }
lts ubuntu 18
https://askubuntu.com/questions/254491/failed-to-get-canonical-path-of-cow
root@kubuntu:/mnt/tmp# echo 'GRUB_ENABLE_CRYPTODISK=y' >> /etc/default/grub root@kubuntu:/mnt/tmp# grub-install --recheck --root-directory=/mnt/tmp/ /dev/sdb Installing for i386-pc platform.
sudo grub-mkdevicemap
WARNING: Failed to connect to lvmetad.
Hang
df: Warning: cannot read table of mounted file systems: No such file or directory
sudo grub-install $disk
Context: Disk was installed on SatA and then relocated to UsB :
grub rescue> ls (hd0) (hd0,msdos5) ...
Possible fix, I installed DebiaN-9 to 1st part (800M < 1GB, DebiaN-10 did not fit in) disk is attached as USB.
Grub boots fine from UsB now:
fdisk -l Partition 4 does not start on physical sector boundary
root@nrv:/# grub-install /dev/sda10 Could not find device for /boot: Not found or not a block device.
tar cvfz /root/grub.tar.gz /boot/grub sudo aptitude reinstall grub grub-install --recheck /dev/sda10 grub --batch find /boot/grub/stage1 root (hd1,9) # Filesystem type is ext2fs, partition type 0x83 setup (hd1,9) # Checking if "/boot/grub/stage1" exists... no # Checking if "/grub/stage1" exists... no # Error 2: Bad file or directory type
https://bugs.launchpad.net/ubuntu/+source/grub/+bug/207001
/mnt/parent/usr/sbin/grub --version grub (GNU GRUB 0.97) grub> setup (hd1,9) Checking if "/boot/grub/stage1" exists... yes Checking if "/boot/grub/stage2" exists... yes Checking if "/boot/grub/e2fs_stage1_5" exists... yes Running "embed /boot/grub/e2fs_stage1_5 (hd1,9)"... failed (this is not fatal) Running "embed /boot/grub/e2fs_stage1_5 (hd1,9)"... failed (this is not fatal) Running "install /boot/grub/stage1 (hd1,9) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded Done.
grub> find /boot/grub/menu.lst find /boot/grub/menu.lst (hd0,5) (hd1,0) grub> root (hd1,0) root (hd1,0) grub> setup (hd1,0) setup (hd1,0) Checking if "/boot/grub/stage1" exists... no Checking if "/grub/stage1" exists... no Error 15: File not found find /boot/grub/devices.map
also check for devices.map
grub-install --recheck /dev/sda1
Failed on deb install,
update-grub
solution
parted show no parts while /proc/partitions is there
chroot to install testdisk to recreate the partition table
invalid arch independent ELF magic
sudo apt-get install --reinstall grub-pc-bin grub-pc
fdisk -l /dev/sdb | Disk /dev/sdb: 250 GB, 250056737280 bytes | 255 heads, 63 sectors/track, 30401 cylinders | Units = cylinders of 16065 * 512 = 8225280 bytes | Device Boot Start End Blocks Id System | /dev/sdb1 1 130 1044193 82 Linux swap mkfs.ext3 /dev/sdb1 mount /mnt/sdb1 cp -rfa /boot /mnt/sdb1/ grep root /mnt/sdb1/boot/grub/menu.lst | root (hd0,0) cat /mnt/sdb1/boot/grub/device.map | (hd0) /dev/sdb | (hd1) /dev/hda grub-install /dev/sdb --root-directory=/mnt/sdb1/
sudo $(which grub-install) --version /usr/sbin/grub-install (GRUB) 2.04-1ubuntu12.1
On PentiuM with grub-pc-bin (2.02+dfsg1-20+deb10u2) ?
sudo apt-get remove --purge grub mv /boot/grub /boot/grub.mine sudo apt-get install grub grub-install /dev/sda
http://www.gnu.org/software/grub/manual/html_node/Command-line-and-menu-entry-commands.html
au boot presser 'c' :
title Windows XP rootnoverify (hd0,0) makeactive chainloader +1
evidemment, faut adapter le hd0,0
chroot: cannot run command `/bin/bash': Permission denied
remount with exec param
sudo grub-install /dev/sda /dev/sda: Not found or not a block device.
Copy /dev/* with mc
mknod /dev/sda b 8 0 mknod /dev/sda2 b 8 2
sudo grub-install /dev/sda /dev/sda does not have any corresponding BIOS drive.
# cat /boot/grub/device.map (hd0) /dev/hda (hd1) /dev/sda # EOF file:///boot/grub/device.map
LANG=C grub-install /dev/sda /sbin/grub-install: line 485: /dev/null: Permission denied
# mount --bind /dev /mnt/sda8/dev && chroot /mnt/sda8
# http://www.knoppix.net/wiki/Dev_null_permission_denied
# yaird error: can't open directory /sys/block (fatal) mount --bind /sys /mnt/sda8/sys
Errors :
Error 22: No such Partition
http://forum.ubuntu-fr.org/viewtopic.php?id=47546
The file /boot/grub/stage1 is not read correctly.
sudo grub-install /dev/sda # Searching for GRUB installation directory ... found: /boot/grub # The file /boot/grub/stage1 not read correctly.
fdisk /dev/sda << EOF
t
1
83
w
grub-install /dev/sda Searching for GRUB installation directory ... found: /boot/grub The file /boot/grub/stage2 not read correctly.
Happened while :
cd /mnt/sda8 mount | grep $(pwd) mount --bind /dev ./dev mount --bind /proc ./proc chroot . grub-install /dev/sda
Solution :
sudo update-grub
Did not help
This happed when I used chroot :
grub --batch root (hd1,7) setup (hd1,7)
Happended after i deleted /boot/grub and installed , plus update-grub
I missed install-grub
Solution: boot on other medium …
check fs
Probing devices to guess BIOS drives. This may take a long time.
Grub Loading Stage 1.5 Grub Loading please wait…. Error 21
$ ms-sys -m /dev/sda Windows 2000/XP/2003 master boot record successfully written to /dev/sda
$ install-grub /dev/sdaX $ mkfs.vfat -nv sdaX
fdisk -l /dev/sda
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x12345678
Device Boot Start End Blocks Id System
/dev/sda1 1 130 1044193+ 82 Linux swap / Solaris
/dev/sda2 1175 30401 234765877+ 5 Extended
/dev/sda3 131 652 4192965 b W95 FAT32
/dev/sda4 653 1174 4192965 83 Linux
/dev/sda5 1175 28707 221158791 83 Linux
/dev/sda6 30272 30401 1044193+ 82 Linux swap / Solaris
/dev/sda7 28708 29229 4192933+ b W95 FAT32
/dev/sda8 * 29230 30271 8369833+ 83 Linux
Partition table entries are not in disk order
cat /boot/grub/device.map
# file:///boot/grub/device.map
(hd0) /dev/hda
(hd1) /dev/sda
grub --batch
root (hd1,7)
setup (hd1,7)
ToDo : test
This appends w/ Kernel 2.6.14 :
Busybox Alert /dev/hda5 does not exist! Dropping into a shell....
http://www.livejournal.com/community/evan_tech/148768.html?nc=7
grep ROOT /etc/mkinitrd/mkinitrd.conf ROOT=probe
# grub-install /dev/hda The file /boot/grub/stage1 not read correctly.