Jump to content

Installing Mandrake on USB 2.0 Disk


Compugen
 Share

Recommended Posts

But for cd rom it says something like /dev/hdd = cd rom. Same for floppy it says fd0. I am unable to boot into linux the reason being now USB is not booting it in and from master i cant boot since i changed fstab contents. It gets stuck on initrd parameters.

 

While this may be a little late, it might help others. I have gotten MDK10.1 to boot off a USB memory stick, with the steps below:

 

The first thing that I did was to make my USB memory stick a ZIP compatible disk, where the boot partition is #4, /dev/sda4, /dev/sda5 is "/", and /dev/sda6 is the swap partition. I used the documentation for mkusb to build the USB memory stick (reference MkUSB documentation: <approx. path> Syslinux-3.51/README.usbkey), specifically the USB boot partition (e.g., "mkdiskimage -4 /dev/sda 0 64 32" - make SURE that you know what you are doing and remove any unnessary drives to be safe!), and then used cfdisk to add in the other partitions.

 

The main issue was modifying the kernel (mine is 2.4.24) to allow the USB subsystem to initialize prior to attempting to load the initrd. Within the kernel, modify ./init/do_mounts.c and first add the following at the top of the module (thanks to http://www.freewebs.com/tsj/bootingUSB_v0.1.htm as a starting point):

#define BOOT_PAUSE_FOR_USB_START (1==1)

#if BOOT_PAUSE_FOR_USB_START

static void __init DoPauseForNonIdeDevices(char *device, int callerID)

{

// attempt to let USB be root drive, so pause to let it initialize...

static DECLARE_WAIT_QUEUE_HEAD(rootpause_queue);

printk(KERN_NOTICE "### Pausing to let devices initialize [%i].\n", callerID);

sleep_on_timeout(&rootpause_queue, 1000);

printk(KERN_NOTICE "### Continuing root boot process.\n");

} // end DoPauseForNonIdeDevices()

#endif // end BOOT_PAUSE_FOR_USB_START

 

Then add at the top of mount_block_root() <e.g., first executable code>:

#if BOOT_PAUSE_FOR_USB_START

DoPauseForNonIdeDevices(name, 1);

#endif // end BOOT_PAUSE_FOR_USB_START

 

Then add at the top of mount_root() <e.g., first executable code>:

#if BOOT_PAUSE_FOR_USB_START

DoPauseForNonIdeDevices(root_device_name, 2);

#endif // end BOOT_PAUSE_FOR_USB_START

 

My initrd implementation always uses the mount_block_root() path. When I boot the kernel using a hard drive, it still waits, but this is left as an future implementation issue - it works just fine other than pausing more that necessary using a hard drive. It does work on my board.

 

Below are the kernel configuration(s) that I needed (reference http://tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/ section 5.2 Kernel options). Using a different kernel might require a different set of configuration selections:

* Kernel Configuration (2.4.24) to support USB Boot

* [*] SCSI Support

* [*] SCSI Disk Support

* [*] File Systems

* [*] Kernel Automounter

* [*] Supermount removable media support

* [*] Ext3

* [*] DOS FAT fs support

* [*] MSDOS fs support

* [*] Virtual memory file system support

* [*] ISO 9660 CDROM file system support

* [*] Microsoft Joliet CDROM extensions

* [*] proc file system support

* Network File Systems <as needed>

* [*] USB Support

* <*> Support for USB

* [*] Preliminary USB file system

* [*] UHCI

* [*] OHCI

* <*> USB Mass Storage Support

* [*] Freecom USB/ATAPI support

 

This allowed booting my USB memory stick either directly plugged in, or plugged into a USB hub. This results in the USB subsystem initializing and be ready while the main thread/task of the kernel, specifically the routines w/in do_mounts.c, pauses for a little while, and then continuing successfully loading the initrd *after* the USB subsystem has been initialized. Obviously, you have to have /etc/fstab setup correctly, as well as the appropriate grub.conf/lilo.conf file, and finally, installed the boot strap on the USB MBR. This implementation works (for me) using either DOS/loadlin or EXT3/lilo in /dev/sda4 (I presume that grub will work also).

 

Hopefully, the above will help you and/or everyone else. Lots of luck!

Link to comment
Share on other sites

  • Replies 45
  • Created
  • Last Reply

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share


×
×
  • Create New...