Kexec with Live USB/CD


 
Thread Tools Search this Thread
Operating Systems Linux Kexec with Live USB/CD
# 1  
Old 11-19-2010
Kexec with Live USB/CD

Hello

Recently I found this (for me) really usefull tool kexec which can load a new Kernel while running one.
I tested it some times with the same kernel I was running, "rebooting" the system without powering it off at any time Smilie
But I need kexec basically just for live usbs. I want to start a live USB within my running Linux, what works, but at one point it "exits" the loading process and give me a BusyBox...
It's something like
Code:
[xxxx] loading blablabla USB-Keyboard blablabla.
ALERT! does not exist. Returning to a shell.
BusyBox vX.xx
(initramfs)

I used this to load the kernel into kexec:
Code:
kexec -l /media/usb/casper/vmlinuz --append="ro root=/dev/sdb1" --initrd="/media/usb/casper/initrd" --ramdisk="/media/usb/casper/initrd --real-mode -d
kexec -d -e

This was working with the kernel on the main HDD that I was running, but won't work with my live-usb...

The idea behind that is that I want to check if the right USB-Stick is plugged in (checking UUID), then boot it and install the new system. Didn't get it to work over grub 2 and booting it with the BIOS isn't what I want (I want to boot one specific stick and not a hundreds others).

Anyone knows why it gives the the ALERT! ?
Thanks in advance! Smilie
greetz, alex
# 2  
Old 11-19-2010
Knowing what "blablabla" actually said would be really, really useful. But if I had to guess?

There's a delay of 5 seconds between Linux detecting a USB storage device and Linux making it available, to let it "settle"(most USB doesn't need this, some really badly-behaved ones do); so it may be trying to mount devices that don't exist yet. Try adding rootdelay=10 to the kernel commandline, which will make it wait a bit. This parameter was created specifically for USB booting as I understand it.

Or if usb-storage is loaded in the initrd instead of being a builtin, you might add your own delay of a few seconds after there somewhere with sleep.

And it may also be that your USB kernel and your running one just don't agree on which device is which, especially since the order of module-loading can easily change it, and/or your USB kernel may not have detected your main disks at all depending on its configuration. For this reason you should be handling UUID inside the initrd, not outside it! When it crashes to the busybox prompt, try mounting sysfs on /sys/ to see what's in /sys/class/block/. That's your window into kernel block devices.

Last edited by Corona688; 11-19-2010 at 01:01 PM..
# 3  
Old 11-19-2010
Quote:
Originally Posted by Corona688
Knowing what "blablabla" actually said would be really, really useful. But if I had to guess?

There's a delay of 5 seconds between Linux detecting a USB storage device and Linux making it available, to let it "settle"(most USB doesn't need this, some really badly-behaved ones do); so it may be trying to mount devices that don't exist yet. Try adding rootdelay=10 to the kernel commandline, which will make it wait a bit. This parameter was created specifically for USB booting as I understand it.

Or if usb-storage is loaded in the initrd instead of being a builtin, you might add your own delay of a few seconds after there somewhere with sleep.

And it may also be that your USB kernel and your running one just don't agree on which device is which, especially since the order of module-loading can easily change it, and/or your USB kernel may not have detected your main disks at all depending on its configuration. For this reason you should be handling UUID inside the initrd, not outside it! When it crashes to the busybox prompt, try mounting sysfs on /sys/ to see what's in /sys/class/block/. That's your window into kernel block devices.
Thanks!
Will try that! Smilie
The blablabla wasn't anything related, just some devices he found...

Last edited by al0x; 11-29-2010 at 08:24 AM..
# 4  
Old 11-19-2010
Quote:
Originally Posted by al0x
The blablabla wasn't anything related, just some devices he found...
What devices it finds (or doesn't find) seems quite related to me! Smilie And the message might possibly mean something different than you think it means, but I can't tell that if you omit it or rephrase it according to your understanding of it. I know you can't copy/paste from a crashed terminal prompt, but still; paraphrased error messages are a big pet peeve of mine.

Last edited by Corona688; 11-19-2010 at 01:39 PM..
# 5  
Old 11-19-2010
Quote:
Originally Posted by Corona688
What devices it finds (or doesn't find) seems quite related to me! Smilie And the message might possibly mean something different than you think it means, but I can't tell that if you omit it or rephrase it according to your understanding of it. I know you can't copy/paste from a crashed terminal prompt, but still; paraphrased error messages are a big pet peeve of mine.
Yeah ok, maybe it does Smilie
But I can't tell you anything new until monday :/ And I can't test it until mondey Smilie
And btw thanks for helping me again Corona Smilie

Last edited by al0x; 11-19-2010 at 03:12 PM..
# 6  
Old 11-29-2010
Finally I got time to test your suggestion.
But it doesn't change anything, it's still dropping to the BusyBox.
Here's everything I'm getting:
Code:
[     2.425343] generic-usb 0003:0603:00F2.0002: input,hiddev96,hidraw1: USB HID v1.10 Device [NOVATEK USB Keyboard] on usb-0000:00:06.0-1.1/input1
[     2.425417] usbcore: registered new interface driver usbhid
[     2.425427] usbhid: v2.6:USB HID core driver
[     2.428139] [drm] nouveau 000:03:00.0: 0x1191: parsing clock script 0
[     2.429200] Console: switching to colour frame buffer device 160x64
[     2.457653] usb 4-1.2: new low speed USB device using ohci_hcd and address 4
[     2.578848] usb 4-1.2: configuration #1 chosen from 1 choice
[     2.591682] input: Logitech USB-PS/1 Optical Mouse as /devices/pci000:00/000:00:06.0/usb4/4-1/4-1.2/4-1.2:1.0/input/input5
[     2.592047] generic-usb 0003:046D:C050.0003: input,hidraw2: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:06.0-1.2/input0
[     2.670624] usb 4-1.3: new low speed USB device using ohci_hcd and address 5
ALERT! does not exist. Dropping to a shell!


BusyBox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu11) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) _

There shouldn't be any typos...
Thanks for an answer! Smilie
# 7  
Old 11-29-2010
Wow, "ALERT! does not exist" has to be the most useless error message I've ever heard. Smilie You have my sympathies.

Do you know what script produces that? Look inside that script and see what it was looking for. Maybe it's expecting some previously unknown variable and not getting it. Maybe it's supposed to print something between alert and does...

Please also review my earlier suggestions. looking in /sys/, fiddling with rootdelay, putting in sleep, etc. I'd add to that, building usb-storage into the kernel instead of making it a module.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

Update: UserCP Screeching Frog 0.7641 - Changed Live Chat to Live Updates

Update: UserCP Screeching Frog 0.7641 - Changed Live Chat to Live Updates In this version of the UserCP, I have changed "Live Chat" to "Live Updates" by disabling the ability to post in the "live chat" area and changed the name to "Live Updates" The reason for this change is that experienced... (6 Replies)
Discussion started by: Neo
6 Replies

2. Solaris

Solaris 11 install via live usb

Hello All, I am attempting to boot and install Solaris 11 via live USB on a HP DL580 Gen9 Server. Unfortunately, when I do this it boots into System Maintenance Mode. The attachment (Pic1) shows what I am seeing via the console. The BIOS is in UEFI boot. Does not work on legacy mode as I... (15 Replies)
Discussion started by: Kerbi
15 Replies

3. Solaris

Usbcopy fails with the error message sol-11_1-live-x86.usb is not a multiple of 512

I am trying to create a live image of solaris 11.1. I have used #pkg image-update to upgrade from 11 to 11.1 already. (since only 11.1 can make images of 11.1 due to using new grub) then from within 11.1 I used pkg install install distribution-constructor to get latest usbcopy that should be... (1 Reply)
Discussion started by: taltamir
1 Replies

4. BSD

Freebsd live usb

Hello. I'm going to make freebsd live usb based on FreeBSD-8.3-RELEASE-i386-livefs.iso. The iso is 257 Megabytes, but after i copy its content to usb drive its volume increases to 971 Megabytes. I tried different methods of copying (tar,cp,cpio) but with the same result. Could anyone help? (0 Replies)
Discussion started by: urello
0 Replies

5. UNIX for Dummies Questions & Answers

kcore and a live persistent linux usb distro

I have 2 computers, from now on i shall call these computers A and B. Made a live linux distro (bodhi) on A which has 1GB internal memory , because windows is unstable on B, which has 512MB internal memory. I mean with memory the internal memory of the computer, not the memory of the usb... (0 Replies)
Discussion started by: anno
0 Replies

6. Red Hat

How to install fedora 13 from a usb media....it should not like 'live'?

im using Dell Inspiron with windows 7 as operating system.....in my hard drive there is some 34 gb unpartitioned space and now i want to install fedora 13 into it, after installation it should be dual boot. problem here is... i have the fedora 13 image file ie fedora13-i386-DVD.iso file. ... (13 Replies)
Discussion started by: karthik437
13 Replies

7. UNIX for Dummies Questions & Answers

USB-USB cable between linux and windows computers

Is there an easy way to setup a cross-over cable (USB-USB) between a linux box and a windows PC? My 2 machines are next to each other but I really do not want to keep transfering my files using my USB drive. Thanks! (4 Replies)
Discussion started by: Xterra
4 Replies

8. UNIX for Dummies Questions & Answers

From Knoppix Live-USB to Old-school CLI Debian Linux.

Alright. Here we go... The other day, I was referred to this neat little command-line Unix simulator called Cygwin. To put it lightly, I fell in love. I found Knoppix, and from what I can tell, it's a viable OS once I strip off the KDE desktop environment to make it 'old-school'. I'm... (2 Replies)
Discussion started by: dev_squid
2 Replies

9. Linux

Live Knoppix on usb sdb2 kernel not found

Hi all I have a usb external drive with two partitions sdb1 ntfs and sdb2 ext3 with label Linux I copied a knoppix live distro in the second partition, then I installed grub on the drive. Now in the directory /media/sdb2/boot/grub i have the file device.map with the following content: (hd0) ... (4 Replies)
Discussion started by: guast
4 Replies
Login or Register to Ask a Question

Featured Tech Videos