Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-05-2010, 01:36 AM
|
#1
|
|
LQ Newbie
Registered: Oct 2008
Posts: 7
Rep:
|
Getting output from GRUB during boot from USB key
So, I have a home-brewed Linux system that I've installed on a USB key. I'm plugging this into a laptop. I can tell from what is going on that it has successfully loaded the kernel and is running the shell script that is specified on the "kernel" line in the GRUB configuration. But... although I can get output from printk() calls in the kernel just fine, I get nothing from "echo" commands (or any other commands) in the initialization shell script. I can see that the commands are being run, but the output is just disappearing into the void.
This is problematic because there are other problems, but I can't get debug output to track those down...
Given that printk() output goes to the laptop screen as expected, it seems that GRUB must be sending other output to something other than the console, yet the grub.conf configuration is quite simple:
default=0
timeout=0
title Test
root (hd0,0)
kernel /boot/vmlinuz ro root=/dev/ram init=/linuxrc ramdisk_size=16384
initrd /boot/initrd.gz
savedefault
Any hints about what I'm missing? Thanks!
|
|
|
|
10-05-2010, 05:15 AM
|
#2
|
|
LQ Veteran
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
|
If it is on a usb key it would not be
root (hd0,0)
it would be root (hdx,0) x being the number fdisk lists as the usb drive.
To be able to help more you need to tell us which version of grub you are using by the command grub-install -v and the results of fdisk -l from terminal using an installed distro or a live cd.
Last edited by Larry Webb; 10-05-2010 at 05:16 AM.
|
|
|
|
10-05-2010, 09:06 PM
|
#3
|
|
LQ Newbie
Registered: Oct 2008
Posts: 7
Original Poster
Rep:
|
Good catch! But it seems there is something else going on. First, though, here's the information you asked about:
--------------------
[root@wedge ~]# grub-install -v
grub-install (GNU GRUB 0.97)
[root@wedge ~]# fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000f09af
Device Boot Start End Blocks Id System
/dev/sda1 * 1 51 409600 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 51 561 4096000 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3 561 816 2048000 83 Linux
Partition 3 does not end on cylinder boundary.
/dev/sda4 816 19457 149734721 83 Linux
Disk /dev/dm-1: 153.3 GB, 153326285824 bytes
255 heads, 63 sectors/track, 18640 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/dm-2: 21.0 GB, 20971520000 bytes
255 heads, 63 sectors/track, 2549 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe8070000
Disk /dev/dm-2 doesn't contain a valid partition table
Disk /dev/dm-3: 8388 MB, 8388608000 bytes
255 heads, 63 sectors/track, 1019 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x08020000
Disk /dev/dm-3 doesn't contain a valid partition table
Disk /dev/dm-4: 83.9 GB, 83886080000 bytes
255 heads, 63 sectors/track, 10198 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe8070000
Disk /dev/dm-4 doesn't contain a valid partition table
Disk /dev/dm-5: 21.0 GB, 20969451520 bytes
255 heads, 63 sectors/track, 2549 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-5 doesn't contain a valid partition table
Disk /dev/dm-0: 83.9 GB, 83884011520 bytes
255 heads, 63 sectors/track, 10198 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-6: 2095 MB, 2095083520 bytes
255 heads, 63 sectors/track, 254 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x65f47968
Disk /dev/dm-6 doesn't contain a valid partition table
Disk /dev/dm-7: 8388 MB, 8388079616 bytes
255 heads, 63 sectors/track, 1019 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-7 doesn't contain a valid partition table
Disk /dev/sdb: 4009 MB, 4009754624 bytes
124 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7688 * 512 = 3936256 bytes
Disk identifier: 0xc3072e18
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 7 26907+ 83 Linux
/dev/sdb2 8 1018 3886284 83 Linux
--------------------
/dev/sda is the hard disk on the laptop. /dev/sdb is the USB key. Since the laptop normally boots off of /dev/sda1 and that's referred to as (hd0,0), I changed the root command on the USB key to (hd1,0) to boot from /dev/sdb1.
But strangely, it doesn't seem to matter. Regardless of the hdX number I use, the result is the same. It tries to boot using the kernel on the USB key, and while I get printk() output from the kernel, there's nothing from the system init program. Also no GRUB menu, or anything like that. All I get is
GRUB loading stage2
Some prink() output that I put in the kernel for debugging
The init program (a shell script) starts
Kernel panic when the script aborts
To debug the abort, I need to see what is going on as the script runs. But I get no console output from "echo" or any of the other commands that I put into the script, so I'm stuck.
|
|
|
|
10-05-2010, 11:21 PM
|
#4
|
|
LQ Veteran
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
|
Which linux distro do you have on the usb? Can you boot your distro on the internal drive? Are there any error codes when trying to boot the usb?
|
|
|
|
10-06-2010, 11:48 PM
|
#5
|
|
LQ Newbie
Registered: Oct 2008
Posts: 7
Original Poster
Rep:
|
The USB has the home-grown system on it, so it's not running any distribution per se (except itself!). It boots fine when I copy the system to a compact flash card and use it as an embedded operating system on a generic single-board computer, but for some reason the USB key is giving me troubles.
The main difference is that the single-board computer has neither a keyboard nor a display, so the console is a serial port. To get that working, however, I have to add "serial" and "terminal" commands to the GRUB configuration. I deleted those from the GRUB configuration for the USB, hoping that it would default to the laptop's own keyboard and display, but it didn't seem to help.
There are no (visible) error codes when booting from the USB key. Eventually there is a kernel panic, but this occurs well into the init program. The fact that it is able to run the kernel, start the init program, and get partway through it all seems to indicate that the bootstrap process is works OK. I just can't get output from anything except the kernel. Weird.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:58 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|