Re: Explanation about grub's search command in chapter 8.4 of lfs book is wrong

2010-06-30 Thread splotz90


I think the search line makes sense ... I tried to explain it in my last 
comment (http://wiki.linuxfromscratch.org/lfs/ticket/2698#comment:6):


GRUB can boot if the device has changed (for example hd0,1 --> hd1,1) or 
if a new filesystem was created (--> the UUID has changed).



My suggestion: "With help of the search line, GRUB is able to boot even 
if the boot device has changed."
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Explanation about grub's search command in chapter 8.4 of lfs book is wrong

2010-07-01 Thread splotz90
  Am 01.07.2010 05:17, schrieb Bruce Dubbs:
> I'll ask the question again. How is search useful in an LFS 
> environment where we don't have initrd available?
As I already said:

The search command is only useful if we're using a seperate boot 
partition ...

With help of the search line, GRUB can find the boot partition, even if 
the device of the boot partition has changed (for example /dev/sda3 --> 
/dev/sda4).
After that, GRUB will boot the kernel. The kernel can mount the root 
partition.

If the device of the root partition has changed (for example /dev/sda1 
--> /dev/sda2) the boot process will fail (the kernel won't be able to 
boot the root partition).

But we have to use a LABEL or UUID entry for the boot partition in 
/etc/fstab (if we're using something like /dev/sda1 if fstab, the mount 
of the boot partition will fail).


This means: If the LFS-User changes the device for the boot partition, 
the system will still boot (with help of the search line).

So I suggest that we are writing the following:


"The search lines are only meaningful for LFS systems if a separate boot 
partition and a LABEL or UUID entry for this partition in /etc/fstab is 
used."



I think, I've started a big discussion with just one small ticket ;-)
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Explanation about grub's search command in chapter 8.4 of lfs book is wrong

2010-07-01 Thread splotz90
  Am 01.07.2010 08:24, schrieb splotz90:
>  Am 01.07.2010 05:17, schrieb Bruce Dubbs:
>> I'll ask the question again. How is search useful in an LFS 
>> environment where we don't have initrd available?
> As I already said:
>
> The search command is only useful if we're using a seperate boot 
> partition ...
>
> With help of the search line, GRUB can find the boot partition, even 
> if the device of the boot partition has changed (for example /dev/sda3 
> --> /dev/sda4).
> After that, GRUB will boot the kernel. The kernel can mount the root 
> partition.
>
> If the device of the root partition has changed (for example /dev/sda1 
> --> /dev/sda2) the boot process will fail (the kernel won't be able to 
> boot the root partition).
>
> But we have to use a LABEL or UUID entry for the boot partition in 
> /etc/fstab (if we're using something like /dev/sda1 if fstab, the 
> mount of the boot partition will fail).
>
>
> This means: If the LFS-User changes the device for the boot partition, 
> the system will still boot (with help of the search line).
>
> So I suggest that we are writing the following:
>
>
> "The search lines are only meaningful for LFS systems if a separate 
> boot partition and a LABEL or UUID entry for this partition in 
> /etc/fstab is used."
>
>
>
> I think, I've started a big discussion with just one small ticket ;-)

There are some mistakes in my mail ...

"the kernel won't be able to boot the root partition" --> "boot" should 
be "mount"
"If the LFS-User changes the device for the boot partition" --> "for" 
should be "of"
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Explanation about grub's search command in chapter 8.4 of lfs book is wrong

2010-07-01 Thread splotz90
  Am 01.07.2010 09:27, schrieb Nathan Coulson:
> On Wed, Jun 30, 2010 at 11:24 PM, splotz90  wrote:
>>   Am 01.07.2010 05:17, schrieb Bruce Dubbs:
>>> I'll ask the question again. How is search useful in an LFS
>>> environment where we don't have initrd available?
>> As I already said:
>>
>> The search command is only useful if we're using a seperate boot
>> partition ...
>>
>> With help of the search line, GRUB can find the boot partition, even if
>> the device of the boot partition has changed (for example /dev/sda3 -->
>> /dev/sda4).
>> After that, GRUB will boot the kernel. The kernel can mount the root
>> partition.
>>
>> If the device of the root partition has changed (for example /dev/sda1
>> -->  /dev/sda2) the boot process will fail (the kernel won't be able to
>> boot the root partition).
>>
>> But we have to use a LABEL or UUID entry for the boot partition in
>> /etc/fstab (if we're using something like /dev/sda1 if fstab, the mount
>> of the boot partition will fail).
> no you dont.  / is already mounted.  If you say it's in /dev/sdz65,
> it'll be fine.
>
> After it boots (when it hits the bootscripts),
> /etc/rc.d/init.d/checkfs has a "mount / -o remount,ro'.  It does not
> parse /etc/fstab as / is already mounted
>
> Next time, fstab is used is in mountfs.  This is where LABEL or UUID
> is useful for all partitions "except" /.
>
> Infact, if you boot with root=/bin/bash,  / is still mounted, and
> /etc/fstab will never have been read
>
>> This means: If the LFS-User changes the device for the boot partition,
>> the system will still boot (with help of the search line).
>>
>> So I suggest that we are writing the following:
>>
>>
>> "The search lines are only meaningful for LFS systems if a separate boot
>> partition and a LABEL or UUID entry for this partition in /etc/fstab is
>> used."
> /etc/fstab is only useful "after" / is mounted.  so I would remove the
> part that says "separate boot partition and a LABEL or UUID entry for
> this partition in /etc/fstab is used."  (the rest of the sentence does
> not stand well on it's own though).
>
> the linux kernel has to mount something as /  and all it has to work
> with are (a) root=, or (b) the drive/partition# embedded at
> compiletime.
>
>> I think, I've started a big discussion with just one small ticket ;-)
>
>
I think you've understood me wrong ...

Here is an example:

/dev/sda1 --> LFS-system ( / partition)
/dev/sda2 --> unformatted partition
/dev/sda3 --> boot partition ( /boot)

the fstab:

...
/dev/sda1 /ext3defaults11
/dev/sda3/bootext3defaults11
...

If the LFS-user decides to delete the unused partition (/dev/sda2) we 
will have the following:

/dev/sda1 --> LFS-system ( / partition)
/dev/sda2 --> boot partition ( /boot)

But if we are still using /dev/sda3 for /boot in fstab, the mount of the 
boot partition will fail (/dev/sda3 doesn't exist anymore).

This fstab would be better:

...
/dev/sda1 
 /ext3defaults11

# boot partition:
UUID=03b77228-ed4c-4218-910e-11b9f77c4b46/bootext3
defaults11
...

I don't want to use a UUID for / in the fstab ...

Sebastian
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Explanation about grub's search command in chapter 8.4 of lfs book is wrong

2010-07-01 Thread splotz90
  Am 01.07.2010 11:09, schrieb HouHongxun:
> Even though /boot is a separate partition, we don't need to mount it.

Ok, so we say "The search lines are only meaningful for LFS systems if a 
separate boot partition is used." ?
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Explanation about grub's search command in chapter 8.4 of lfs book is wrong

2010-07-02 Thread splotz90
  Am 01.07.2010 22:29, schrieb Andrew Benton:
> Which partition will grub choose?

I think that I've found the answer ...

Have a look at 
http://www.gnu.org/software/grub/manual/html_node/install.html

I know that it is a GRUB Legacy documentation, but I think that GRUB 2 
works in a similarly way.

If I understood that right, the success of the GRUB Legacy boot process 
depends on the configuration
of the second stage. So we can't say "The search lines are only 
meaningful for LFS systems if a separate
boot partition is used.".

What about "The search line is not required on a typical LFS system." 
suggested by linux fan?
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Explanation about grub's search command in chapter 8.4 of lfs book is wrong

2010-07-02 Thread splotz90
  Am 01.07.2010 23:11, schrieb linux fan:
> My understanding (from experimentation and documentation) is that the
> UUID is specifically generated for a specific file system. You would
> need to use dd or similar utility to move the filesystem to a
> different partition if you wished to preserve the UUID. If that is the
> case, it may do what was claimed.

Yes, and the UUID is preserved if just delete a partition:

Before:

/dev/sda1 --> LFS-system ( / partition)
/dev/sda2 --> unformatted partition; will be deleted
/dev/sda3 --> boot partition ( /boot)

After:

/dev/sda1 --> LFS-system ( / partition)
/dev/sda2 --> boot partition ( /boot)

The boot partition will have the same UUID as before, because
file system wasn't modified.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Explanation about grub's search command in chapter 8.4 of lfs book is wrong

2010-07-02 Thread splotz90
  Am 02.07.2010 09:44, schrieb splotz90:
>Am 01.07.2010 23:11, schrieb linux fan:
>> My understanding (from experimentation and documentation) is that the
>> UUID is specifically generated for a specific file system. You would
>> need to use dd or similar utility to move the filesystem to a
>> different partition if you wished to preserve the UUID. If that is the
>> case, it may do what was claimed.
> Yes, and the UUID is preserved if just delete a partition:
>
> Before:
>
> /dev/sda1 -->  LFS-system ( / partition)
> /dev/sda2 -->  unformatted partition; will be deleted
> /dev/sda3 -->  boot partition ( /boot)
>
> After:
>
> /dev/sda1 -->  LFS-system ( / partition)
> /dev/sda2 -->  boot partition ( /boot)
>
> The boot partition will have the same UUID as before, because
> file system wasn't modified.

I know that the filesystem itself wasn't moved ...
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Explanation about grub's search command in chapter 8.4 of lfs book is wrong

2010-07-02 Thread splotz90
  Am 01.07.2010 22:29, schrieb Andrew Benton:
> Which partition will grub choose?
I have found some additional information about that:

http://www.linuxquestions.org/questions/linux-software-2/how-does-grub2-find-the-grub-cfg-file-794560/

The "grub-setup" command seems to add an information where to find the 
grub.cfg right after the MBR.


Sebastian
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page