All of lore.kernel.org
 help / color / mirror / Atom feed
* grub and root=label=
@ 2008-09-08 16:02 Greg White
  2008-09-08 18:18 ` Chris Knadle
  0 siblings, 1 reply; 10+ messages in thread
From: Greg White @ 2008-09-08 16:02 UTC (permalink / raw)
  To: grub-devel


Hi,
 
I was wondering if support for root=label= is coming to grub anytime soon?  I found someone who wrote a patch that did this back in 2004 (http://osdir.com/ml/boot-loaders.grub.bugs/2004-02/msg00105.html).  I really need a way to do root=label WITHOUT an initrd.  I have a portable USB hard drive that I boot on a variety of systems.  Sometimes root is sda, sometimes sdb, or even sdf.  Manually editing the root=line takes time, and more time is spent on figuring out where root is.  I am using grub 0.97 and would be willing to switch to grub 2 if it will help me.  I did try root=LABEL=WD320G in my menu.lst and it didn't work, (I checked the label of the hard drive it is WD320G).
 
Thanks,
_________________________________________________________________
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: grub and root=label=
  2008-09-08 16:02 grub and root=label= Greg White
@ 2008-09-08 18:18 ` Chris Knadle
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Knadle @ 2008-09-08 18:18 UTC (permalink / raw)
  To: The development of GRUB 2

On Monday 08 September 2008 12:02:27 pm Greg White wrote:
> Hi,
>
> I was wondering if support for root=label= is coming to grub anytime soon? 
> I found someone who wrote a patch that did this back in 2004
> (http://osdir.com/ml/boot-loaders.grub.bugs/2004-02/msg00105.html).  I
> really need a way to do root=label WITHOUT an initrd.  I have a portable
> USB hard drive that I boot on a variety of systems.  Sometimes root is sda,
> sometimes sdb, or even sdf.  Manually editing the root=line takes time, and
> more time is spent on figuring out where root is.  I am using grub 0.97 and
> would be willing to switch to grub 2 if it will help me.  I did try
> root=LABEL=WD320G in my menu.lst and it didn't work, (I checked the label
> of the hard drive it is WD320G).

As far as I know, the "root=" line is passed as one of the parameters to the 
booting kernel, so it shouldn't matter what version of Grub you're using.  
For instance, if you're running Linux, look at the Linux kernel documentation 
for the kernel in /Documentation/kernel-paraemeters.txt -- you'll see that 
one of the parameters the kernel takes is the "root=" parameter -- and that 
support is there regardless of you use an initrd image or not.

The label that you need to enter in "root=LABEL=" is the label on the desired 
PARTITION, not the drive's VOLUME label.  'cfdisk' can list the partition 
labels along with the device names on the disk.  For doing a double-check, 
have a look at the 'findfs' command.

  -- Chris

-- 

Chris Knadle
Chris.Knadle@coredump.us



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: grub and root=label=
  2008-09-09 16:00           ` Robert Millan
@ 2008-09-10  0:11             ` Chris Knadle
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Knadle @ 2008-09-10  0:11 UTC (permalink / raw)
  To: The development of GRUB 2

On Tuesday 09 September 2008 12:00:55 pm Robert Millan wrote:
> Unless you're talking about GRUB modules, I think this is a bit off-topic.

   Probably, but it is logical that the discussion started here.

> May I suggest you continue the discussion off the list?  It's quite hard to
> keep track of this list already because of the number of mails.

   No problem.

   -- Chris

-- 

Chris Knadle
Chris.Knadle@coredump.us



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: grub and root=label=
  2008-09-09 15:14         ` Felix Zielcke
@ 2008-09-09 16:00           ` Robert Millan
  2008-09-10  0:11             ` Chris Knadle
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Millan @ 2008-09-09 16:00 UTC (permalink / raw)
  To: The development of GRUB 2


Unless you're talking about GRUB modules, I think this is a bit off-topic.

May I suggest you continue the discussion off the list?  It's quite hard to
keep track of this list already because of the number of mails.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: grub and root=label=
  2008-09-09 15:09       ` Javier Martín
@ 2008-09-09 15:14         ` Felix Zielcke
  2008-09-09 16:00           ` Robert Millan
  0 siblings, 1 reply; 10+ messages in thread
From: Felix Zielcke @ 2008-09-09 15:14 UTC (permalink / raw)
  To: The development of GRUB 2

Am Dienstag, den 09.09.2008, 17:09 +0200 schrieb Javier Martín:

> In order to load modules you have to be root, so don't you think that if
> someone gets to the point he would be able to load modules in your
> server the battle is already lost?

It's a easy way to get a bit more security.
A kernel module can do a bit more then a normal root user process and
more important it can hide things better.
These rootkits could just do something like `rm -rf /' but they mainly
do hiding processes so that this machine can get used for their stuff
too.
Ok they can reboot the machine and load there own kernel, but that's too
obvious.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: grub and root=label=
  2008-09-09 15:01     ` Felix Zielcke
@ 2008-09-09 15:09       ` Javier Martín
  2008-09-09 15:14         ` Felix Zielcke
  0 siblings, 1 reply; 10+ messages in thread
From: Javier Martín @ 2008-09-09 15:09 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

El mar, 09-09-2008 a las 17:01 +0200, Felix Zielcke escribió:
> Am Dienstag, den 09.09.2008, 09:55 -0500 schrieb Greg White:
> 
> 
> > Yes I am compiling my own kernel.  I am compiling everything I need
> > into the kernel.  The policy (written by the previous admin) is to
> > compile everything in as the kernel runs faster and is more secure.
> > There is no =m in the .config only =y or =n.
> 
> I don't know how much speed difference there is but security is true if
> you disable support for loading modules.
> On my own dedicated server I always did it like that though.
In order to load modules you have to be root, so don't you think that if
someone gets to the point he would be able to load modules in your
server the battle is already lost?

[-- Attachment #2: Esta parte del mensaje está firmada digitalmente --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: grub and root=label=
  2008-09-09 14:55   ` Greg White
@ 2008-09-09 15:01     ` Felix Zielcke
  2008-09-09 15:09       ` Javier Martín
  0 siblings, 1 reply; 10+ messages in thread
From: Felix Zielcke @ 2008-09-09 15:01 UTC (permalink / raw)
  To: The development of GRUB 2

Am Dienstag, den 09.09.2008, 09:55 -0500 schrieb Greg White:


> Yes I am compiling my own kernel.  I am compiling everything I need
> into the kernel.  The policy (written by the previous admin) is to
> compile everything in as the kernel runs faster and is more secure.
> There is no =m in the .config only =y or =n.

I don't know how much speed difference there is but security is true if
you disable support for loading modules.
On my own dedicated server I always did it like that though.

But the initrd/initramfs support is totally independent of this.
It should be possible to have a very little initrd which just handles
the LABEL= parameter and nothing more.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: grub and root=label=
  2008-09-09  4:31 ` Chris Knadle
@ 2008-09-09 14:55   ` Greg White
  2008-09-09 15:01     ` Felix Zielcke
  0 siblings, 1 reply; 10+ messages in thread
From: Greg White @ 2008-09-09 14:55 UTC (permalink / raw)
  To: The development of GRUB 2


> On Monday 08 September 2008 9:26:54 pm Greg wrote:
>>>As far as I know, the "root=" line is passed as one of the parameters to
>>>the booting kernel, so it shouldn't matter what version of Grub you're
>>>using. For instance, if you're running Linux, look at the Linux kernel
>>>documentation for the kernel in /Documentation/kernel-paraemeters.txt --
>>>you'll see that one of the parameters the kernel takes is the "root="
>>>parameter -- and that support is there regardless of you use an initrd
>>>image or not.
>>>
>>>The label that you need to enter in "root=LABEL=" is the label on the
>>>desired PARTITION, not the drive's VOLUME label. 'cfdisk' can list the
>>>partition labels along with the device names on the disk. For doing a
>>>double-check, have a look at the 'findfs' command.
>>
>> kernel-parameters.txt:
>> root= [KNL] Root filesystem
>>
>> I know I need the root= parameter. I need a way to point to a label
>> instead of hard coding a dev entry and no initrd.
>
> Are you compiling your own kernel? i.e. what are you doing to get rid of
> the initrd image requirement? I ask because all the popular distributions
> that I know of ship kernels that come with (and require) an initrd image by
> default.

Yes I am compiling my own kernel.  I am compiling everything I need into the kernel.  The policy (written by the previous admin) is to compile everything in as the kernel runs faster and is more secure.  There is no =m in the .config only =y or =n.

> I recently gave a presentation on the subject of compiling the Linux 2.6
> kernel a couple of months ago, and I went into the details of how to build
> the Linux kernel without an initrd image because that's how I like to build
> my own. The video and other talk materials are available.
>
> ftp://ftp.coredump.us/kernel-talk_05-13-2008/

I will look at it this afternoon.

>> I tried root=LABEL=WD320G in menu.lst and it didn't work.
>
> What error do you get? Was it a kernel panic due to not being able to find
> the root filesystem, i.e. "cannot find init"?

VFS: cannot open root device "LABEL=WD320G" on unknown-block(0,0)
please append a correct "root=" boot option
Kernel Panic-not syncing VFS: unable to mount root fs on unknown-block(0,0)
and the caps lock and scroll lock lights flash.

>> I used e2label to label the hard drive.
>
> Okay.
>
>> Here is the output from cfdisk:
>> cfdisk 2.12r
>>
>> Disk Drive: /dev/sdc
>> Size: 250059350016 bytes, 250.0 GB
>> Heads: 255 Sectors per Track: 63 Cylinders: 30401
>>
>> Name Flags Part Type FS Type [Label] Size
>> (MB)
>> ---------------------------------------------------------------------------
>>--- sdc1 Boot Primary Linux ext3 [WD320G] 249637.25
>> sdc2 Primary Linux swap 419.49
>>
>> findfs LABEL=WD320G
>> /dev/sdc1
>
> Good, thanks for including that info -- that looks like it checks out.
>
>> My /etc/fstab looks like this and works:
>> LABEL=WD320G / auto defaults 1 1
>
> Good.
>
>> What did I do wrong?
>
> As far as I can tell the problem is that the kernel you're trying to boot
> doesn't contain the necessary support to find the hard disk. Running 'lsmod'
> on a kernel that does boot properly (assuming said kernel uses an intrd image
> and thus loads drivers as modules) will give you some clues as to what device
> drivers you'll need to build-in to the kernel if you want to boot up without
> an initrd image. Running '/sbin/modinfo ' should give you an
> idea of whether a device driver module is disk related and thus required to
> build-in.

Everything is compiled in.  There are no modules.  Everytime I run a make menuconfig and make a change I do a grep for =m in the .config.
grep '=m' .config

Does it matter if I am compiling kernel 2.6.21.7?  I know it is an old kernel, but it is what I must work with.

>> Thanks,
>>
>> PS I know the drive is 250GB but labeled 320G.
>
> Is it? I didn't notice....
>
>> And sorry for the other post with the wrong subject.
>
> Thanks for reposting with the right subject.
>
> -- Chris
>
> --
>
> Chris Knadle
> Chris.Knadle@coredump.us

_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: grub and root=label=
  2008-09-09  1:26 Greg White
@ 2008-09-09  4:31 ` Chris Knadle
  2008-09-09 14:55   ` Greg White
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Knadle @ 2008-09-09  4:31 UTC (permalink / raw)
  To: The development of GRUB 2

On Monday 08 September 2008 9:26:54 pm Greg White wrote:
> >As far as I know, the "root=" line is passed as one of the parameters to
> >the booting kernel, so it shouldn't matter what version of Grub you're
> >using.  For instance, if you're running Linux, look at the Linux kernel
> >documentation for the kernel in /Documentation/kernel-paraemeters.txt --
> >you'll see that one of the parameters the kernel takes is the "root="
> >parameter -- and that support is there regardless of you use an initrd
> >image or not.
> >
> >The label that you need to enter in "root=LABEL=" is the label on the
> >desired PARTITION, not the drive's VOLUME label.  'cfdisk' can list the
> >partition labels along with the device names on the disk.  For doing a
> >double-check, have a look at the 'findfs' command.
>
> kernel-parameters.txt:
> root=		[KNL] Root filesystem
>
> I know I need the root= parameter.  I need a way to point to a label
> instead of hard coding a dev entry and no initrd.

   Are you compiling your own kernel?  i.e. what are you doing to get rid of 
the initrd image requirement?  I ask because all the popular distributions 
that I know of ship kernels that come with (and require) an initrd image by 
default.

   I recently gave a presentation on the subject of compiling the Linux 2.6 
kernel a couple of months ago, and I went into the details of how to build 
the Linux kernel without an initrd image because that's how I like to build 
my own.  The video and other talk materials are available.

     ftp://ftp.coredump.us/kernel-talk_05-13-2008/

> I tried root=LABEL=WD320G in menu.lst and it didn't work.

   What error do you get?  Was it a kernel panic due to not being able to find 
the root filesystem, i.e. "cannot find init"?

> I used e2label to label the hard drive.

   Okay.

> Here is the output from cfdisk:
>                                   cfdisk 2.12r
>
>                               Disk Drive: /dev/sdc
>                        Size: 250059350016 bytes, 250.0 GB
>              Heads: 255   Sectors per Track: 63   Cylinders: 30401
>
>     Name        Flags      Part Type  FS Type          [Label]        Size
> (MB)
> ---------------------------------------------------------------------------
>--- sdc1        Boot        Primary   Linux ext3       [WD320G]    249637.25
> sdc2                       Primary   Linux swap                   419.49
>
> findfs LABEL=WD320G
> /dev/sdc1

   Good, thanks for including that info -- that looks like it checks out.

> My /etc/fstab looks like this and works:
> LABEL=WD320G / auto defaults 1 1

   Good.

> What did I do wrong?

   As far as I can tell the problem is that the kernel you're trying to boot 
doesn't contain the necessary support to find the hard disk.  Running 'lsmod' 
on a kernel that does boot properly (assuming said kernel uses an intrd image 
and thus loads drivers as modules) will give you some clues as to what device 
drivers you'll need to build-in to the kernel if you want to boot up without 
an initrd image.  Running '/sbin/modinfo <module_name>' should give you an 
idea of whether a device driver module is disk related and thus required to 
build-in.

> Thanks,
>
> PS I know the drive is 250GB but labeled 320G.

   Is it?  I didn't notice....

> And sorry for the other post with the wrong subject.

   Thanks for reposting with the right subject.

   -- Chris

-- 

Chris Knadle
Chris.Knadle@coredump.us



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: grub and root=label=
@ 2008-09-09  1:26 Greg White
  2008-09-09  4:31 ` Chris Knadle
  0 siblings, 1 reply; 10+ messages in thread
From: Greg White @ 2008-09-09  1:26 UTC (permalink / raw)
  To: grub-devel


>As far as I know, the "root=" line is passed as one of the parameters to 
>the booting kernel, so it shouldn't matter what version of Grub you're 
>using.  For instance, if you're running Linux, look at the Linux kernel 
>documentation for the kernel in /Documentation/kernel-paraemeters.txt -- 
>you'll see that one of the parameters the kernel takes is the "root=" 
>parameter -- and that support is there regardless of you use an initrd 
>image or not.
>
>The label that you need to enter in "root=LABEL=" is the label on the 
>desired PARTITION, not the drive's VOLUME label.  'cfdisk' can list the 
>partition labels along with the device names on the disk.  For doing a 
>double-check, have a look at the 'findfs' command.
 
kernel-parameters.txt:
root=		[KNL] Root filesystem
 
I know I need the root= parameter.  I need a way to point to a label instead of hard coding a dev entry and no initrd.
 
I tried root=LABEL=WD320G in menu.lst and it didn't work.  I used e2label to label the hard drive.
 
Here is the output from cfdisk:
                                  cfdisk 2.12r
 
                              Disk Drive: /dev/sdc
                       Size: 250059350016 bytes, 250.0 GB
             Heads: 255   Sectors per Track: 63   Cylinders: 30401
 
    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    sdc1        Boot        Primary   Linux ext3       [WD320G]    249637.25
    sdc2                       Primary   Linux swap                         419.49
 
findfs LABEL=WD320G
/dev/sdc1
 
My /etc/fstab looks like this and works:
LABEL=WD320G / auto defaults 1 1
aufs / aufs defaults 0 0 # AutoUpdate
devpts /dev/pts devpts gid=5,mode=620 0 0 # AutoUpdate
proc /proc proc defaults 0 0 # AutoUpdate
sysfs /sys sysfs defaults 0 0 # AutoUpdate
 
What did I do wrong?  
 
Thanks,
 
PS I know the drive is 250GB but labeled 320G.  And sorry for the other post with the wrong subject.
_________________________________________________________________
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-09-10  0:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-08 16:02 grub and root=label= Greg White
2008-09-08 18:18 ` Chris Knadle
2008-09-09  1:26 Greg White
2008-09-09  4:31 ` Chris Knadle
2008-09-09 14:55   ` Greg White
2008-09-09 15:01     ` Felix Zielcke
2008-09-09 15:09       ` Javier Martín
2008-09-09 15:14         ` Felix Zielcke
2008-09-09 16:00           ` Robert Millan
2008-09-10  0:11             ` Chris Knadle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.