http://www.Linux-Boot.net


Linux-Boot.net

BIOS
CPU Arch

MBR
Boot Stages
Boot Squence
Boot Errors

Booting
Boot-Loaders
SysLinux
Grub
Lilo


RootFS-HOWTO
RootFS-Config
RootFS-HOWTO


InitRD-HOWTO
InitRD
InitRD-Config
InitRD-HOWTO

Creating initrd.gz
RamDisk
Loop

Viewing initrd.gz


Obsolete
initrd/rootfs Scripts

Old Scripts


initrd HOWTO Scripts
rootfs HOWTO Scripts
( Bootable CF, USB, FD, CD )
Standalone Boot
/boot
InitRD
RootFS
Patches


Boot Media
CD-Boot
Floppy-Boot
USB-Boot
Compact-Flash-Boot
Network-Boot
DOS


Chroot


Forgot Root PassWord


CDRW HOWTO



1U Rackmount Chassis

Custom-Chassis.com

Linux-1U.net

1U-ITX.net


ITX-Blades.net


Small PC cases

Mini-Box.net

Wrap-Box.net

Wrap-OS.net


Wan-Sim.net



Linux-Consulting.com

Linux-CAE.net

Linux-Sec.net

Linux-Boot.net

Linux-Backup.net

Linux-Wireless.org

Linux-Office.net

Linux-Video.net

Linux-VOIP.net

Linux-Jobs.net

Linux-Diff.net

1U-Raid5.net

Linux-Howto.net


Spam Reporting



Free Linux CDs

ISO9660.org

Distro-CD.org

Patch-CD.org




Contact



Linux is a registered trademark of
Linus Torvalds

More Linux Legalese


Booting from USB

  • Booting from the USB devices requires a USB boot capable BIOS
      the bios should list:

      HDA, HDC, cdrom, ...
      USB-disk, USB-cdrom, USB-zip, USB-network <--- these usb devices

  • Example generic Slackware-10 image for 128MB usb memory stick

USB Support Requires the Following Kernel Options
SCSI support CONFIG_SCSI scsi_mod.o
SCSI disk support CONFIG_BLK_DEV_SD sd_mod.o

  • USB Support
  • cd /usr/local/src/linux-2.4.27
  • egrep -i "CONFIG_USB|CONFIG_USB_DEVICEFS|CONFIG_USB_STORAGE" .config | grep -iv ^#
Support for USB CONFIG_USB usbcore.o
Preliminary USB device filesystem CONFIG_USB_DEVICEFS
UHCI HCD support CONFIG_USB_UHCI_HCD uhci_hcd
USB Mass Storage support CONFIG_USB_STORAGE usb-storage.o

/etc/modules.conf

  • /etc/fstab
       none  /proc/bus/usb   usbdevfs  defaults  0   0 
  • /etc/modules.conf

Loading the Kernel Modules

  • Loading the USB Modules
      #
      # ehci-hcd.o is for experimental USB 2.0 support
      insmod -f /lib/modules/.../usb/ehci-hcd.o
      #
      insmod -f /lib/modules/.../usb/usbcore.o
      insmod -f /lib/modules/.../usb/usb-uhci.o
      insmod -f /lib/modules/.../usb/uhci.o
      insmod -f /lib/modules/.../usb/usb-ohci.o
      insmod -f /lib/modules/.../usb/usb-storage.o
      #
      #
      # -- or --
    • modprobe usb-storage

  • Viewing the USB Modules
    • lsmod | grep scsi
         ide-scsi  11568   0  
         scsi_mod 107032   5  [sd_mod sr_mod usb-storage ide-scsi sg]

    • lsmod | grep usb
        usb-storage  26864   1  
        scsi_mod    107032   5  [sd_mod sr_mod usb-storage ide-scsi sg] 
        usbcore      77952   1  [ehci-hcd uhci usb-storage hid] 

Checking the USB subsystem

  • lsusb ( lots of stuff )
  • usbview
  • sg_map -i

  • ls -la /proc/scsi
       dr-xr-xr-x  2 root  root  0 Sep 13 18:47 ide-scsi 
       -r--r--r--  1 root  root  0 Sep 13 18:47 scsi 
       dr-xr-xr-x  2 root  root  0 Sep 13 18:47 sg 
       dr-xr-xr-x  2 root  root  0 Sep 13 18:47 usb-storage-0 

  • ls -la /proc/scsi/usb-storage-0
  • cat /proc/scsi/usb-storage-0/1

  • ls -l /proc/bus/usb
       dr-xr-xr-x 1 root root 0  Sep 19  14:21  001 
       dr-xr-xr-x 1 root root 0  Sep 19  14:21  002 
       -r--r--r-- 1 root root 0  Sep 19  22:30  devices 
       -r--r--r-- 1 root root 0  Sep 19  22:30  drivers 
  • cat /proc/bus/usb/devices ( lots of stuff )
  • cat /proc/bus/usb/drivers ( lots of stuff )

Format and Mount the USB Memory Stick
  • fdisk /dev/sda

  • If you are going to plugin and unplug your memory stick
    you should use a filesystem immune to power failures
      ( msdos(FAT16) format or reiserfs(?) )


  • Formatting the Memory Stick
    • mkfs.vfat /dev/sda1
    • mount /dev/sda1 /mnt/usb
         /dev/sda1    127462     0    127462   0% /mnt/usb 

    • mke2fs /dev/sda1
    • mount /dev/sda1 /mnt/usb
         /dev/sda1    123683    13    117284   1% /mnt/usb 

    • mke2fs -j /dev/sda1
    • mount /dev/sda1 /mnt/usb
         /dev/sda1    123683  4127    113170   4% /mnt/usb 

    • mkreiserfs /dev/sda1
    • mount /dev/sda1 /mnt/usb
         /dev/sda1    127720  32840    94880  26% /mnt/usb 


RamDisk for Mounting Memory Sticks
  • ramdisk is NOT needed if youcompile the scsi and usb modules into the kernel

    Uni-Karlsruhe.de knoppix + DamnSmallLinux.org
    d-i.Pascal.at Installing Debian from USB stick

USB-based Distro
    Linux-Boot.net/Boot/Scripts Slackware-10 -- w/ minimum "A" and "N" packages

    • Linux-2.4.27 kernel config file
    • Example rc.usb-stick to load the usb modules
    • List of installed slackware-10 packages
    • Requires the latest lilo-22.6

    • To Install the minimum install Slackware-10.usb.tgz image
      • Uses 100MB of the 128MB USB memory stick
      • pick a filesystem that is immune to power failures ( hot-plug in and out )
          msdos ( not vfat ) is best but it's "not good" for linux per se

      • Simplified install
        fdisk /dev/sda
        mkreiserfs /dev/sda1
        mount /dev/sda1 /mnt/usb
        cd /mnt/usb ; tar zxvfp slack-10.usb.tgz
        chroot /mnt/usb lilo -v -C etc/lilo.usb.conf
        reboot

    • You can shrink it to under 50MB (installed) by removing the garbage

USB Memory Stick URLs


Copyright © 2000
Linux-Consulting
All Rights Reserved.
Updated: Mon Aug 22 15:37:16 2005 PDT