booting ext4 with legacy grub


Results 1 to 15 of 15

Thread: booting ext4 with legacy grub

  1. #1
    Join Date
    Sep 2008
    Posts
    33

    booting ext4 with legacy grub [solved]

    Hi all,

    I'm having a little trouble getting Debian Squeeze to boot by chainloading, since I converted it from ext3 to ext4. I use legacy grub for both MBR (points to Ubuntu Lucid in sda1) and the boot sector of sdb5 (Squeeze). My other ext4 partitions all boot with legacy grub, usually borrowed from Ubuntu. I have tried:
    1 Simply copying the *stage* files from the Ubuntu Lucid /boot directory and running grub-install.
    1a Using a Grub CD (originally from Jaunty) and running
    Code:
    root (hd1,4)
    setup (hd1,4)
    2 Using Debian's apt-get and changing temporarily sources.list to install the Ubuntu version of grub, then grub-install.
    3 Removing the above and installing the latest Debian legacy-grub, then running grub-install.

    I've been getting the error "Mismatched or corrupt version of stage1/stage2" from grub-install and setup.
    Unsurprisingly, I get "Error 13: Invalid or unsupported file format" when trying to boot with my corrupt stage1/stage2 by chainloading.

    I can boot Debian perfectly well manually using the Ubuntu Lucid grub with a command line and the identical commands to those in the Debian menu.lst.

    Of methods 1,2, and 3 above, method 1 has worked for me several times with different distros. I expected method 2 to work. Method 3 I didn't really expect to work.

    I suppose I could give in and use grub2, but I dislike it, and the Ubuntu grub has always worked with ext4 in other distros.

    Any ideas?
    Last edited by impert; 03-16-2012 at 12:33 PM.

  2. #2
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,948
    I believe the original legacy Grub can't read a Ext4 partition. Ubuntu has doctored it to overcome this problem. Therefore you need physically the doctored version of the two files (stage1 & stage2) inside the /boot or /boot/grub directory of the Debian partition.

    The doctored stage1 and stage2 should be set up by its own legacy Grub. If you source it from a Ubuntu then do it from there, using either Grub-install or root+setup.

    As far as I am aware the factory system of the distros are chainloadable by either Grub once it has been set up correctly.

    Please let us know the error message if you still have a problem.

    BY the way the distro that owns the MBR and controls the bootling cannot chainload itself. If you think about it the situation is like a dog chasing its own tail.

    Lastly Grub2 isn't that bad because you can stick with the conventional partition device names. The only major feature that Grub2 does not have over Grub1 is the ability to do setup. AFAIK Grub2 must be restored by a booted up Linux and not by the Grub alone. Other than that you get every functionality the same.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  3. #3
    Join Date
    Sep 2008
    Posts
    33
    Thanks for the reply, Saikee.
    The doctored stage1 and stage2 should be set up by its own legacy Grub. If you source it from a Ubuntu then do it from there, using either Grub-install or root+setup
    .
    I think I did this, but I'm not too sure now, so this may have been the problem. I'll try it again, and report.
    Both versions of legacy grub from Ubuntu were "doctored" versions.

    Lastly Grub2 isn't that bad
    I admire your tolerant attitude.

  4. #4
    Join Date
    Sep 2008
    Posts
    33
    Ha! Solved.

    Copied everything over from Maverick, and ran grub-install from Maverick. Of course, when I tried booting in the normal way, the sdb5 (Debian) boot sector pointed to Maverick, but at least it went in without complaining about mismatches.

    It was then just a matter of booting Debian manually, then running grub-install from Debian.

    Thanks again for your help, Saikee.

  5. #5
    Join Date
    Jul 2002
    Location
    New Orleans, LA USA
    Posts
    986
    Quote Originally Posted by impert View Post
    I admire your tolerant attitude.
    I really lol'd. Grub legacy for life!
    "Whenever you find yourself on the side of the majority, it's time to pause and reflect."

    -Mark Twain

  6. #6
    Join Date
    Sep 2008
    Posts
    33
    I really lol'd. Grub legacy for life!
    Well, actually, I think I'm a bit unfair about grub2. After all, it is impeccably free, in both senses, and it does work, ie it boots things. If grub1 didn't exist, we'd all be delighted to have grub2. I just hope there'll be "doctored" versions for btrfs and whatever fs supersedes btrfs when the time comes.

  7. #7
    Join Date
    Jul 2002
    Location
    New Orleans, LA USA
    Posts
    986
    I'm sure the problem is between the monitor and keyboard.

    However, it just never fails, and I mean I'm at a strict 100%, that I have an install working fine, grub gets flagged to upgrade to grub2, system stops booting. The prompt that appears is so void of functionality that I can't even manually boot like in legacy grub. I've been told that this is because it is a stage prior to the legacy grub menu and I'd normally get a crash with legacy grub. The problem is, though, that I never get a crash from legacy grub - at worse I drop to the grub shell which is useful. Basically circular logic on a non-existent issue, a moot argument. So livecd boot, reinstall grub legacy, and flag that box to never, ever, ever, under any circumstances, ever, ever install grub2.

    To each their own, but in my now 14 or 15 years of playing with Linux, I have yet to successfully boot anything with grub2, honestly, not-even-once.

    EDIT => I always find things like this funny - grub2 hate groups. Actually you get quite a few hits if you google grub2 + <insert any negative word>
    Last edited by trilarian; 03-16-2012 at 04:53 PM.
    "Whenever you find yourself on the side of the majority, it's time to pause and reflect."

    -Mark Twain

  8. #8
    Join Date
    Jun 2002
    Location
    Michigan
    Posts
    876
    trilarian

    To each their own, but in my now 14 or 15 years of playing with Linux, I have yet to successfully boot anything with grub2, honestly, not-even-once.
    That's amazing, I've not worked with grub2 much but the first time I did a dual boot I had to map the drive. It took some time to find how to do it but once I had it set up it booted fine. I just don't work enough with it to understand it as I should.

  9. #9
    Join Date
    Jul 2002
    Location
    New Orleans, LA USA
    Posts
    986
    What makes me throw my hands up is the inability to fix it when it breaks, which is every single time beginning with install. If I screw up an entry in grub's config file, it tries, fails, and drops me to a usable shell where I can manually boot and fix the config file. Every time I install grub2 it drops me to a pseudo-shell were there are maybe two or three commands available, none of which let you progress past that fake shell.

    I love that Linux offers so much choice, but this is a special case where I really do get mad that it even exist - simply because most distro's consider it an upgrade (2 must be better than 1, right...) so I have to remember to flag it on every single box I ever touch. It should be a manual update only, then I wouldn't want it and it's writers tortured to death, revived, and tortured again... lol.

    I hate grub2 in every possible sense.

    EDIT => And it should be noted that I have Debian Sid (Unstable) on everything but my server, so I'm not afraid of change or having to fix things regularly. It is just that I can't fix grub2.
    Last edited by trilarian; 03-16-2012 at 05:19 PM.
    "Whenever you find yourself on the side of the majority, it's time to pause and reflect."

    -Mark Twain

  10. #10
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,948
    To be fair Grub2 can be boot manually just as Grub1 once you are dealing with it and not the broken version. I have both Grub1 and Grub2 on its own in a floppy and CD so just use the right tool whenever needed.

    I do play around with 2 and 3TB hard disk and legacy Grub (Grub1) refuses to fire up anything beyond 1.4TB thus using Grub2 is the only choice for me for booting distros at the rear end of a large disk. I don't normally alter the boot loader shipped by the factory.

    Grub2 is more Linux like and can be used to list the directory (using command ls same as Bash) . That is a function Grub1 never managed.

    One thing Grub2 annoying me is that it is still under development. Thus something works now may be useless a few month from now when the developer alter the code. However it is getting better all the time and there seems to be a drive to make it accepting the commands used in Grub1. For example one can do "root" command in additional to "set root".

    Grub2 has been made factory-ready for large capacity hard disk (>2TB) and able to read GPT partition table. It is less helpful to diagnose if something goes wrong as it doesn't have an error number list like legacy Grub.

    If one has to use it (and persevere with the initial steep learning curve) one would find there is not much to choose between the two. The problem with many of us is we know legacy Grub well. It will never change (as its maintenance work ceased long time ago) so it is very reliable. Thus spending time to learn a new system, which does not seem to offer much additional advantage, is lot of hassle for nothing.
    Last edited by saikee; 03-16-2012 at 05:50 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  11. #11
    Join Date
    Sep 2008
    Posts
    33
    @trilarian
    I'm sure the problem is between the monitor and keyboard.
    You mean my fluffy penguin?
    I hate grub2 in every possible sense.
    Wow! I thought I was bad.
    I used grub2 for a year or two in the MBR, not without a good deal of gnashing of teeth. In the end, I had it (sort of) tamed, by making not-executable everything in grub.d except 00_header, a severely modded 10_linux and 40_custom which was just a list of distros followed by chainloader +1, la Saikee. There was absolutely no advantage over using grub1. The only reason I persisted was to learn to use it, from the fear that one day we may all have to.
    Left to its own devices grub2 produced a list of over 100 menu entries.
    The silly thing is that grub2 is supposed to make multi-booting easier. Editing a menu.lst is so much simpler than jumping through all the hoops grub2 puts in your way. Still, the developers mean well, we don't have to use it for now, and it's not malware.

  12. #12
    Join Date
    Sep 2008
    Posts
    33
    I do play around with 2 and 3TB hard disk and legacy Grub (Grub1) refuses to fire up anything beyond 1.4TB thus using Grub2 is the only choice for me for booting distros at the rear end of a large disk. I don't normally alter the boot loader shipped by the factory.
    If you allow 10G per system, with all data in directories at the end of the HD, this limits you to about 140 distros per HD. For me, this is not a problem.
    By the way, is there a "doctored" version which will boot btrfs?
    (Can't help smiling at "doctored": it reminds me of a line from "Under Milk Wood")

  13. #13
    Join Date
    Jun 2002
    Location
    Michigan
    Posts
    876
    trilarian

    I hate grub2 in every possible sense.
    Better stick with debian then, I'm not sure about a text install, but every gui install I have ever tried of the buntu's does not ask where to install grub. They don't give you any choice at all. I have installed debian testing from a text install and am given a choice of grub or lilo for a boot loader AND if I want it installed in the MBR or in the boot partition. (Another reason I like Debian over the buntu's).

    EDIT => And it should be noted that I have Debian Sid (Unstable) on everything but my server, so I'm not afraid of change or having to fix things regularly. It is just that I can't fix grub2.
    Do you run into many dep. problems with Sid? I've been having some problems with the testing branch but the system is usable.

  14. #14
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,948
    By the way, is there a "doctored" version which will boot btrfs?
    Don't have an answer. If a distro supports btrfts and provides legacy Grub then that is the one.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  15. #15
    Join Date
    Jul 2002
    Location
    New Orleans, LA USA
    Posts
    986
    Quote Originally Posted by impert View Post
    @trilarian You mean my fluffy penguin?
    That too! Though I was referencing myself.

    Quote Originally Posted by mrrangerman43 View Post
    Better stick with debian then, I'm not sure about a text install, but every gui install I have ever tried of the buntu's does not ask where to install grub.
    Yea, I've been Debian only for a long time now. I'll dl a new distro from time to time just to play, but it usually is overwritten with a Debian install within a week. As for app management, I still haven't been convinced I need anything past apt-get on the CLI.

    Quote Originally Posted by mrrangerman43 View Post
    Do you run into many dep. problems with Sid? I've been having some problems with the testing branch but the system is usable.
    Yes and no. I haven't had too many issues like the old days when Sid could be very unusable. What I find is you HAVE TO turn off any sort of auto-updates. Read every time you fire an update and see what it is doing. As long as things are just being updated or held back, you are usually fine. Sometimes it wants to remove a package and that is where you need to investigate. Sometimes it is OK because it is getting replaced and is obscure, other times it is getting replaced but not every other package is ready so you have to sym link the old package number to the new for everything to run. And on very rare occasions it causes a base package to be removed which can cause all sorts of hell. I learned that the hard way when a dependency forced mdadm to be removed, sigh.

    Sounds daunting, but really all you have to do is read for 30s before just OK'ing the update. It starts to become obvious in time. Frequent, smaller, updated for Sid seem to work better too. I usually go:

    Sid: Bi-Weekly
    Testing: Weekly
    Stable: Monthly
    "Whenever you find yourself on the side of the majority, it's time to pause and reflect."

    -Mark Twain

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •