LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   8.4. Using GRUB to Set Up the Boot Process Problem please help me !!! (http://www.linuxquestions.org/questions/linux-from-scratch-13/8-4-using-grub-to-set-up-the-boot-process-problem-please-help-me-4175442193/)

princezidane 12-19-2012 01:42 PM

8.4. Using GRUB to Set Up the Boot Process Problem please help me !!!
 
8.4.1. Introduction
When I use this command :
Quote:

root:/sources# cd /tmp &&
> grub-mkrescue --output=grub-img.iso &&
> xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso
Output is:
Quote:

Enabling BIOS support ...
/usr/bin/grub-mkrescue: line 371: xorriso: command not found
8.4.2. GRUB Naming Conventions
When I use this command :
Quote:

root:/tmp# grub-mkdevicemap --device-map=device.map
Output is:
Quote:

bash: grub-mkdevicemap: command not found
When I use this command:
Quote:

root:/tmp# cat device.map
Output is:
Quote:

cat: device.map: No such file or directory
8.4.3. Setting Up the Configuration
Partition that i build LFS is sdb1 type3. What grub.cfc should be?

Thank you for any help!!!
Please help me

stoat 12-19-2012 03:51 PM

For the 8.4.1 question... The grub-mkrescue command depends upon xorriso. Xorriso is not part of LFS, so it has to be installed sort of as a side-project, so-to-speak. Xorriso is in the BLFS book. All of this is stated in 8.4.1. Section 8.4.1 merely creates an emergency boot disk (which everyone should possess anyway) in case you bust your host system's boot loader doing chapter 8. So either install xorriso and create the boot disk according to 8.4.1, or download and burn a Super GRUB 2 Disk (a free and popular emergency boot disk). I recommend against proceeding without possessing (and knowing how to use) a boot disk if you intend to do the grub-install step in chapter 8 (otherwise, it's not too risky to proceed without a boot disk at this time IMO).

For the 8.4.2 question... That stuff is no longer valid. See the LFS 7.2 errata. So you have to skip that. I would just try (hd1,1) in the grub.cfg for /dev/sdb1. It might just work, and it sure won't hurt anything to try.

For the 8.4.3 question... I would use the example in the book and change the set root= command to (hd1,1) and the root= kernel parameter to /dev/sdb1.

My recommendation is NOT to do the grub-install step in chapter 8 at this time. It will replace your host system's boot loader with LFS's which you don't know is even going to boot yet. I would skip the grub-install step for now, create the grub.cfg file, and take the necessary steps to add the LFS system to the boot menu of the host system's boot loader and boot it from there.

princezidane 12-20-2012 01:24 AM

1 Attachment(s)
When I skip 8.1 and 8.2 from you suggestion.

When I done everything until 9.3 after i reboot my system i got this error

http://image.free.in.th/z/iv/jlq11.jpg


Please help me !!!

I dont want start to build LFS from the first pages of the tutorial again....

druuna 12-20-2012 01:37 AM

Quote:

Originally Posted by princezidane (Post 4853458)
When I skip 8.1 and 8.2 from you suggestion.

I do believe stoat said you should skip 8.4 and not 8.1 and 8.2 (8.3?).

8.2 and 8.3 are essential!

Instead of doing 8.4 you need to tell your host to look for new grub entries by executing (from your host, as root):
Code:

update-grub
The above should find the LFS entry and add it.

princezidane 12-20-2012 01:44 AM

Sorry for misunderstand i skip 8.4.1 and 8.4.2 from Stoat advice.

princezidane 12-20-2012 01:56 AM

When I try Druuna suggestion i got the same error.

What is "VFS Cannot open root device 'sdb1' or unknow-block(0,0)" mean?

and How to fix it?

Anyway my grub.cfg is

Quote:

cat > /boot/grub/grub.cfg << "EOF"
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext3
set root=(hd1,1)

menuentry "GNU/Linux, Linux 3.5.2-lfs-7.2" {
linux /boot/vmlinuz-3.5.2-lfs-7.2 root=/dev/sdb1 ro
}
EOF
I build LFS in sdb1 and type of Hdd is ext3. Is this a collect script of grup.cfg for my LFS?

druuna 12-20-2012 01:58 AM

If your problem still remains after you did what I suggested in post #4, please post the following information:

From your host:
- lfs related part from your grub.conf,
- output of fdisk -l /dev/sdb (and point out which partition is used for LFS/swap/??)

From LFS:
- inittab
- fstab

EDIT: Some info was posted while I replied...

princezidane 12-20-2012 02:21 AM

Quote:

Originally Posted by druuna (Post 4853477)
If your problem still remains after you did what I suggested in post #4, please post the following information:

From your host:
- lfs related part from your grub.conf,
- output of fdisk -l /dev/sdb (and point out which partition is used for LFS/swap/??)

From LFS:
- inittab
- fstab

EDIT: Some info was posted while I replied...

If your problem still remains after you did what I suggested in post #4, please post the following information:

From your host:
- lfs related part from your grub.conf,
Quote:

I dont know what is this mean ? sorry.
- output of fdisk -l /dev/sdb (and point out which partition is used for LFS/swap/??)
Quote:

Device Boot Start End Blocks Id System
/dev/sdb1 2048 27265023 13631488 83 Linux
/dev/sdb2 27265024 31457279 2096128 82 Linux swap / Solaris
Quote:

I do all above from LFS not my host because when I write command inittab and fstab in LFS It tell me command not found!!
From LFS:
- inittab
- fstab
Quote:

Both command tell me "command not found" from Both my host and LFS

EDIT: Some info was posted while I replied...

Step I do after 8.2

1.
Quote:

grub-install /dev/sda
2.
Quote:

cat > /boot/grub/grub.cfg << "EOF"
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext3
set root=(hd1,1)

menuentry "GNU/Linux, Linux 3.5.2-lfs-7.2" {
linux /boot/vmlinuz-3.5.2-lfs-7.2 root=/dev/sdb1 ro
}
EOF
3. do until finish 9.2

4.
Quote:

logout
5.
Quote:

update-grub
from your advice

6.
Quote:

umount -v $LFS/dev/pts
umount -v $LFS/dev/shm
umount -v $LFS/dev
umount -v $LFS/proc
umount -v $LFS/sys
umount -v $LFS/usr
umount -v $LFS/home
umount -v $LFS
8.
Quote:

shutdown -r now

druuna 12-20-2012 02:47 AM

Please follow the instructions we posted! If anything is unclear DO NOT just execute commands.

You are still executing commands from 8.4: Do not do any steps from chapter 8.4!!! There is no point in doing these steps if your hosts grub is used. To emphasize: None of the steps from 8.4 should be done. Skip that chapter.

You might have just overwritten your hosts boot loader by executing grub-install /dev/sda........ I'm not sure if the following will work.

As stated in post #4: You need to run the following command from your host as root:
Code:

update-grub
When that command finishes, post the lfs related part from /boot/grub/grub.cfg (on your host!).

inittab and fstab aren't commands but configuration files...........
From LFS post the content of those files!

Make sure you understand what is being done, if you don't you will probably mess up your LFS build and possibly your host.

EDDY1 12-20-2012 02:54 AM

What operating system are you using?
Quote:

From LFS:
- inittab
- fstab
Quote:

Quote:
Both command tell me "command not found" from Both my host and LFS

You can try
Quote:

cat /etc/fstab
cat /etc/inittab

princezidane 12-20-2012 03:06 AM

Quote:

Originally Posted by druuna (Post 4853508)
Please follow the instructions we posted! If anything is unclear DO NOT just execute commands.

You are still executing commands from 8.4: Do not do any steps from chapter 8.4!!! There is no point in doing these steps if your hosts grub is used. To emphasize: None of the steps from 8.4 should be done. Skip that chapter.

You might have just overwritten your hosts boot loader by executing grub-install /dev/sda........ I'm not sure if the following will work.

As stated in post #4: You need to run the following command from your host as root:
Code:

update-grub
When that command finishes, post the lfs related part from /boot/grub/grub.cfg (on your host!).

inittab and fstab aren't commands but configuration files...........
From LFS post the content of those files!

Make sure you understand what is being done, if you don't you will probably mess up your LFS build and possibly your host.

Sorry I am very new for linux and LFS, and Im oversea student so Language is a little problem when i try to study this.
Some chapter i understand and Some i'm not.

1.my inittab

Quote:

# Begin /etc/inittab

id:3:initdefault:

si::sysinit:/etc/rc.d/init.d/rc S

l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016:once:/sbin/sulogin

1:2345:respawn:/sbin/agetty --noclear tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600

# End /etc/inittab
2.fstab

Quote:

# Begin /etc/fstab
# file system mount-point type options dump fsck
# order
/dev/sdb1 / ext3 defaults 1 1
/dev/sdb2 swap swap pri=1 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0

# End /etc/fstab
3. When i use update-grub command from my root system.
This is output:
Quote:

root@princezidane-virtual-machine:/mnt/lfs# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-29-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-29-generic-pae
Found memtest86+ image: /boot/memtest86+.bin
Found Linux From Scratch (7.2) on /dev/sdb1
done
when i use command whereis grub.cfg
output is:
Quote:

grub: /etc/grub.d /usr/lib/grub /usr/share/grub

4.If i dont use command grub-install /dev/sda
When i finished 9.3 Reboot the System, It not boot LFS but it boot my distribution (Ubuntu).

druuna 12-20-2012 03:19 AM

Quote:

Originally Posted by princezidane (Post 4853524)
Sorry I am very new for linux and LFS, and Im oversea student so Language is a little problem when i try to study this.
Some chapter i understand and Some i'm not.

Language can be a problem, but a basic understanding of Linux is assumed (vi. Prerequisites). I doubt if your basic Linux knowledge is sufficient.

Quote:

1.my inittab
This looks OK.

Quote:

2.fstab
This also looks OK.

Quote:

3. When i use update-grub command from my root system.
This is output:
Quote:

root@princezidane-virtual-machine:/mnt/lfs# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-29-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-29-generic-pae
Found memtest86+ image: /boot/memtest86+.bin
Found Linux From Scratch (7.2) on /dev/sdb1
done

That also looks OK, a LFS entry is found (the bold part).

Quote:

4.If i dont use command grub-install /dev/sda
When i finished 9.3 Reboot the System, It not boot LFS but it boot my distribution (Ubuntu).
Like I said before: Forget about the grub-install /dev/sdX command.

When you boot you get a menu with several options, one of those is LFS. Select it (arrow down/up) and press enter.

princezidane 12-20-2012 03:40 AM

1 Attachment(s)
Quote:

Originally Posted by druuna (Post 4853525)
Language can be a problem, but a basic understanding of Linux is assumed (vi. Prerequisites). I doubt if your basic Linux knowledge is sufficient.

This looks OK.

This also looks OK.

That also looks OK, a LFS entry is found (the bold part).

Like I said before: Forget about the grub-install /dev/sdX command.

When you boot you get a menu with several options, one of those is LFS. Select it (arrow down/up) and press enter.

I do following step from your advice.
1. skip 8.3 and do until 9.3

2. When after i restart it has several boot section as you say , but when i choose boot from LFS 7.2 it has the same error .
This photo show a error.

3. Anyway i forgot tell you i skip 7.10 before those step.
Is it make a error to my LFS?

druuna 12-20-2012 03:58 AM

Quote:

Originally Posted by princezidane (Post 4853534)
I do following step from your advice.
1. skip 8.3 and do until 9.3

Sigh......
Who told you to skip 8.3?

Do chapter 8.3, its about your kernel which is rather important. Without it you create all sorts of problems. Fix this first.

Quote:

3. Anyway i forgot tell you i skip 7.10 before those step.
Is it make a error to my LFS?
You can skip 7.10 (Configuring the Linux Console) if you want/need to. It isn't the cause of your error.

princezidane 12-20-2012 04:05 AM

Quote:

Originally Posted by druuna (Post 4853540)
Sigh......
Who told you to skip 8.3?

Do chapter 8.3, its about your kernel which is rather important. Without it you create all sorts of problems. Fix this first.

You can skip 7.10 (Configuring the Linux Console) if you want/need to. It isn't the cause of your error.

sorry i tell you wrong i skip8.4.
What cause of this problem?
To resolve this problem what is chapter that I should to start from it again?(I use vmware and i snapshot when I finished each chapter )

Anyway in chapter 8.2 i skip

Quote:

hdparm -I /dev/sda | grep NCQ
my lfs is in sdb2 type 3.

Can I skip this step or not?


All times are GMT -5. The time now is 06:59 PM.