[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selecting the last partition automatically

From: Harvey Chapman
Subject: Re: Selecting the last partition automatically
Date: Thu, 5 Mar 2009 10:55:08 -0500

On Thu, Mar 5, 2009 at 10:33 AM, Harvey Chapman <address@hidden> wrote:
On Thu, Mar 5, 2009 at 10:18 AM, Felix Zielcke <address@hidden> wrote:
Am Donnerstag, den 05.03.2009, 10:12 -0500 schrieb Harvey Chapman:
> Is there a way to always select the last partition on a disk? I'd like
> to boot the same menu.lst on different machines and I know that I
> always want the last partition on the first disk.
> Is there a way to do this?

No there isn't.

Would it be possible to do it in code kind of like how the "find" command works? That is, use the drive specified and keep calling next_partition() until the last partition is reached? I saw a comment in the code that next_partition() may not be reliable. I'm perfectly willing to modify my local copy of grub to do this, but I wanted to sound the idea off of the existing developers to make sure it is possible. Perhaps I could add a special partition number, '$' (to borrow from regular _expression_ syntax), which could mean last partition?

I figured out how to do what I want without changes. My software always installs itself into the last partition on a disk (even if it has to create the partition). The following worked for me.

# Set root to windows partition (just in case)
root (hd0,0)
# Try to find ours (it could fail)
find --set-root --ignore-floppies /my_loader
# Chainloader (since both use it)
chainloader +1

This works because if my install is corrupted or incomplete it will still boot windows, but otherwise it will boot my partition (which eventually will continue on to boot windows anyway).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]