Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted
Been testing grub2 in chainloader mode the last week or so.

 

What does it do that plain grub doesn't? Does it support ext2 file systems with more than 128 bytes per inode, by any chance? Took me a while to figure out that problem - formatted an ext2 partition with the latest version of System Rescue CD, then couldn't figure out why grub couldn't read menu.lst off it - turns out mke2fs defaults to 256 bytes per inode now, which the version of grub that ships with System Rescue CD can't handle. Easily fixed by formatting with e.g. "mke2fs -i128 /dev/hda2", but fiddly to remember.

 

--

David Hicks

  • 1 month later...
Posted

Ive not really got a clue what the new grub does over the old one..

 

However, now that Im running grub2 I think Ive put myself into a bit of a dilemma with regards to upgrading to Win7 on my laptop.

 

I have like this

 

sda1: Sony Vista Recovery Partition

sda2: Win XP

sda3: Ubuntu

 

Now, if I replace the XP partition with 7, Im assuming I will lose my grub bootloader?

 

Normally I would just use the ubuntu cd and do something to copy it across.. but with me using grub2, its a different version to whats on the ubuntu cd, and uses different files etc, ie its no longer menu.lst etc.

 

Any suggestions what I might be able to do?

Posted

Amongst other things it's modularised and much more portable.

 

From the GNU blurb:

 

GRUB 2 targets at the following goals:

  • Scripting support, such as conditionals, loops, variables and functions.
  • Graphical interface.
  • Dynamic loading of modules in order to extend itself at the run time rather than at the build time.
  • Portability for various architectures.
  • Internationalization. This includes support for non-ASCII character code, message catalogs like gettext, fonts, graphics console, and so on.
  • Real memory management, to make GNU GRUB more extensible.
  • Modular, hierarchical, object-oriented framework for file systems, files, devices, drives, terminals, commands, partition tables and OS loaders.
  • Cross-platform installation which allows for installing GRUB from a different architecture.
  • Rescue mode saves unbootable cases. Stage 1.5 was eliminated.
  • Fix design mistakes in GRUB Legacy, which could not be solved for backward-compatibility, such as the way of numbering partitions.

 

Good to know it's gone well for you, IIRC it's one of our release goals for squeeze so that's reassuring :)

  • Thanks 2
Posted

Now, if I replace the XP partition with 7, Im assuming I will lose my grub bootloader?

 

Normally I would just use the ubuntu cd and do something to copy it across.. but with me using grub2, its a different version to whats on the ubuntu cd, and uses different files etc, ie its no longer menu.lst etc.

 

Any suggestions what I might be able to do?

 

Yes, you will.

 

I've never done this with grub2, but on other occasions:

- do your windows stuff and lose the bootloader

- boot into a rescue cd

- mount your Ubuntu root partition and chroot to it

- assuming all other requirements are present, reinstall the grub2 package (you did it from the package, right?)

  • Thanks 1
Posted

right, sounds fairly straight forward (famous last words)

 

Whats the command to chroot again, Ive not had to do that for a while..

 

Yeh, it was just installed through apt, so hopefully should just work.. Will give it a try tomorrow or monday.

 

Thanks

Posted

OK, got booted off the CD fine, mounted and chrooted to the existing ubuntu partition, did an

 

apt-get --reinstall install grub2

 

and rebooted but it didnt launch grub. I feel Ive forgotton a step, to install grub onto /dev/sda2 ?

Posted

it was

 

grub-install /dev/sda2

 

that I was missing..

 

But its now broke the windows boot :)

 

Will need to read up now on what to put in the grub config to get it to boot win7 instead of xp

Posted

Ah, yes. That's certainly not going to help ;)

 

It's a karmic installation, right? Once you've chrooted into it you should be able to apt-get dist-upgrade to get grub2_1.96+20090725 and then reinstall it as before.

 

If it's a jaunty installation (ignore the rescue cd, you're just using that as a way to chroot) you'll have to add mixed repositories, pin them to jaunty, and pull in the karmic grub2 package. I'll walk you through that if you have.

 

 

Edit: I just thought, I would actually do an apt-get update and then apt-get install grub2, which should just upgrade grub2, not everything else.

  • Thanks 1
Posted

Oh sorry, must have mis-read. Anywho,

 

1. Add karmic repositories to your apt sources (use a local mirror)

2. Pin the default to be jaunty packages:

/etc/apt/apt.conf:

APT::Default-Release "jaunty";

3. apt-get update, apt-get install -d -t karmic grub2

4. Check the correct version was downloaded, then drop the -d to install it

  • Thanks 1
Posted

Im a bit dumb this afternoon...

 

I dont have an apt.conf, ive got a apt.conf.d folder though.

 

Also, what are the karmic repository lines to add to sources.list

 

This is what Ive got for jaunty, do I just add the same but change it to karmic?

deb http://ftp.iinet.net.au/pub/ubuntu/ jaunty main restricted
deb-src http://ftp.iinet.net.au/pub/ubuntu/ jaunty main multiverse universe #Added by software-properties

Posted

apt-get update seems to have added the karmic

 

root@rubuntu:~# apt-get update
...
Hit http://ftp.iinet.net.au karmic Release.gpg
Hit http://ftp.iinet.net.au karmic/main Translation-en_GB
Hit http://ftp.iinet.net.au karmic/restricted Translation-en_GB
...
Hit http://ftp.iinet.net.au karmic/main Packages
Hit http://ftp.iinet.net.au karmic/restricted Packages
Hit http://ftp.iinet.net.au karmic/main Sources
Hit http://ftp.iinet.net.au karmic/multiverse Sources
Hit http://ftp.iinet.net.au karmic/universe Sources

 

root@rubuntu:~# apt-get install -d -t karmic grub2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
grub2 is already the newest version.

 

However

 

root@rubuntu:~# apt-get --reinstall install grub2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 209 not upgraded.
Need to get 8298B of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get: 1 http://ftp.iinet.net.au jaunty/universe grub2 1.96+20080724-12ubuntu2 [8298B]
...

Posted
Aha, I was just looking for this thread. Excellent :)

 

Do you reckon I should take the karmic out my sources.list now? Update manager keeps prompting me to update a whole heap of stuff... Or should I keep it in so that I will receive updated to firefox which Ive installed from the karmic source?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...