(Solved) Grub4Dos Problem... Cannot boot both puppy and linux on HDD

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
User avatar
lizardidi
Posts: 72
Joined: Sat Jul 18, 2020 9:42 am
Has thanked: 20 times
Been thanked: 12 times

(Solved) Grub4Dos Problem... Cannot boot both puppy and linux on HDD

Post by lizardidi »

My laptop hdd got 3 partition, namely sda1, sda2, and sda3.

Lubuntu 64 bit is installed in sda1.
Sda2 is the partition that i kept my stuff..
I recently installed puppy linux in sda3. However, after i run the Grub4dos installer using puppy linux, i cant boot into Lubuntu or puppy linux.

I suspect my problem is related here:
https://github.com/puppylinux-woof-CE/w ... ssues/1263
However, since our main forum downed, i cannot follow the instructions showed there. (RIP John)

Btw, I frugally installed dpupstretch on my laptop hdd.

Would greatly appreciate if someone can show me the solution to the grub issue. Thanks

Edit: Thanks for all the help, i use the Super Grub 2 Disk to boot into Lubuntu, then i install boot-repair via apt-get, then repair Grub folling the on-screen-instructions. I can now boot into my main OS.
Last edited by lizardidi on Wed Jul 29, 2020 9:47 am, edited 2 times in total.
User avatar
666philb
Posts: 429
Joined: Thu Jul 09, 2020 3:18 pm
Location: wales uk
Has thanked: 111 times
Been thanked: 146 times

Re: Grub4Dos Problem... Cannot boot both puppy and linux on HDD T.T

Post by 666philb »

hi lizardidi

i've grabbed the post that i think you were after from the google cache
This How-To is to address an issue when trying to use Grub4DOS with newer systems with 64-bit Ext4 partitions, typically created when another newer Linux distro is installed.

This is an issue with older bootloaders like Grub4DOS (0.4.4), Grub Legacy (0.97) and Syslinux (6.03) not being compatible with this relatively new filesystem implementation of 64-bit Ext4. The current Grub2 (aka simply, Grub) is compatible with this newer filesystem. Installing Grub4DOS onto 64-bit Ext4 results in the Error 13 and bootloader failure.

Note that this has nothing to do with a 64-bit processor, or a 64-bit operating system. It is a separate issue with the filesystem itself being 64-bit, as opposed to 32-bit in previous versions. While Puppy booted live can read from a 64-bit Ext4 partition, the Grub4DOS bootloader itself cannot.

Wrote about it previously:
http://www.murga-linux.com/puppy/viewto ... 756#945756

Quote:

This is a relatively new issue that came up within the last year, and Puppy may have to address it at some point. Has to do with 64-bit Ext4, which is different from 64-bit Linux. Started with 1.43 version of e2fsprogs, which came in with Ubuntu 16.10. Syslinux posted some info about it:
http://www.syslinux.org/wiki/index.php?title=Filesystem
Quoting part of the release notes of version 1.43 of e2fsprogs (May 17, 2016):
Mke2fs will now create file systems with the metadata_csum and 64bit features enabled by default.
Users should rather (manually) disable the 64bit feature in the mke2fs command when creating / formatting a boot volume with ext4; otherwise, the bootloader (as of version 6.03) will fail.

Technically, any distro released after May 2016 could have its installer creating 64-bit Ext4 partitions. Depends if their programs are all up to date.(check Distrowatch table) This will be more and more of a problem as new users try to install Puppy on top of newer distros with this feature enabled. Luckily was not in Ubuntu 16.04LTS which is so widespread, but appears to have gotten in with 16.10. I noticed it on an Arch derivative, but they are more up to date than others.


Depending on how you have Grub4DOS installed, you may see different errors.

If loaded to MBR, you will see a failure in the stage 1 of the bootloader as it cannot read the stage 2 on the 64-bit Ext4 partition:
wee 0> find --seek-root /grldr
(0x80,0)
wee 0> /grldr
wee 13>

If Grub4DOS is installed and working on another partition, you will see the error in stage 2 as it tries to boot Puppy/Linux on the 64-bit Ext4 partition:
Error 13: Invalid or unsupported exectuable format

To still use Grub4DOS with this partition, you will need to remove the 64-bit feature from the Ext4 filesystem.

Unfortunately, Puppy does not have the version of e2fsprogs 1.43 or greater that is required to fix the problem. But you can download and compile from source directly:
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git

EDIT: For a quick fix, here is a link to .pet packages for current Puppy 6 Slacko and Tahr.
(disclaimer: not all implications of using updated e2fsprogs has been tested, best to use only as a temporary fix for this issue)

Another easy way to get the right version is to download the Gparted Live CD ISO, version higher than 0.26 has e2fsprogs >=1.43:
http://gparted.org/download.php
And then you can use the e2fsprogs included on the disc.
Or you can boot a newer Linux distro/disc like the one which created the partition. Also see addendum below for rescue disc option.

From booted Gparted Live desktop, open a terminal and do the following:
(note: in Gparted Live examples below, all commands preceded by "sudo" prefix)

First, check partition for 64-bitness with tune2fs -l (partition) command::
Code:
user@debian:~$ sudo tune2fs -l /dev/sda1
tune2fs 1.43.1 (08-Jun-2016)
Filesystem volume name: <none>
...
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags: signed_directory_hash
...
Checksum: 0x65dd14e3


Note the 64bit in Filesystem features list above.

In order to change this, you must have e2fsprogs version 1.43 or greater, where resize2fs will have "-s" option as below:

Code:
user@debian:~$ sudo resize2fs
resize2fs 1.43.1 (08-Jun-2016)
Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [-b|-s|new_size] [-z undo_file]


Then to perform the fix, issue resize2fs -s (partition) command to remove 64-bit feature:

Code:
user@debian:~$ sudo resize2fs -s /dev/sda1
resize2fs 1.43.1 (08-Jun-2016)
Converting the filesystem to 32-bit.
The filesystem on /dev/sda1 is now 2883328 (4k) blocks long.


You may get a warning to do e2fsck first, so do that and then issue resize2fs after that.

That's it! Grub4DOS should now be working on your updated 32-bit Ext4 partition. Only takes a few seconds and existing data is unaffected.


Addendum:

If you do not want to use Grub4DOS and want to revert to your Linux Grub2 bootloader, you can use a rescue disc to boot into your other Linux. One good one is Super Grub2 Disk. Very tiny download ISO file that you can burn to CD or write to USB. You don't have to modify/change anything, it just looks for and boots any OS it can find. Then you can repair OS from within itself.

Download Super Grub2 Disk, recommended download ISO:
http://www.supergrubdisk.org/category/d ... sk-stable/

Write to flash. For Windows, cannot use Rufus. Direct write with something like ImageUSB:
http://osforensics.com/tools/write-usb-images.html


EDIT: A newer Chinese fork of Grub4DOS by chenall has been modified to address 64-bit Ext4, but not yet fully integrated with latest Puppy.
User avatar
lizardidi
Posts: 72
Joined: Sat Jul 18, 2020 9:42 am
Has thanked: 20 times
Been thanked: 12 times

Re: Grub4Dos Problem... Cannot boot both puppy and linux on HDD T.T

Post by lizardidi »

thanks 666philb, this was exactly what i am looking for. The error i faced was "Wee 13 Error". My Lubuntu version is 18.04 64 bit version.

Really hope :
1. Our old forum's archives can se saved
2. Newer version puppy will be updated with Grub4Dos version that can boot newer linux 64bit ext4 OS.
Post Reply

Return to “Beginners Help”