Why does Xubuntu boot into busybox when started from USB flash drive?

Asked by Vincent on 2008-04-19

I'm trying to get Xubuntu run from my USB flash drive. I've already done it many times before, but somehow, I can no longer get it to work - not even for Gutsy, which I've done before, let alone Hardy.

I partitioned my flash drive to have a casper-rw partition and one to hold the required files extracted from the LiveCD, created syslinux.cfg and ran syslinux on the drive.

When I boot, I get the menu with the option I added to "Start Xubuntu in persistent mode". However, when I select that it extracts the live environment but then ends up in a busybox prompt instead of a live desktop:

Busybox v1.1.3 (Debian 1:1.1.3-5ubuntu1) built-in shell (ash)
Enter 'help' for list of built-in commands

(initramfs)

When I remove "quiet splash" from the boot options and add "debug", I find that the following lines are displayed a lot of times on screen before ending up at this shell:

kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
ISO 9660 Extensions: Microsoft Joliet Level 3
ISOFS: changing to secondary root

Any help would be greatly appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu busybox Edit question
Assignee:
No assignee Edit question
Solved by:
psypher
Solved:
2008-04-29
Last query:
2008-04-29
Last reply:
2008-04-28
Harvey Muller (hlmuller) said : #1

Vincent,

I experienced the same problem when I began converting LiveCDs to LiveUSBs. What was causing my problem is I was copying the contents of the LiveCD iso using:

    cp /iso/path/* /media/usbflash/

After listing the contents of the iso with:

    ls -a /iso/path

I learned that there was a hidden directory, .disk, that had to be copied over as well. I now use the following command:

    cp /iso/path/* /iso/path/.disk /media/usbflash/

Please report back here and let me know if this solves your question, or if you require further information.

Thanks,

Harvey

Vincent (vinnl) said : #2

Hi Harvey,

Unfortunately, that's not it. I used the following command:

cp -R casper dists install pics pool preseed .disk md5sum.txt README.diskdefines isolinux/* casper/vmlinuz casper/initrd.gz install/mt86plus /media/XubuntUSB

Yesterday I recalled that, indeed, the .disk directory might not have been copied over (I'm not that into the command line so I don't know how it deals with hidden files and folders) so to be sure, I copied it over manually. It still didn't boot...

Harvey Muller (hlmuller) said : #3

Vincent,

I've not tried the Xubuntu iso. I'll give it a shot in the morning, and report back here.

Harvey

Harvey Muller (hlmuller) said : #4

Vincent,

I created a LiveUSB from the Xubuntu Gutsy release without problem this morning, so I think there is a problem in your process. I'm also making the assumption that you are trying to create the LiveUSB for the same hardware that you have used previously.

Based on the error you describe, syslinux isn't having problems loading the kernel, but the kernel is having difficulty finding the livecd squashfs.

I recommend you completely remove all files from the LiveUSB partition on your flash drive, not your persistent partition and then run through the entire process again.

Please report back here if this solves your question, or if you require further information. If you are still having problems, I will outline the steps I use. But my process will differ from yours, as I format my flash drives with ext2 (a personal preference).

Thanks,

Harvey

Vincent (vinnl) said : #5

Hi Harvey,

I already feared you wouldn't be able to reproduce the issue, as it also worked for me before (otherwise I'd have reported a bug). Unfortunately, I've repeated the process about a million times already, so I'm afraid that wouldn't help much.

Anyway, I'll describe my process here, maybe you can see the flaw (I also use ext2).

First I partition the drive into two partitions, the first one ext2, the second one FAT16. I've done this a few times with gparted and once with fdisk.

I then do

$ sudo mkfs.vfat -F 16 -n xubuntusb /dev/sda1
$ sudo mkfs.ext2 -b 4096 -L casper-rw /dev/sda2

Where /dev/sda is, of course, my flash drive.

I then use file-roller to extract the files from the ISO image, and then copy them to my USB drive with the command

$ cp -R casper dists install pics pool preseed .disk md5sum.txt README.diskdefines isolinux/* casper/vmlinuz casper/initrd.gz install/mt86plus /media/xubuntusb

(I've also double-checked, but the .disk file was really copied too)

I then copied isolinux.cfg, renamed that to syslinux.cfg, removed "casper/", "cdrom/" and "install/" and added another option for persistent mode, which I set to default. syslinux.cfg now looks like this:

DEFAULT persistent
GFXBOOT bootlogo
APPEND file=/preseed/xubuntu.seed boot=casper initrd=/initrd.gz quiet splash --
LABEL persistent
  menu label ^Start Xubuntu in persistent mode
  kernel /vmlinuz
  append file=/preseed/xubuntu.seed boot=casper persistent initrd=/initrd.gz quiet splash --
LABEL live
  menu label ^Try Xubuntu without any change to your computer
  kernel /vmlinuz
  append file=/preseed/xubuntu.seed boot=casper initrd=/initrd.gz quiet splash --
LABEL live-install
  menu label ^Install Xubuntu
  kernel /vmlinuz
  append file=/preseed/xubuntu.seed boot=casper only-ubiquity initrd=/initrd.gz quiet splash --
LABEL check
  menu label ^Check CD for defects
  kernel /vmlinuz
  append boot=casper integrity-check initrd=/initrd.gz quiet splash --
LABEL memtest
  menu label Test ^memory
  kernel /mt86plus
  append -
LABEL hd
  menu label ^Boot from first hard disk
  localboot 0x80
  append -
DISPLAY isolinux.txt
TIMEOUT 300
PROMPT 1
F1 f1.txt
F2 f2.txt
F3 f3.txt
F4 f4.txt
F5 f5.txt
F6 f6.txt
F7 f7.txt
F8 f8.txt
F9 f9.txt
F0 f10.txt

I then made sure it had the bootable flag, and then ran

$ sudo syslinux -f /dev/sda1

And that's about it.

Thanks,

Vincent

Harvey Muller (hlmuller) said : #6

Vincent,

I can see one of your problems. You are removing more than /cdrom from syslinux.cfg. What I will include below are the steps I have just successfully used to create a LiveUSB for today's hardy desktop amd64 daily-live iso (cdimage.ubuntu.com).

If others come here looking for instructions, keep in mind that you may have to modify the autogenerated /etc/fstab created by ubuquity. I usually do this before clicking on "Continue / Restart" by running the following in a terminal:

    $ sudo gedit /target/etc/fstab

If you scroll to the bottom, you will probably find that you have to comment out two lines and correct the second, changing cdrom1 to cdrom0. Otherwise the new system will not properly automount your usb flash drives.

Creating a LiveUSB from LiveCD:

1. Ensure proper prerequisites are in place:

    $ sudo aptitude install syslinux

2. Format usb flashdrive

    $ mount <see if it is mounted>
    $ umount /dev/sdb1 <unmount if mounted, change sdb1 as necessary>
    $ sudo fdisk /dev/sdb <create type b partition, make it bootable, write changes and exit>

3. Create filesystem on usb flashdrive.

    $ sudo mkfs.vfat -n <VOLNAME> /dev/sdb1

4. Copy syslinux mbr to flashdrive

    $ sudo cat /usr/lib/syslinux/mbr.bin > /dev/sdb

5. Mount iso

    $ sudo mount -o loop /path/to/filename.iso /mnt

6. Reinsert usb flashdrive to auto mount it

7. Change directory to flashdrive

    $ cd /media/<VOLNAME>

8. Copy files over to flashdrive. Ignore messages about file permissions and symlinks.

    $ sudo cp -R /mnt/* /mnt/.disk . && sync

9. Make modifications to convert from LiveCD to LiveUSB

    $ mv isolinux/ syslinux/
    $ cd syslinux
    $ mv isolinux.cfg sylinux.cfg
    $ sed -i 's/\/cdrom//' syslinux.cfg <This removes all /cdrom references>
    $ cd

10. Unmount flashdrive and install syslinux

    $ umount /media/CRUZER-B/
    $ sudo syslinux -d /syslinux /dev/sdb1

That'll get you the base LiveUSB. I'll leave persistence to others.

Vincent, please report back here to let me know if this resolves your question, or if you require further information.

Thanks,

Harvey

Vincent (vinnl) said : #7

I've created a new syslinux.cfg file, this time only removing "cdrom/". Unfortunately, no luck, still the same error messages... Your process seems pretty similar except for the sync command in step 8 and that you keep the files isolinux/*, casper/vmlinuz, casper/initrd.gz and install/mt86plus in their respective directories, which might explain why I also removed references to casper/ and install/ . I'll try again using your method, but that'll be tomorrow as I'm running out of time right now. And of course, I'll report back here.

Thanks,

Vincent

Harvey Muller (hlmuller) said : #8

Vincent,

Let me know if it works, if so, just mark the question Solved. If it doesn't, then we can discuss it further.

Thanks,

Harvey

Vincent (vinnl) said : #9

OK, I've tried using your setup, and while the menu displayed as usual and the system booted, it still ended up in the same errors and in a busybox prompt.

Harvey Muller (hlmuller) said : #10

Vincent,

I am at a loss then. There are only two possibilites left that I can see:

a. The iso you are using is bad, in which case the solution would be to download a new one.

b. There are hardware issues preventing Xubuntu from loading.

I've tested the process multiple times, and cannot find a problem with it. I tested it with both Xubuntu and Ubuntu.

You might try downloading the iso again, if you haven't already and test it again.

Best regards,

Harvey

Vincent (vinnl) said : #11

Too bad, but thanks a lot for the attempts to help, it is much appreciated. I've downloaded at least five different ISO's, checked the MD5sums - that's not it. I've also tried it on two different PC's, so those can't be it to. Perhaps that there's something wrong with the flash drive...

Harvey Muller (hlmuller) said : #12

Vincent,

That's what I started to think after my last post. My bet is on the flash drive now.

Try testing with a different flash drive and let me know if your results are different.

Harvey

Vincent (vinnl) said : #13

Unfortunately I only have this drive and a 512 MB one. The ISO is 542.3 MB so it doesn't fit... Perhaps I'll find another >1GB drive, but until then, I guess I'm just out of luck.

Jeff Orcutt (virmagnus) said : #14

I have been having this problem too, whenever I put the "persistent" option in the syslinux.cfg file. If I just do a straight copy of isolinux.cfg, it works fine.

On Hardy Ubuntu i386 on a 2gb usb stick, with a 512 mb "casper-rw" partition.

Vincent (vinnl) said : #15

This is absolutely unbelievable: I tried this with another flash drive yesterday and it *still* doesn't work!

At least I've managed to narrow down the possible sources of the problem, because this flash drive used to hold Xubuntu 7.10 persistent, and when I dumped 8.04 on it, I left the partitions intact - so that should not be the problem.

So the problem has to be in either the files I copied, or my syslinux.cfg.

This is the output of ls -R: http://paste.ubuntu-nl.org/64663/plain/

And this is my syslinux.cfg: http://paste.ubuntu-nl.org/64664/plain/

Harvey, could you post yours from a working LiveUSB?

Harvey Muller (hlmuller) said : #16

Vincent,

Persistence seems to be the problem at the moment. I cannot get it to work at the moment using the ubuntu wiki literature. This leads me to believe there have been changes to casper, which are not yet publicly documented.

I changed the volume label from casper-cw to casper-cow, this allowed the LiveUSB to boot fully, but no persistence.

You can confirm this by booting the 'live' option, instead of 'persistent.'

Harvey

Vincent (vinnl) said : #17

Odd. I have tried the live option but it gave me the same problem. Also, I tried to make a Gutsy ISO persistent and it gave me the same problem, while that worked before...

I'm going to try again with Gutsy, then. If that does work, then I'll report a bug on casper (which would be too bad if we only found out now).

Best psypher (psypher246) said : #18

Hey guys, I think your problem is related to this bug: https://bugs.launchpad.net/ubuntu/+source/casper/+bug/219192

follow the steps to edit the casper file in the scripts folder after you unpack the initrd.gz file. After i made the changes I got one step closer. Although it's still not fixed for me. You can see my comments on that bug. somehoe it keeps looking at the cdrom for the squashfs file and not the usb partition. I'm using grub instead of syslinux for specific reasons. Goona try syslinux now just to see if it works.

Vincent (vinnl) said : #19

Thanks psypher, that solved my question.