LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 07-16-2014, 11:29 PM   #1
asarangan
Member
 
Registered: Jul 2009
Posts: 89

Rep: Reputation: 18
Kernel panic when booting off external USB hard drive


I have read a lot of threads about this, but have not been able to solve this problem.

This is Slackware 14.1 (64-bit). I can boot off the installation DVD using a USB-connected DVD drive. Then I installed the system on another USB external hard drive (Toshiba 1TB V73600-C /dev/sda). The boot was installed to MBR with lilo on /dev/sda. The root partition is /dev/sda1. I have done this dozens of time on internal drives and never had any problems. But with this USB drive, it hangs during boot with the infamous "kernel panic - unable to sync". I can't cut and paste the exact error message, but it seems to come right after "switching to clock source tsc".

However, I am able to boot off the install DVD and then mount the USB hard drive. That works. If I poke around dmesg, I see that the USB drive is being recognized only towards the end of the boot process, well after the root device has been mounted. That could be part of the problem, but I am not sure how I can re-sequence the items in the boot process.

This is the only drive in the system. There is another internal drive as well, but I have disabled it in BIOS just to be safe. So my USB drive is being correctly recognized as /dev/sda during the DVD boot.

I am also using Slackware's huge kernel so missing drivers should not be an issue. I have also tried "rootdelay" parameter but that didn't make any difference.

Any help would be appreciated.
 
Old 07-17-2014, 04:33 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
You can't easily disable internal drives by bios. Sometimes linux bypasses it. Remove power or data cable instead.

You can generally change the boot order of hard drives and that allows correct sdx assignment.

Try it again by removing ac to internal drive. Boot to bios and be sure the external drive shows up correctly as a hard drive choice. NOT a usb choice a hard drive choice.
 
Old 07-18-2014, 08:27 AM   #3
asarangan
Member
 
Registered: Jul 2009
Posts: 89

Original Poster
Rep: Reputation: 18
When I disabled the internal drive in BIOS, the external was picked up as /dev/sda. When the internal drive was enabled, the external drive was picked up as /dev/sdb. So I think that part is working as expected. Just for sanity check, I unplugged the internal drive and tried it again, and the results were the same.

As I mentioned, when I boot off the DVD, the usb drive is being recognized only towards the end of the boot, after the root has been mounted. I suspect this is the cause of the problem, but I am not sure how to sequence these items during boot.

Quote:
Originally Posted by jefro View Post
You can't easily disable internal drives by bios. Sometimes linux bypasses it. Remove power or data cable instead.

You can generally change the boot order of hard drives and that allows correct sdx assignment.

Try it again by removing ac to internal drive. Boot to bios and be sure the external drive shows up correctly as a hard drive choice. NOT a usb choice a hard drive choice.
 
Old 07-23-2014, 09:33 PM   #4
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Hard one, are you getting grub form the MBR? Have you checked your kernel arguments? Some research yielded different distros with a similar issue and adding

Quote:
rootdelay=8
fixed it, maybe it isn't full mounted yet for read

Also it might be a pain, but a photo of the screen or manually transcribing the kernel panic message and surrounding info might better assist us in helping you.
 
Old 08-28-2014, 10:56 PM   #5
asarangan
Member
 
Registered: Jul 2009
Posts: 89

Original Poster
Rep: Reputation: 18
Still no success with this install. I suspect it may be the kernel. I just noticed that the default "huge" kernel that comes with Slackware has USB Mass Storage compiled in as a module. That could be the problem. However, if I can't boot with the existing kernel, I can't compile a new one. Anyway I can get a precompiled kernel with built-in USB support? This is 3.10.17.


Quote:
Originally Posted by scheidel21 View Post
Hard one, are you getting grub form the MBR? Have you checked your kernel arguments? Some research yielded different distros with a similar issue and adding



fixed it, maybe it isn't full mounted yet for read

Also it might be a pain, but a photo of the screen or manually transcribing the kernel panic message and surrounding info might better assist us in helping you.
 
Old 08-29-2014, 03:55 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
All distro's should read and mount usb drives or be able to read and mount at end of boot process. Some actually add in extra time to allow usb to settle down.

For the most part a usb external will end up being a normal hard drive to the OS. This assumes a few things. One is that you have correct support and power to the external and the usb hub/chipset to begin with. Two is the support for the speed of the drive. Generally only the newer distro's will support install to usb 3. Three is a bios and board the is properly made to run usb as a bootable media.
 
Old 08-30-2014, 09:06 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member Response

Hi,

What happens when you boot using the Install DVD and passing the boot perimeters to the kernel? Follow instruction on the boot screen;
Code:
Boot: Huge.s root=/dev/Your_Device initrd=ro
If you used a different kernel then use that in the boot line.

Hope this helps.
Have fun & enjoy!
 
Old 08-30-2014, 10:50 PM   #8
asarangan
Member
 
Registered: Jul 2009
Posts: 89

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by onebuck View Post
Hi,

What happens when you boot using the Install DVD and passing the boot perimeters to the kernel? Follow instruction on the boot screen;
Code:
Boot: Huge.s root=/dev/Your_Device initrd=ro
If you used a different kernel then use that in the boot line.

Hope this helps.
Have fun & enjoy!
That didn't work either. But what worked in the end is as follows. May be not all these steps are not necessary, but that is what I did to get it to work. This is on a Slackware distribution.

1. Boot from the installation DVD and install linux on the USB drive. Put this aside for now since it will not boot.
2. Boot from the installation DVD again and install the same linux on an internal drive. This is temporary and can be deleted later.
3. Boot from the internal drive. Then plug in the USB drive and mount as /mnt
4. Run lsmod and identify all modules that might be related to the external USB drive. In my case, I picked everything that had the word USB on it. Recompile the kernel with these modules compiled in rather than as modules (select <*> instead of <M>).
5. Copy the new kernel and System.map from the linux source directory to /mnt/boot/
6. Run chroot /mnt
6. Edit /etc/lilo.conf and add the USB partition and the path to this new kernel. In my case I edited the following entries:
boot = /dev/sdb
image = /boot/bzImage
root = /dev/sdb1
append = "rootdelay=30"
label = Slack32
read-only
Note the rootdelay entry which is not in the default lilo.conf. Then run lilo.
7. Reboot and edit the BIOS to boot to the USB drive. This should now boot to the USB drive. In my case, I noticed a very long list of hex numbers displayed, and the boot took significantly longer than usual (probably 1 minute instead of 15 seconds). dmesg does not show anything meaningful because I think this long list of numbers overwrote the boot messages.
8. The linux installation on the internal drive can now be deleted.
 
Old 08-31-2014, 09:00 AM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member Response

Hi,

I think your method does indicate that a 'initrd' would have solved the issue for the original install since you did compile in the necessary drivers.

Glad to see you were able to get a work around for getting up. That's what Slackers do!
 
Old 08-31-2014, 09:40 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Wow!
 
Old 10-02-2014, 06:04 PM   #11
maciuszek
Member
 
Registered: Nov 2010
Location: Toronto, Ontario
Distribution: Slackware + FreeBSD
Posts: 165

Rep: Reputation: 40
I think this is a good reason to necro this thread.

I found asarangan's post http://www.linuxquestions.org/questi...4/#post5230019, quite helpful and I would like to add:

1. all this (kernel building) can be done in a chroot of your "external" slackware installation, from the install media and no internal temporary install is needed.

2. Instead of playing with bios and boot orders. From the chroot env you can simply install lilo to a temp block. copy it to a file (dd the first 512 bytes to somewhere on your internal disk) and have your existing boot loader (be it the windows one or any other) chainload it.

Last edited by maciuszek; 10-02-2014 at 07:04 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting Linux on an external USB hard drive (not a memory stick, a hard drive) comcastuser Linux - Hardware 4 01-13-2010 06:59 PM
Booting Mandriva2010 from an external usb hard drive intekin Mandriva 2 12-15-2009 07:00 AM
External USB Hard Drive and re-booting coreychch Linux - Hardware 1 04-26-2009 04:36 AM
Booting from external USB Hard drive? ArchAngeL13 Linux - Hardware 3 08-11-2006 03:02 PM
Booting Slackware 10.1 off a USB hard drive, getting a kernal panic asbarrett Slackware - Installation 3 08-10-2006 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration