After pxe booting a server and installing linux from a cpio archive, grub failed to load using the grub-install command. The error presented was as follows: root@pxe:~# mkdir /target root@pxe:~# mount /dev/sda1 /target root@pxe:~# chroot /target root@pxe:~# grub-install /dev/sda The file /boot/grub/stage1 not read correctly. Since command line didn’t work, I tried installing grub via the grub shell: root@pxe:~# grub GNU GRUB version 0.97 (640K lower / 3072K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.] grub> root (hd0,0) root (hd0,0) Filesystem type is ext2fs, partition type 0xfd grub> setup (hd0) setup (hd0) Checking if '/boot/grub/stage1' exists. No Checking if '/grub/stage1' exists. Canon eos 7d manuale italiano pdf free. No Error 2: Bad file or directory type grub> This too failed, with a different error message. The Stage 1.5 boot loader is read into memory by the Stage 1 boot loader, if necessary. Some hardware requires an intermediate step to get to the Stage 2 boot loader. This is sometimes true when the /boot/ partition is above the 1024 cylinder head of the hard drive or when using LBA mode. ![]() You may have noticed the first error message given while attempting to install grub with the grub-install command yielded: The file /boot/grub/stage1 not read correctly While attempting to install grub via the grub shell yielded: Error 2: Bad file or directory type After some research, grub only works on an inode size of 128, and the pxe system formatted the file system with an inode size of 256. Root@pxe:~# tune2fs -l /dev/sda1| grep -i 'inode size' Inode size: 256 The system being reimaged was an older legacy system, and the pxe system had been upgraded months prior. Having remembered this, I compared versions of mke2fs and found that the upgraded version creates 256-byte inodes by default, where the older version was 128. To correct this, I updated the pxe imaging scripts responsible for formatting the disks with the -I option as follows: root@pxe:~# mke2fs -L / -I 128 -F -j -O dir_index /dev/sda1 Once recreating the file system with a defined inode size of 128, the grub-install command worked successfully. Root@pxe:~# tune2fs -l /dev/sda1| grep -i 'inode size' Inode size: 128 Link to original: Other useful links: Link to original: Link to original: Link to original: Posted in Post navigation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |