Announcement

Collapse
No announcement yet.

How To: Make GRUB Thumb Drive

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How To: Make GRUB Thumb Drive

    How To Make a GRUB Flash Drive.
    (Optional: GParted Live on Flash Drive.)
    --- A toolkit for building bootable flash drives.

    (Key words: GRUB on a Flash Drive, on USB Flash Drive, on Pendrive, on USB Device.
    Option: GParted Live on Thumb Drive, on USB Flash Drive, on Pendrive, on USB Device.)


    Other related projects:
    -- To clone your flash drive, see REFERENCES, dd Command.
    -- To build a Live Kubuntu persistent flash drive, see REFERENCES, Build a LIVE Kubuntu Flash Drive, How-To
    -- How to Install Kubuntu to an External USB HDD: See Reply #1 (following this post)
    External USB hard drives: Same methods as for flash drives!
    The methods for USB flash drives are the same as for external hard drives.

    -- Comment about other posts in this thread
    Reply #1 is maintained:
    How to install K/Ubuntu 7.04 to an external USB hard disk drive (HDD).
    The following are not maintained any longer: Replies #5, 6, 7, 8, 9, 10, 12.
    However, you may find useful information in some of them:
    USB experiment: USB drive shifting Reply #5.
    Simplifying your menu.lst and all the rest of it, Reply #8
    Puppy Linux on USB Flash Drive (UFD) Reply #9
    Super Grub Disk, GRUB, GParted & Puppy on a flash drive Reply #10
    Knoppix on USB Flash Drive (UFD), Reply #6 & #7
    Install Kubuntu 7.10 to a flash drive (UFD) Reply #12
    First version of this how-to, the original post, this first post, is attached at the end here, following the REFERENCES.


    TABLE of CONTENTS

    Abbreviations

    1 How-to do it: The basic how-to
    2 Notes -- details, tips, options, methods, additional information
    3 USB drive shifting: Very important!
    => the key to understanding how to use flash drives and external drives
    Super Grub Disk for USB -- usbshift -- special command for dealing with drive shifting
    4 Appendix: Put GParted in the same partition with SGD
    Alternate way to partition for GParted: Put it in with SGD in partition 1
    You do not need a separate partition for GParted.
    Adjustments you need to make.
    5 REFERENCES

    List of Notes
    Note 1: BIOS issues, assumptions: “Boot from USB
    Note 2: Compressed files (bz2 & bzip) and using Ark in Kubuntu
    Note 3: Using the special SGD USB
    Note 4: Use K3b (in Kubuntu) to burn your GParted Live CD
    Note 5: How to zero-out your flash drive
    Note 6: Setting labels at the command line: This is changed!--see the Note 6.
    Note 7: Open a file manager as root
    Note 8: Copying hidden folders and files in GUI and CLI
    Note 9: Accessing files on a downloaded iso file (without burning a CD)
    Note 10: Find out how Kubuntu & GRUB see the flash drive
    Note 11: Using GParted Live CD -- logistics
    Note 12: md5sum (of downloaded files)

    = = = = = = = = = = = = = = = = = = = =
    Abbreviations
    CLI: command line interface, refers to using Konsole
    GUI: graphical user interface, using Konqueror or Dolphin
    HD: hard drive; HDD: hard disk drive
    MB: megabyte
    OS: operating system
    SGD: Super Grub Disk
    UFD=USB flash drive (thumb drive, pen drive, etc.)

    = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

    1 How-to do it: The basic how-to

    Goal
    To put your GRUB boot menu and Super Grub Disk on a flash drive.

    Optional: To put GParted Live on the same flash drive.
    (Instructions are given for GParted, which you may choose to do or to omit.)

    -- At a minimum, we will install Super Grub Disk to the flash drive, and we'll include your own boot menu, which you can use to boot your operating systems directly. Super Grub Disk can be used to boot into your operating systems when you are otherwise unable to do so.
    -- As an option, you may put GParted Live on the flash drive. GParted is a handy partitioning editor.
    -- You will see how to easily include other programs or Puppy Linux on the same flash drive.
    -- You may also include a data partition for your personal use.

    See Note 1: BIOS issues, assumptions: “Boot from USB

    Overview
    We assume you will do this work in Kubuntu/Linux.
    Step 1 Download SGD for USB
    [and optionally, GParted Live CD files--you do NOT need the USB version of GParted].
    Step 2 Prepare the flash drive:
    Zero-out (optional), partition, format, set boot flag, set labels
    Method: Use GParted Live CD; or gparted from Kubuntu
    Step 3 Copy files from SGD [and GParted Live CD] to the flash drive
    SGD: Extract the boot directory; copy it into the first partition of the flash drive
    GParted: Copy all GParted files to the (second partition) of the flash drive
    Step 4 GRUB
    Set up GRUB in the MBR of the flash drive;
    Build the boot menu (menu.lst)
    Step 5 You are done! Re-boot to test it


    Step 1 Download SGD for USB [and GParted Live CD files]

    -- Download SGD for USB from here:
    http://www.supergrubdisk.org/
    Example
    Super Grub Disk for USB: super_grub_disk_english__usb_0.9766.tar.gz

    Download that file to your Desktop. Right-click on it, select Extract Here, you get a folder named “boot”. (We need this folder and its contents to make the UFD bootable and usable.)

    See Note 2: Compressed files (bz2 & bzip) and using Ark in Kubuntu.
    See Note 3: Using the special SGD USB.

    -- GParted Live CD
    This is handy. You can use it to build the flash drive, and you can include GParted Live on the flash drive. For my method, you do NOT need to download the USB version of GParted: simply get the regular “live” (live CD) version.
    Example: gparted-live-0.3.9-13.iso
    (11/28/08--this new version includes capability to make Labels)
    Check the MD5sums (See Note 12: md5sum).

    See Note 4: Use K3b (in Kubuntu) to burn your GParted Live CD.

    Step 2 Prepare the flash drive:
    Zero-out (optional), partition, format, set boot flag, set labels
    Method: Use GParted Live CD; or gparted from Kubuntu

    Example: Flash Drive: 512 MB SanDisk

    Desired end result: (partitions sdc2 and sdc3 are optional)
    Partition - Label -Format - Size
    sdc1 Grub-SGD ext2 8 MB (the minimum allowed by GParted) Boot Flag set
    sdc2 GParted FAT32 125 MB
    sdc3 MyData FAT32 the rest of the space - for personal data use

    CAUTION: Your device names (sdxn) may be different!
    See Note 10: Find out how Kubuntu & GRUB see the flash drive

    Optional step: Wipe your flash drive clean, like factory-new.
    See Note 5: How to zero-out your flash drive
    (You can do this in Kubuntu or in GParted.)
    Partition table/Master Boot Record: Flash drives that have been zeroed-out: If doing the partitioning using GParted, you will be prompted to accept a DOS-like partition table (in the Master Boot Record). If you are going to make the flash drive bootable with GRUB, accept this offer.

    See Note 11: Using GParted Live CD -- logistics

    Insert GParted Live CD. Re-boot the PC. Get the GParted screen.
    Insert the Flash drive into USB port.
    GParted (tab, upper left) > Refresh Devices
    Confirm that the flash drive is recognized:
    Drop down list at upper right of screen; or GParted (tab) > Devices
    Example: Mine came up as sdc.

    -- Optional: Zero-out the flash drive to wipe it clean-clean (factory new). See Note 5.
    -- Conduct the partitioning and formatting (as indicated above -- “Desired end result”)
    Note: In GParted, tabs at top,
    Partition > Label
    Partition > Flags > Boot (check box)

    Labels: You can also set labels at the command line (in GParted or in Kubuntu)
    See Note 6: Setting labels at the command line.--CHANGED!!!
    The method works only for ext2/ext3, NOT for FAT32, which is a more complicated case and is NOT covered in this How-to.


    Step 3 Copy files from SGD [and GParted Live CD] to the flash drive
    SGD: Extract the boot directory; copy it into the first partition of the flash drive
    GParted: Copy all GParted files to the (second partition) of the flash drive

    GUI or CLI: You can do this work in two ways.
    GUI: Konqueror or Dolphin (file managers)
    CLI: In Kubuntu at Konsole

    File managers Konqueror and Dolphin: Use copy/paste or drag-and-drop.
    See Note 7: Open a file manager as root

    Copying hidden files and folders
    Whichever way you use, be certain that you also copy any hidden folders and files.
    See Note 8: Copying hidden folders and files in GUI and CLI

    Copy the files into the flash drive (using root as necessary):
    Copy the SGD files into partition 1 of the flash drive.
    Copy the GParted files into partition 2 of the flash drive.
    Here's some CLI notes:

    -- Copying SGD files into the flash drive partition 1 (Grub-SGD)
    Extract the SGD files (Right-click > Extract Here to get boot directory)
    Copy the directory boot from Desktop into Grub-SGD.
    Example Suppose the first partition of the flash drive is mounted as /media/sdc1.
    (You can do that: sudo mount /dev/sdc1 /media/sdc1)
    cd Desktop
    sudo cp -r boot /media/sdc1
    So, when you open the first partition, you see the boot folder (directory).

    -- Copying GParted files into the flash drive partition 2 (GParted)
    If you burned the GParted Live CD (from the iso), put the GParted CD into the CD drive and let it come up. As an example, suppose it is mounted as /media/cdrom0; and suppose the second flash drive partition is mounted as /media/sdc2 (sudo mount /dev/sdc2 /media/sdc2). Then,

    cp -r /media/cdrom0/* /media/sdc2

    Using the gparted iso file (without burning the GParted Live CD)
    If you did not burn the GParted Live CD (using the gparted iso file), you can open the iso and copy the files into the second partition of the flash drive (without burning the Live CD).
    See Note 9: Accessing files on a downloaded iso file (without burning a CD)


    Step 4 GRUB
    Set up GRUB in the MBR of the flash drive
    Build the boot menu (menu.lst)

    Reference for GRUB, setup and menu.lst, my how-to:
    How To GRUB Methods - Toolkit
    http://kubuntuforums.net/forums/inde...opic=3081671.0


    Set up GRUB in the MBR of the flash drive
    So far, SGD and GParted are copied to the two flash drive partitions SGD-Grub and GParted.
    Next, we set up GRUB on the flash drive. Get a grub prompt as root:
    sudo grub
    We need to know how GRUB names the first partition of the flash drive since it contains the GRUB files we need to set up in the MBR of the flash drive. Use geometry to find out.
    grub>geometry (hd<press the TAB key>
    Try some of the results: grub>geometry (hd0), grub>geometry (hd1), grub>geometry (hd2), etc.
    Study the output to determine which drive is the flash drive.
    Example: Suppose it is hd2.
    grub>root (hd2,0) # (hd2,0) is the SGD-GRUB partition of the flash drive
    grub>setup (hd2) # (hd2) is the Master Boot Record of the flash drive
    grub> quit
    $: exit

    So far, SGD--and its GRUB--is set up on your flash drive.
    With the flash drive connected, if you re-boot now from the flash drive, your PC will boot into SGD. The GParted partition is setup but is not on the boot menu yet; nor is your personal menu.lst.


    Menu.lst
    Build the boot menu (/boot/grub/menu.lst):
    Include boot entries for GParted and myLinuxMenu.lst

    Have a look at the boot menu. In Kubuntu, plug the flash drive in, open the first partition, Grub-SGD, navigate to and open the main boot menu, /boot/grub/menu.lst. You must modify it by including a boot entry for your personal menu.lst, which we'll call myLinuxMenu.lst, and a boot entry for GParted (actually two, one for normal Live and one for fail-safe mode). When you boot the PC from the flash drive, this is the boot menu you will see first, from which you'll select where to go next.
    Here's the desired end result, with various SGD entries abbreviated, after which, we'll explain it:

    # /boot/grub/menu.lst for the flash drive
    # This is the main boot menu for calling
    # your personal menu.lst, GParted, SGD,
    # and other programs/OSs you have on the flash drive.
    # You can edit this file to add your own distribution
    ## The two commands: setgrubdevice and usbshift are needed
    ## so that SGD works well.
    #usbshift
    #configfile $(grub_device)/boot/sgd/menu.lst
    # Just after default and timeout statements you have to put
    # setgrubdevice so that grub device is correctly set.
    #
    # Note that the default boot entry is default=0 which is myLinuxmenu.lst

    default 0
    timeout 10
    setgrubdevice # This is compulsory
    #sgdgfxmenu /boot/grub/message
    foreground ffffff
    background 0c00ff
    color white/brown yellow/cyan

    title myLinuxMenu.lst
    usbshift # this is necessary
    configfile $(grub_device)/boot/grub/myLinuxMenu.lst

    title GParted Live--Live Start Debian Live, partition 2
    root (hd0,1)
    kernel /live/vmlinuz1 boot=live union=aufs
    initrd=/live/initrd1.img

    title GParted Live --Start Debian Live (fail-safe mode), partition 2
    root (hd0,1)
    kernel /live/vmlinuz1 boot=live union=aufs noapic noapm nodma nomce nolapic nosmp vga=normal
    initrd=/live/initrd1.img

    #title Inicio normal / Normal Boot: etcetera
    #title Soporte de accesibilidad / Accesibility Support -->
    #configfile $(grub_device)/boot/grub/menu2.lst

    title Super Grub Disk
    # The two commands: setgrubdevice and usbshift are needed
    # so that SGD works well.
    usbshift
    configfile $(grub_device)/boot/sgd/sgd.lst

    #title Normal boot. Kernel is aware of Boot device, etcetera
    #title Normal boot. Selecting kernel and initrd files depending on grub_device
    #title Selecthd test
    #title findp test
    #title set SGD variables and boot SGD
    #
    # End of the main /boot/grub/menu.lst


    Comments: how to build /boot/grub/menu.lst

    -- myLinuxMenu.lst

    You'll note the boot entry for SGD, which calls its own separate menu.lst stored in the separate SGD folder sgd and called /boot/sgd/sgd.lst.
    Likewise, you will do the same thing for YOUR personal menu.lst, but you will put yours in the regular grub folder:

    title myLinuxMenu.lst

    usbshift # this is necessary
    configfile $(grub_device)/boot/grub/myLinuxMenu.lst

    Notes:
    The usbshift command is a special SGD-for-USB command; it's effect is to make the device references in your personal menu.lst, myLinuxMenu.lst, work correctly from the flash drive.
    See the special section 4 below:
    4 USB drive shifting: Very important!
    => the key to understanding how to use flash drives and external drives

    GParted: root (hd0,1)
    Since GParted is located on the flash drive, and the (native) GRUB of the flash drive sees the flash drive as hd0, you do not need the usbshift function to reference the GParted partition: it is simply the second partition of the booted flash drive, or (hd0,1).

    $(grub_device)
    is a SGD variable; in this case, it contains the device name that contains your personal menu.lst, /boot/grub/myLinuxMenu.lst. Its value is set by the statement
    setgrubdevice
    and is equal to the first partition of the flash drive (i.e., it is equal to “where we are now”!).


    Next step: Build myLinuxMenu.lst
    Now, obviously, you must create myLinuxMenu.lst and place it in the folder /boot/grub of partition 1 of the flash drive. If you wish, you may simply copy the main menu.lst you use to boot your PC; or you can pick and choose from that menu.lst to build myLinuxMenu.lst. The device references contained in your regular menu.lst, such as root (hd0,0) or root (hd0,1) or (hd1,0), etc., will continue to work when called from the flash drive /boot/grub/menu.lst (or /boot/grub/myLinuxMenu.lst) thanks to the usbshift function.
    Example
    In my case, I normally boot my PC using a separate GRUB partition sdb1 (as described in my How To GRUB Methods - Toolkit link above (see REFERENCES). The menu.lst in that partition is very simple: it calls the various OSs on my PC using configfile; here it is:

    # sdb1 GRUB partition menu.lst
    default 0
    timeout 10
    # Pretty colours
    color cyan/blue white/blue

    title Kubuntu 8.04 sdb2 = (hd1,1)
    configfile (hd1,1)/boot/grub/menu.lst

    title Windows XP Home Edition sda1
    root (hd0,0)
    chainloader +1

    title Kubuntu 8.10 Intrepid sdb3 = (hd1,2)
    configfile (hd1,2)/boot/grub/menu.lst

    Thus, I could copy that and make it the myLinuxMenu.lst to put in /boot/grub partition 1 of the flash drive. But if I ever changed any of those OSs or their partitions, I would then have to modify myLinuxMenu.lst on the flash drive--an inconvenience, and I might forget to do it. So, instead, I will create a very simple myLinuxMenu.lst:

    # This boots my GRUB partition on sdb1 = (hd1,0)
    default 0
    timeout 10

    title My GRUB Partition boot menu on sdb1 = (hd1,0)
    configfile (hd1,0)/boot/grub/menu.lst

    That's it! So here's what happens if I boot the PC using the flash drive:
    First I see the main SGD menu.lst. Suppose I choose myLinuxMenu.lst. then I'll see the choice “My GRUB Partition boot menu on sdb1 = (hd1,0)” and I'll select it. Then I'll see the three choices from the menu.lst on my GRUB partition sdb1: “Kubuntu 8.04 sdb2 = (hd1,1),” “Windows XP Home Edition sda1,” and “Kubuntu 8.10 Intrepid sdb3 = (hd1,2).” And I'll choose one of them. Kind of indirect, I admit, but it is easy to maintain (e.g., when there are kernel updates or when I change my partitions or OSs), and keep in mind that I would usually only use the flash drive to boot in an emergency or exceptional situation, not every day. You can, however, set the default 0 statements (as I have) and reduce the timeouts to 2 or 3 seconds to make it all go automatic and fast.

    Summary so far So, you must do, for yourself, two things:
    First, in partition 1 of the flash drive, in the file /boot/grub/menu.lst, include the following boot stanza that calls your personal menu.lst:

    title myLinuxMenu.lst
    usbshift # this is necessary
    configfile $(grub_device)/boot/grub/myLinuxMenu.lst

    Second, create a text file called myLinuxMenu.lst, place your personal boot entries in it (your personal menu.lst), and place the resulting file in the folder /boot/grub of partition 1 of the flash drive.


    -- GParted Live boot entries in /boot/grub/menu.lst of the flash drive (in the Grub-SGD partition)
    Now, we need a boot entry for GParted.
    In Kubuntu, open the second partition of the flash drive, click on the folder isolinux, then open the file
    /isolinux/menu.cfg, and you'll see this:

    LABEL live
    MENU LABEL Start Debian Live
    kernel /live/vmlinuz1
    append initrd=/live/initrd1.img boot=live union=aufs

    LABEL livefailsafe
    MENU LABEL Start Debian Live (fail-safe mode)
    kernel /live/vmlinuz1
    append initrd=/live/initrd1.img boot=live union=aufs noapic noapm nodma nomce nolapic nosmp vga=normal

    I used this to construct GRUB boot entries for GParted as follows:

    title GParted Live -- Start Debian Live on partition 2
    root (hd0,1)
    kernel /live/vmlinuz1 boot=live union=aufs
    initrd=/live/initrd1.img

    title GParted Live -- Start Debian Live (fail-safe mode) on partition 2
    root (hd0,1)
    kernel /live/vmlinuz1 boot=live union=aufs noapic noapm nodma nomce nolapic nosmp vga=normal
    initrd=/live/initrd1.img

    Place those two boot stanzas into the main SGD menu.lst above
    (# /boot/grub/menu.lst for the flash drive).

    That worked for GParted.
    If it had not worked, I would have done the following to get correct boot stanzas for GParted:
    > Poke around the GParted files and find something else to try;
    > Use google to learn about the boot options for GParted;
    > Try the GParted site for tips:
    > Post a direct question in the GParted user forum and hope that an expert would post a correct boot stanza for me to use; if not, unashamed, I would do a bump .

    This completes
    Menu.lst -- Build the boot menu (/boot/grub/menu.lst)
    and it completes the GRUB work.

    -- Optional: Other OSs/programs
    You may include any other programs/OSs on this flash drive. For example, you can include Puppy Linux in its own partition, and call it from the main Grub-SGD menu.lst. See Reply #10 for that.


    Tips, methods
    Here's some tips/methods to help you do the edits to the main SGD menu.lst in the Grub-SGD partition.
    Suggestion:
    It is probably easier and faster for most people to do the menu.lst work using their file manager, on the Desktop, copy/paste, rather than to use Konsole. If you prefer to use the command line, then you already know how, and I won't include the details, which would only make it seem more complicated than it is.

    > You may have to do the edits as root.

    > You can do the work at CLI or GUI: Konsole or using a file manager, Konqueror, Dolphin, etc.

    > Kate
    To open the main Grub-SGD menu.lst as root in the text editor Kate
    (assuming the mount point is /media/sdc1):
    In 8.10:
    kdesudo kate /media/sdc1/boot/grub/menu.lst
    In 8.04:
    kdesu kate /media/sdc1/boot/grub/menu.lst
    => After making edits, File > Save, File > Quit.

    > Mount point:
    This assumes that the first partition of the flash drive is mounted as /media/sdc1. If not, substitute the correct mount point.
    See mounts points using:
    mount
    or
    cat /etc/mtab
    Make mount points and mount:
    To make the mount point /media/sdc1 for device /dev/sdc1 and to mount it:
    sudo mkdir /media/sdc1
    sudo mount /dev/sdc1 /media/sdc1
    To unmount it after making edits (note the spelling umount):
    sudo umount /dev/sdc1 /media/sdc1

    > Open Konqueror or Dolphin as root:
    In 8.10:
    kdesudo konqueror
    kdesudo dolphin
    In 8.04:
    kdesu konqueror
    kdesu dolphin

    Then, navigate to the mount point for the partition Grub-SGD (e.g., in /media), and open /boot/grub/menu.lst.

    > Copy files
    Suppose you build the myLinuxMenu.lst that you want, and it's on your Kubuntu Desktop (as an example). To copy it into the the grub directory of the Grub-SGD partition, assuming the Grub-SGD partition is mounted as /media/sdc1:
    sudo cp /home/your_name/Desktop/myLinuxMenu.lst /media/sdc1/boot/grub

    > myLinuxMenu.lst: Text files, opening kate, saving the file, using root
    The file myLinuxMenu.lst should be a text file.
    In Konqueror or Dolphin, create a text file by
    right-click > Create New > Text File
    At Konsole, open Kate to get a new text document, File > Save As, and name it myLinuxmenu.lst:
    Konsole
    kate
    File > Save As
    Navigate to where you want it (your /home Desktop, or the flash drive folder /media/sdc1/boot/grub, etc.).
    To open kate as root:
    In 8.10:
    kdesudo kate
    In 8.04:
    kdesu kate
    If you open Kate as root, beware that saving it in home will save it in root's home, not your home; if you want it in your home, you have to Save As and navigate to home > your name > Desktop or wherever you wish to place it.


    Step 5 You are done! Re-boot to test it


    = = = = = = = = = = = = = = = = = = = =

    2 Notes -- details, tips, options, methods, additional information

    Note 1: BIOS setup issues -- Set your BIOS to boot from USB
    Your BIOS must support the capability to "boot from USB." With the flash drive connected, re-boot, enter BIOS setup, set your BIOS to boot from USB. Set it to boot from CD first, then the flash drive, then your first hard drive. With no CD in the tray, with the flash drive plugged in, the PC boots from it; when the UFD is not plugged in, the PC boots as usual from the first hard drive. Save and Exit BIOS. The PC then re-boots from the flash drive.

    Note 2: Compressed files (bz2 & bzip) and Ark in Kubuntu

    Example SGD: super_grub_disk_english__usb_0.9766.tar.gz
    The .bz2 is a bzip2 file--a compressed file (to make the file smaller for faster download). (Another type is .gz or gzip.) The extension .tar means the file is a tarball or tape archive file. The tarball has been compressed by bzip2. In Kubuntu, open the tarball with Ark (Archive extractor). Two ways:
    (1) K-Menu>Utilities>Ark, File>Open, Desktop, click the file super_grub_disk_english__usb_0.9766.tar.gz, Open, Action>Extract, All files, select destination folder for the extracted files to go. Or,
    (2) Right click on super_grub_disk_english__usb_0.9766.tar.gz, select Extract here.

    Note 3: Using the special SGD USB
    The special SGD for usb is needed if the flash drive is used to boot OSs NOT located on the flash drive, as SGD does or as myLinuxMenu.lst does. See the section below titled, “USB drive shifting: Very important! => the key to understanding how to use flash drives and external drives.”

    Note 4: Use K3b in Kubuntu to burn the GParted Live CD

    You'll find K3b under the K-menu (perhaps multimedia or system or applications). Select “Burn CD Image,” Image to Burn (Browse to the Desktop--or wherever you downloaded gparted, click gparted-livecd-0.3.9-13.iso, click OK, place a blank CD in CD tray, close the tray door; Speed: select 4x or the slowest speed offered, click Start. Wait for it to finish, click Close, then File>Quit, eject the CD, and using a magic marker write the version on the safe (top) side of the CD (e.g., "gparted-livecd-0.3.9-13.iso" , and release date 11-28-08).

    Note 5: How to zero-out your flash drive: dd if=/dev/zero of=/dev/sdx
    Wipe your flash drive clean, like factory-new. Easy! BUT, CAUTION! You must get the device-naming sdx correct! If you use the wrong one, you'll wipe out an entire drive!
    Result: This will write zeros to every bit of your flash drive, including the Master Boot Record.
    Where to do it: You need a terminal in a Linux distro. You can do this in Kubuntu at Konsole (even in Live CD) or in GParted.
    In Kubuntu: Insert the flash drive. Open Konsole.
    In GParted: Insert the flash drive. GParted (tab at upper left) > Refresh Devices. It should come up under GParted > Devices and under the drop-down list at top right of screen. Double-click Terminal (icon at top).
    Commands:
    Use this command to identify how your flash drive is named:
    sudo fdisk -lu
    Put that name sdx in the next command and press Enter:
    dd if= /dev/zero of=/dev/sdx
    (Sudo: If necessary run it using sudo dd if=/dev/zero of=/dev/sdx)
    # Example: dd if=/dev/zero of=/dev/sdc
    It will take awhile to run--you will not see any progress status, but the light on your flash drive will blink. When finished, you'll get a brief summary report and returned to the command prompt.
    Type exit.

    Note 6: Setting labels at the command line
    This works only for ext2/ext3 filesystems.
    It does not work for FAT32, which is a more complicated case and is NOT included here.
    For FAT32: use a recent version of GParted Live CD.

    Kubuntu: Open Konsole
    GParted Live CD: Double-click Terminal (icon at top)
    To set the Labels
    Grub-SGD on sdc1
    GParted on sdc2
    MyData on sdc3
    Use these commands:
    sudo e2label /dev/sdc1 Grub-SGD
    sudo e2label /dev/sdc2 GParted
    sudo e2label /dev/sdc3 MyData
    CAUTION: Use the correct device names sdxn for your flash drive partitions.

    Note 7: Open a file manager as root
    In 8.10:
    kdesudo konqueror
    kdesudo dolphin
    In 8.04:
    kdesu konqueror
    kdesu dolphin

    Note 8: Copying hidden folders and files in GUI and CLI -- Check this carefully!
    -- GUI (Konqueror or Dolphin):
    After opening a window containing the files, click View > Show hidden files.
    -- CLI:
    Example: To copy the contents (not dir1 itself) of directory dir1 into directory dir2
    The following statement should do it:
    cp -r dir1/* dir2
    HOWEVER, for the wild card * to include hidden folders (and files), you must configure your BASH terminal (Konsole) correctly (if it is not already so by default)--Check this carefully!
    Two ways to do:
    First way: Issue the command
    shopt -s dotglob
    before the copy cp command.
    Second way: Edit the file ~/.bashrc to include this line:
    shopt -s dotglob
    See the REFERENCE “Commands at Konsole” (how-to @Kubuntu)

    Another way: This statement also does the trick:
    cp -RT dir1 dir2

    Note 9: Accessing files on a downloaded iso file (without burning a CD)
    This works for any downloaded .iso file.
    Example: GParted gparted-live-0.3.9-13.iso
    Download the iso file to the Desktop. (If it's a tar.gz file or similar, get the iso by right-click, Extract Here, or by using K-Menu > Utilities > ARK) The file name is gparted-live-0.3.9-13.iso (on the Desktop): /home/your_name/Desktop/gparted-live-0.3.9-13.iso.
    Open Konsole, make a directory GPartedTemp for your mount point
    sudo mkdir /mnt/GPartedTemp
    # Mount the iso on GPartedTemp
    sudo mount -t iso9660 -o loop /home/your_name/Desktop/gparted-live-0.3.9-13.iso /mnt/GPartedTemp
    # If you wish, you can change directories (cd) to /mnt/GPartedTemp
    # and list (ls -al) the files to see what's there.
    # Make another directory called GParted_Files on the Desktop
    sudo mkdir /home/your_name/Desktop/GParted_Files
    # Copy the GParted files to GParted_Files
    sudo cp -R /mnt/GPartedTemp/* /home/your_name/Desktop/GParted_Files
    # (If necessary) Change the ownership so you can have these files by:
    # sudo chown -R your_name:your_name /home/your_name/Desktop/GParted_Files
    # Then unmount the iso (note the spelling umount)
    sudo umount /mnt/GPartedTemp
    # To invoke root, use sudo (as I have above when necessary)


    Note 10: Find out how Kubuntu & GRUB see the flash drive

    Kubuntu (/dev/sdxn)
    Command: sudo fdisk -lu
    Command: cat /etc/mtab (for mounting)
    Command: mount (for mounting)
    Also, plug the flash drive into a USB port. After it is recognized, click OK to close the window that pops up.
    -- In your file manager (Konqueror/Dolphin): Storage Media or /Media. You will find device and mounting information.
    -- Also: Right-click on the flash drive icon, select Properties, you will see information about how it is mounted (e.g., /media/sdc1).

    GRUB (hdx,y)
    Example
    Open Konsole. To get a GRUB prompt, type
    sudo grub
    grub> geometry (hd<press the TAB key now>
    Possible disks are: hd0 hd1 hd2. Try hd2:
    grub> geometry (hd2)
    drive 0x82: C/H/S = 49600/5/32, The number of sectors = 7936000, /dev/sdc
    Partition num: 0, Filesystem type is fat, partition type 0xc
    That looks like the flash drive. (The other two disks are too big.)

    Note 11: Using GParted Live CD -- logistics
    In Kubuntu (or, with your PC on), place GParted CD in the CD tray. Close all open programs. Re-boot into GParted (BIOS must be set to boot first from CD ROM). When the GParted window appears, insert the flash drive, then GParted > Refresh Devices, select the flash drive from the drop-down list of your drives at the upper right. Partition and format as follows: To create the first partition, click on the unallocated space, Partition > New, set the size and type, OK, click the Apply icon to make it go.
    NEW flash drives or those that have been zeroed-out: You will be prompted to accept a DOD-like partition table (in the Master Boot record). If you are going to make the flash drive bootable with GRUB, accept this offer.
    Repeat this for other partitions. Then GParted > Quit, double click the red Exit button, Eject & re-boot -- OK, remove both the GParted CD and the flash drive, close the CD tray, OK, and wait for re-boot.
    In GParted:
    To learn about a partition, right-click > properties.
    Large icons across the top open with double-click.
    Terminal is useful, and can be used to access some programs (e.g., testdisk, partimage).
    When done, close the GParted window with File > Quit. Then double-click the Exit icon at top.

    Note 12: md5sum
    At Konsole, the command is:
    md5sum {name of file}.
    Then compare the result to the md5sum you downloaded at the site.
    Example: suppose the downloaded file is dlfile.iso and it is in your Desktop
    cd Desktop
    md5sum dlfile.iso
    Press Enter to get the MD5sum, something like this (as an example):
    260d2651ad2564748e37b468a848f1b2 dlfile.iso
    Compare it to the MD5sum published at the site where you downloaded dlfile.iso. If they don't match, repeat the download and compare again.
    Note: You have to change to the directory where the downloaded iso file is located.
    The command
    pwd
    means print the (current) working directory, which will tell you where you are when working at the command line.


    = = = = = = = = = = = = = = = = = = = =

    3 USB drive shifting: Very important!
    => the key to understanding how to use flash drives and external drives
    >>> After reading this, the main SGD /boot/grub/menu.lst will make sense to you.

    -- The drive hd0: first BIOS boot drive

    Useful Fact:
    Whenever a USB drive boots the PC, it is seen by BIOS and by GRUB as hd0.
    This is true whether the drive is a flash drive or an external USB HD.
    To emphasize this: Suppose you boot your PC using a bootable USB drive (flash drive or external USB HD). From the view of the GRUB on that drive, the drive is seen as hd0 -- the first BIOS boot drive. Thus, the other drives on your system are seen as hd1, hd2, hd3, etc. That is called “drive-shifting.” Your normal hd0 drive gets shifted to hd1; your normal hd1 drive gets shifted to hd2; etc.

    -- Drive shifting
    Your bootable flash drive as seen by Kubuntu, and as seen from the GRUB on the flash drive

    Take that same bootable flash drive. Set it on your desk. Boot into your Kubuntu as you normally do (without using the flash drive). Plug the flash drive in, let it be recognized by Kubuntu. Explore your drives using the GRUB geometry command:
    sudo grub
    grub>geometry (hd0)
    grub>geometry (hd1)
    grub>geometry (hd2)
    etc.
    You will see that the flash drive is seen not as hd0 but as something else.
    Example: Suppose you have two internal HDs, sda (=hd0) and sdb (=hd1). Then the flash drive will be seen as sdc = hd2 in Kubuntu.

    However, as we explained above, if you boot your PC using the bootable flash drive, from the view of the GRUB on that drive, during the session booted by the flash drive, the drive is seen as hd0; your normal hd0 drive is seen as hd1; your normal hd1 drive is seen as hd2.
    This is called “Drive shifting (as seen by the GRUB on your bootable flash drive when the flash drive boots the PC.”

    --- Super Grub Disk for USB -- usbshift -- special command for dealing with drive shifting
    > Your two options: to use SGD for USB or to manually adjust your device names for drive shifting.
    > usbshift and configfile

    The special SGD for USB includes a special function called usbshift.
    You do not have to use it, unless you care to.
    When you use it, it has the effect of shifting the drives back to their “normal” order, placing the flash drive at the end of the list (instead of the flash drive being hd0 at the front of the list).

    Example
    Suppose you have two hard drives sda = hd0 and sdb = hd1 in your PC. When you boot into Kubuntu, your flash drive is seen as sdc = hd2.
    Now, boot your PC using your bootable GRUB-SGD-USB flash drive (the one we just built).

    How does the GRUB on the flash drive see your drives (during the session booted by the flash drive)?
    Answer:
    If you do not use the usbshift function, the drives are seen as follows:
    hd0 is the flash drive
    hd1 is the drive you know as sda = the usual hd0 drive
    hd2 is the drive you know as sdb = the usual hd1 drive
    That is, the drives get shifted, they get bumped up one device number.

    If you use the usbshift function, the drives are seen as follows:
    hd0 is the drive you know as sda = the usual hd0 drive
    hd1 is the drive you know as sdb = the usual hd1 drive
    hd2 is the flash drive, which is how you usually see it when you are in Kubuntu
    That is, the drives retain their “normal” device naming you are used to and as seen in Kubuntu.

    -- Your two options: to use SGD for USB or to manually adjust your device names for drive shifting
    Example
    Let's say in your myLinuxMenu.lst (located on the flash drive in the folder /boot/grub), that you wish to boot an OS which is on the third partition of your second internal hard drive. Normally, you'd refer to that as (hd1,2) (e.g., sdb3).
    Thus, in the boot stanza for that OS, in myLinuxMenu.lst, you may refer to that operating system in two ways:

    title my OS on sdb3
    root (hd2,2)
    etc etc etc

    or:

    title my OS on sdb3
    usbshift
    root (hd1,2)
    etc etc etc

    => If you do not use usbshift, you must manually bump the hard drives up one place, from hd1 to hd2.
    => If you use usbshift, it will maintain your “normal” drive order for you (and put the flash drive at the end of your “normal” list of drives as hd2), and you may refer to the partition sdb3 as you normally do; ie., as (hd1,2).

    usbshift and configfile
    If you use usbshift before calling a configfile statement, the effect of usbshift “transfers through” the configfile to maintain your “normal” drive order.

    = = = = = = = = = = = = = = = = = = = =

    4 Appendix: Put GParted in with SGD
    Alternate way to partition for GParted: Put it in with SGD in partition 1
    You do not need a separate partition for GParted.
    Adjustments you need to make.

    If you wish, you do not need to put GParted in its own partition. You can put it into the first partition with the SGD files. Here's how:

    Partitioning
    Make the first partition 125 MB.
    Other partitions: It's up to you, for another OS (e.g., Puppy Linux) or for personal data.
    Label the first partition of the flash drive: Grub-SGD-GParted.

    In Kubuntu, open the GParted Live CD (or open the downloaded iso file), copy all the folders and files
    you see there into the first partition of the flash drive.

    Main SGD menu.lst (/boot/grub/menu.lst -- in partition 1, Grub-SGD-GParted)
    Include the following boot stanza for GParted:

    title GParted Live--Live Start Debian Live, partition 2
    root $(grub_device)
    kernel /live/vmlinuz1 boot=live union=aufs
    initrd=/live/initrd1.img

    That's all the chnages you need to make.

    = = = = = = = = = = = = = = = = = = = =

    5 REFERENCES

    How To GRUB Methods - Toolkit
    http://kubuntuforums.net/forums/inde...opic=3081671.0
    (Includes: Change default & timeout, make separate “GRUB boot partition,” etc.)
    See also the special topics under Reply #1.

    GParted: http://gparted.sourceforge.net/
    GParted how-to: http://www.howtoforge.com/partitioning_with_gparted

    Commands at Konsole: Beginners
    http://kubuntuforums.net/forums/inde...opic=3091607.0
    In 3 parts, new/improved, complete basic tutorial.

    dd Command
    http://kubuntuforums.net/forums/inde...opic=3090824.0
    Reply#2: dd APPLICATION Making a quick, free backup of your Kubuntu OS
    Tells you how to clone your flash drive--see Reply #1 Applications.

    Build a LIVE Kubuntu Flash Drive, How-To
    http://kubuntuforums.net/forums/inde...089474.new#new

    To Remove U3 from flash drive:
    http://www.sandisk.com/Assets/u3/launchpadremoval.exe
    http://www.u3.com/uninstall/final.aspx


    = = = = = = = = = = = = = = = = = = = = = = = =
    First version of this how-to, the original post, written April 11, 2007.
    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++

    How To: Make GRUB Thumb Drive (USB Flash Drive, or UFD)

    Making a bootable thumb drive with GRUB and your boot menu (menu.lst)
    Also, Super Grub Disk. (Optional: GParted; a FAT32 data partition; etc.)

    *** To put Linux operating systems on your UFD, scroll down. In particular, see “Simplifying your menu.lst and all the rest of it,” Reply #8, and Puppy follows that in Reply #9. You might wish to read Reply #8 now, before continuing. ***
    *** UPDATE: See Reply #10, October 23, 2007, for Update and improvements--better tutorial tips--Super GRUB Disk, GParted & Puppy on the flash drive. ***

    Note: This worked on my system: Intel D915GAVL Desktop Board; two SATA HDs: on sda1 is WinXP; on sdb, there are four Kubuntu OSs, Freespire, MEPIS. You may have to make adjustments specific to your setup (HDs, BIOS, and OSs).

    Notation, Abbreviations:
    HD=hard drive; OS=operating system; POST=Power On Self Test; SGD=Super Grub Disk; UFD=USB Flash Drive or “thumb drive”

    The issue: Usually, my two HDs are seen (by BIOS and GRUB) as hd0 and hd1. However, when you plug in the UFD, the drives get shifted, in my case the UFD becomes hd0, my hd0 becomes hd1, and my hd1 gets bumped to hd2. You can imagine the effect this has on the device references in your boot menu (/boot/grub/menu.lst).

    - - - - - - - - - - - - - - - - - - - -

    Method #1 The old-fashioned way using map commands.

    Conceptually, it’s simple: Format your UFD, copy GRUB files to it, use root & setup to install GRUB to the UFD, and finally, edit the menu.lst using the GRUB map command to account for the hard drive shifting described above. This last step can get complicated and messy. And if you make changes to hardware or software, you might also have to change the menu.lst and map commands.
    For this method see the following (and the links):
    - - Kubuntu Edgy -> Installation & Boot -> GRUB on Thumb Drive:
    http://kubuntuforums.net/forums/index.php?topic=12995.0
    - - Herman’s bigpond: http://users.bigpond.net.au/hermanzone/p15.htm
    - - At hardwareguys, Software -> Operating Systems -> GRUB on Thumb Drive:
    http://forums.hardwareguys.com/ikonb...ST;f=12;t=5353

    - - - - - - - - - - - - - - - - - - - -

    Method #2: An easier way using Super Grub Disk (SGD) (and its GRUB files). (See References below)

    SGD for USB uses an innovative command, usbshift, which fixes the hard drive shifting problem by restoring the original hard drive order (that exists normally without the UFD) and putting the UFD at the end of the list. In my example above, using usbshift, when I plug in the UFD, my two HDs are seen as they normally are, hd0 and hd1, and the UFD goes at the end of this list as hd2. There is no need for the complication of map commands in the menu.lst.

    - - - - - Here’s how to put SGD (and its GRUB using usbshift) on your UFD:

    Partition and format the UFD (see notes below on Partitioning/Formatting the UFD and GParted):
    (My BIOS is set to boot from CD first, in order.) Plug in the UFD. Wait for it to be recognized in Kubuntu (mine came up as: node /dev/sdc, mounted as /media/usbdisk). To format the UFD, I use GParted Live CD. Insert the GParted Live CD, re-boot, make a partition sdc1 and format it as Linux (ext2 or ext3). Remove the UFD, then properly exit GParted, removing the GParted CD when prompted, choosing re-boot.

    Boot into Kubuntu. Download the file sgd_0.9588_for_usb.tar.gz (or latest version) to the Desktop, right-click on it, Extract Here, and that gives a folder on your Desktop containing the SGD/GRUB files you need.

    (sudo: To do this work, you may need to use sudo. So you could open Konsole and use sudo before your commands; or at Konsole, type sudo konsole to get a terminal as root.)
    Insert the UFD. Wait for it to be recognized in Kubuntu. Open Konsole Then (hash mark # indicates a comment):

    # Make a directory called boot on your UFD:
    mkdir -p /media/usbdisk/boot
    # Copy the contents of the extracted sgd_usb_0.9588 to directory boot of the UFD:
    cp –r /home/myname/Desktop/sgd_usb_0.9588/boot/grub /media/usbdisk/boot
    cp –r /home/myname/Desktop/sgd_usb_0.9588/boot/sgd /media/usbdisk/boot
    # Unmount the UFD (note the spelling umount):
    umount /media/usbdisk
    # Get a grub prompt as root (it may take a couple minutes):
    sudo grub
    grub>
    # Make the sdc file a drive (my UFD is sdc = (hd2) in Kubuntu):
    device (hd2) /dev/sdc
    # Set up GRUB in the UFD using root-setup commands:
    grub> root (hd2,0)
    grub> setup (hd2)
    grub> quit
    $: exit

    Now, SGD is set up on your UFD. Re-boot, get into your BIOS setup (on my PC, I press the F2 key), and set your BIOS to boot from USB. On mine, I set it to boot from CD first, then the UFD, then my hd0. (With no CD in the tray), when the UFD is plugged in, the PC boots from it; when the UFD is not plugged in, the PC boots as usual from hd0. Save and Exit BIOS. The PC then re-boots from the UFD into SGD.

    - - - - - How to include your own menu.lst in the boot menu on the UFD

    Normally, my “main” OS is Kubuntu on sdb3, and the /boot/grub/menu.lst there is the boot menu you see when turning on the PC. (The GRUB from sdb3 is set up in the MBR of the first hard drive (hd0).)
    To include this menu.lst in the boot menu of the UFD, do the following (in Konqueror, or Konsole, or copy/paste or drag/drop).
    Off to the side, copy onto Desktop your own GRUB menu.lst; rename it myLinuxMenu.lst (or anything) and save it (as plain text or .txt).
    The SGD (on the UFD) contains a /boot/grub directory. Copy the file myLinuxMenu.lst into it:
    cp /home/myname/Desktop/myLinuxMenu.lst /media/usbdisk/boot/grub
    The SGD (on the UFD) also contains a /boot/grub/menu.lst. Open it (as root), and add a boot stanza entry to this menu.lst (I’m placing this in default position zero, but that’s up to you):

    # The SGD main /boot/grub/menu.lst for booting both my GRUB menu.lst and SGD on UFD
    default 0 # which is the myLinuxMenu.lst entry below
    timeout 10
    setgrubdevice # This sets the UFD as the grub device
    # and you may see other stuff up front, like gfxmenu
    # Then put the boot entry for your own menu.lst, such as:
    title myLinuxMenu.lst # Call it anything you want
    usbshift # this line is necessary
    configfile $(grub_device)/boot/grub/myLinuxMenu.lst

    (And following this comes all the “title” boot entries that come with SGD, and the main SGD menu. Save, Exit.)

    That’s it. Now, when you re-boot with the UFD plugged in, the boot menu you see will show both your regular menu.lst and other entries for SGD.

    - - - - - Partitioning/Formatting the UFD and allowing for other things like GParted on UFD

    The SGD with myLinuxMenu (above) took less than 2 MB. Using GParted Live CD to partition/format the UFD, you may want to include other things on the UFD, like a FAT32 data partition. GParted also comes in a USB version that you can put on UFD. I did that, by making two partitions:
    sdc1 (bootable) for SGD, including myLinuxMenu, and GParted (which took about 40 MB installed)
    sdc2 a FAT32 data partition

    Note: I formatted sdc1 as FAT16 because I believe (but am not sure) that GParted USB requires that. I don’t know if it’ll go into FAT32.
    Note: When GParted partitions sdc1, it starts sdc1 at sector 63, allowing space for the MBR (512 bytes) (plus the next 62 sectors empty, or 15 sectors for GRUB Stage_1.5).
    Note: With two partitions sdc1 and sdc2, in Kubuntu, the UFD shows up as 2 icons, /dev/sdc1 mounted as file /media/usbdisk and /dev/sdc2 mounted as file /media/usbdisk-1. (It may be the reverse of this, or something else on your system. I have two SATA HDs which show up as sda = (hd0) and sdb = (hd1), so the UFD shows up as sdc = (hd2).)

    - - Here’s the details for (one method of) putting GParted on the UFD:

    Do the partitioning/formatting of sdc1 and sdc2 (above).

    At the GParted site, download the gparted-liveusb-0.3.1-1.zip. Using ARK in Kubuntu, extract it to a folder on your Desktop. I called the folder GP0311usb. The contents of GP0311usb were 7 files: boot.cat, boot.msg, gparted, initrd.gz, linux, splash.lss, and syslinux.cfg

    Put GParted files and SGD in sdc1:

    Copy the contents of the folder GP0311usb to sdc1 of the UFD. Do this any way you want, at Konsole or in Konqueror (copy/paste, drag/drop). NOTE: I did not copy the folder itself, but only the 7 files contained in it. For some reason, that's the only way I could get it to work. Otherwise, I'd get a kernel panic when GParted tried to load. I tried using the folder and naming it in the kernel and initrd paths, like initrd $(grub_device)/GP0311/initrd.gz, but it would not go that way.

    Proceed exactly as above to put SGD and myLinuxMenu.lst into sdc1 and set up GRUB using root-setup.

    Summary so far:
    If you open sdc1, at the top level, you see the folder (from SGD) called boot; you also see the (7) GParted files laying there loose at the same level as the boot folder. Inside boot are two folders, grub and sgd. GRUB is setup in the MBR of the UFD to start the bootloading of both SGD and of GParted.

    Next step: Modify the SGD boot menu you see when you turn on the PC (the SGD /boot/grub/menu.lst file of sdc1, on the UFD) by adding a “title” boot entry for GParted. Do this edit as root and save your changes. Like the following:

    title GParted 0.3.1.1 for USB
    root $(grub_device)
    kernel /linux noapic root=/dev/ram0 init=/linuxrc ramdisk_size=65000
    initrd /initrd.gz

    That's it. Now with the UFD plugged in, re-boot. After the POST, up comes the SGD boot menu (/boot/grub/menu.lst), giving you choices of myLinuxMenu, GParted, Super Grub Disk, (and any other stuff you have included as a boot entry). Select one by highlighting it and press Enter.

    - - An example test: I used the GParted on this UFD to partition and format another USB thumb drive that was plugged into a second USB slot on the front of the PC case (which came up as sdd).

    - - - - - - - - - - - - - - - - - - - -

    Some details you may wonder about.

    - - - Where do these two lines come from:
    kernel $(grub_device)/linux noapic root=/dev/ram0 init=/linuxrc ramdisk_size=65000
    initrd $(grub_device)/initrd.gz
    Answer: Kind of by trial-and-error copying luck imitating hoping and pattern-matching

    One of the GParted files was syslinux.cfg, a plain text configuration file (some GParted also have a isolinux.cfg.) In there I found a kernel reference line. I separated out the initrd= part, and kept the rest for my kernel line, and used the initrd.gz of initrd=initrd.gz for my initrd line. You can google yourself nuts about kernel options, and even learn some things now and then. An expert could write those lines from scratch. But I can't yet.

    - - - usbshift command. Remember that you are using a special sgd_usb version of SGD/GRUB. So when you use it manually or otherwise, don't forget the usbshift.
    Example:
    With the GParted-SGD UFD plugged in, you re-boot and see the boot menu, and you decide to get a grub> prompt by pressing the “c” key. Then you type a command like configfile (hd1,2)/boot/grub/menu.lst (which is my Kubuntu on sdb3). You will probably get an Error 15: File not found or some other error. So, instead, use the following two lines:
    grub> usbshift # then press Enter, usbshift ensures that (hd1,2) makes sense in the next line
    grub> configfile (hd1,2)/boot/grub/menu.lst # then press Enter

    - - - To manage/extract the GParted zip file, I used ARK. In Kubuntu under K-Menu – Utilities – ARK Archiving Tool. Click Help to get ARK Handbook. It manages, extracts the gparted zip file.

    - - - UFD may come with software. My Memorex came with U3 which is neat, but to erase it go to www.U3.com/uninstall . (Must be in Windows to run this)


    References

    How-To GRUB Methods - Toolkit: http://kubuntuforums.net/forums/inde...opic=3081671.0
    GRUB: http://www.gnu.org/software/grub/
    Major credit to SuperGrubDisk: http://supergrub.forjamari.linex.org/
    (At the SGD site, go to Downloads and scroll to the USB section. Today, the latest version is 0.9588: sgd_0.9588_for_usb.tar.gz)
    bigpond at http://users.bigpond.net.au/hermanzone/p15.htm
    GParted Live CD at: http://gparted.sourceforge.net/livecd.php

    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    #2
    Re: How To: Make GRUB Thumb Drive

    How to install Kubuntu 7.04 to an external USB hard disk drive

    Comment
    >> I will make an effort to maintain this topic. It was written and tested for 7.04 but works also through 8.10. As time permits, I will try to clean it up, improve it, and tend to better formatting/organization.
    >> Refer to the first post above for more methods/details working with ANY external USB drive or flash drive.
    Edited 2-12-09

    Summary of Steps

    Step #1 Find out what your hard drives are named by Kubuntu and by GRUB
    Step #2: Set up your external USB HDD following the directions provided by the manufacturer
    Step #3: Install Kubuntu to the external USB HDD: Install GRUB carefully.
    Step #4: Configure BIOS
    Step #5: Configure GRUB
    Step #6: Optional: Configure other boot capabilities with the external USB HDD

    Things to keep in mind while reading this:
    You might want to read Section 3 of the first post (above):
    3 USB drive shifting: Very important!
    => the key to understanding how to use flash drives and external drives

    Abbreviations: HDD=hard disk drive; MBR=Master Boot Record; OS=operating system

    - - - - - - - - - -
    Details: Installing Kubuntu to your external USB HDD

    Example We'll use this example to demonstrate things.
    Assume you have two internal HDDs sda and sdb:
    sda (in Kubuntu) = hd0 (in GRUB) Windows is on (hd0,0) GRUB is installed to the MBR
    sdb (in Kubuntu) = hd1 (in GRUB) Kubuntu is on (hd1,4)
    Your external USB HDD will be seen as
    sdc (in Kubuntu) = hd2 (in GRUB)

    - - - - - Step #1: Find out what your hard drives are named by Kubuntu and by GRUB.

    In Kubuntu (or the Live CD), open K-menu > System > Konsole and type the command sudo fdisk -lu (and press Enter) to get a list of your drives/partitions as seen by Kubuntu. Use the geometry command to see how GRUB sees them: Get a GRUB prompt by typing sudo grub and press Enter (at Konsole), and type geometry (hd<press the TAB key>, and you'll get a list of your hard drives. (Note: This means you type geometry, then space, then the left parenthesis (, then type hd, then press the TAB key.) Investigate each drive by typing at the grub> prompt: geometry (hd0), press Enter; then do geometry (hd1); etc. (Note: GRUB numbers disk drives and partitions starting from zero. So hd0 is the first drive, hd1, is the second, etc.; (hd0,0) is the 1st partition of hd0, (hd0,1) is the 2nd partition of hd0, (hd1,4) is the 5th partition of the 2nd disk drive, etc.)

    - - - - - Step #2: Set up your external USB HDD following the directions provided by the manufacturer. (My motherboard does not support eSATA, so it doesn't support hot-swapping of the external USB HDD. That is, you must first turn off the PC before connecting the external USB HDD, and then shutdown before disconnecting the external USB HDD.)

    EDIT, 2-12-09: Use GParted Live CD and Rog131: How to Partition
    At this point, I recommend you use GParted Live CD to partition and format the drive.
    Do you want a separate home partition?
    Partitioning—how to, Rog131:
    http://kubuntuforums.net/forums/inde...opic=3090704.0
    Download/burn GParted Live CD--a very handy tool!
    GParted: http://gparted.sourceforge.net/

    Note--If you use GParted prior to installation, the installer may tell you it will re-format the root and swap partitions; if so, click OK.


    - - - - - Step #3: Install Kubuntu to the external USB HDD.
    *** The key point here is simple: Do it any way you wish, but make sure you have the installer put GRUB (the bootloader) in the MBR of the external USB HDD. ***

    -- Logistics. After doing Steps #1 and #2, install Kubuntu to the external drive using either the regular Live Desktop CD or the Alternate installer CD. I used the regular Live Desktop CD version for PCs (Kubuntu 7.04 Desktop-i386.iso) -- Download it (in Kubuntu), use K3b to burn the iso install CD, and check the MD5SUMS. Eject the CD. Shutdown the PC. Connect the external drive: Connect the power cord to the external USB HDD and plug it into your power source (wall outlet). Turn on the external USB HDD (using its power On switch). Connect the USB cable from the external USB HDD to a USB port on the PC. Turn on the PC. Boot into one of your operating systems. Insert the Kubuntu install CD in the CD/DVD tray, re-boot the PC, start up the Kubuntu 7.04 Live CD, select “Check this CD for Defects,” and let the PC re-boot, let the Kubuntu Live CD load up, click the Install icon on the Desktop, and work through the install steps, selecting the Manual partitioning method at the partitioning step 4:

    -- Installation Step 4 (of 6): Partitioning
    See my example above (yours may differ), where the external USB HDD shows up as hd2 = sdc.
    In Step 4 of the Kubuntu 7.04 install, I specified 3 partitions: root files (/) on (hd2, 0)=sdc1, 10 GB, ext3; /swap on (hd2, 1)=sdc2, 2 GB, ext3; and /home on (hd2, 2) =sdc3, 20 GB ext3.
    (NOTE: you must use the beginning slashes, /, as indicated; also select “Beginning” so your partitions start at the beginning of the available free space.)

    -- Installation Step 6 (of 6): GRUB. Click the Advanced button at lower right. This is your chance to tell the installer where to put GRUB. In the example, specify to install GRUB to "(hd2)" (with the parentheses but not the quote marks), which--on my setup--is the the Master Boot Record (MBR) of the external USB HD.

    Then finish the installation. Exit from the installer and remove the installation CD.
    This then completes “Step #3: Install Kubuntu to the external USB HDD.”
    Re-boot with the external USB HD still connected. But read Step #4 below first.


    - - - - - Step #4: Configure BIOS

    *** Your BIOS must support USB booting (boot from USB). ***
    As your PC re-boots (after the installation of Kubuntu), enter BIOS setup (on my Intel board, you press the F2 key). Enable USB booting. Include the external USB HDD in the list of hard drives, put it in the first-boot order (after the CD drive, and before the other HDDs). Save these edits, Exit BIOS, and continue booting.

    -- Booting problems: When you re-boot, if the PC does not boot from the external drive, try these tips:
    Make sure the boot flag is set on the root partition of the external drive where you installed Kubuntu. Use GParted to do this: Click on that partition, then Partition > Manage flags > boot.

    Also, re-boot again and try re-setting BIOS (or check your settings).

    Even when you do re-boot from the external HDD, you will (very probably) discover that although you get a GRUB boot menu, it doesn't work. You may get all sorts of errors (13, 15, 17, 22). To fix this, read on . . .


    - - - - - Step #5: Configure GRUB

    *** The main idea: On the UFD, in Kubuntu, there's a boot menu called /boot/grub/menu.lst, and on it is a boot entry for the Kubuntu you just installed. You must edit the Kubuntu boot entry so the root (hdx,y) statement is correct.

    -- How the drives get "shifted"
    (See my example above) When the PC boots from the external USB HDD, the drives are seen as follows (from the point of view of the GRUB on the booted external drive). The order or naming of the drives gets "shifted":
    The external USB HDD sees itself as hd0;
    The Windows drive (which was hd0) is seen as hd1;
    The Kubuntu drive (which was hd1) is seen as hd2.

    So, the newly installed Kubuntu is on (hd0,0). Why is it (hd0,0) and not (hd2,0)? When I installed Kubuntu on the external HDD, I specified (hd2,0) as the location of the root files. Reason: When I installed Kubuntu on the external USB HDD, the installer saw the drives as hd0 (Windows), hd1 (Linux drive), and hd2 (the external USB HDD). So, (hd2,0) refers to the first partition of the external USB HDD. But, now, * when the PC re-boots from the external drive *, the GRUB on the external drive sees the external drive as hd0. (In Kubuntu, the drive would still be seen as hd2=sdc.)

    -- So, in this example, the newly installed Kubuntu (root files) is on (hd0,0), and so in the menu.lst (on the external drive), its root statement should be root (hd0,0), followed by its kernel and initrd statements.

    -- Editing the boot menu on the external USB HDD, /boot/grub/menu.lst in the newly installed Kubuntu

    You can not yet boot into Kubuntu on the external drive, so how can you access and edit the /boot/grub/menu.lst there? Here are your choices:

    1 If you have another K/Ubuntu on an internal HDD, boot into it (manually or using BIOS), and edit menu.lst from there (by accessing the (mounted) external USB HDD, open /boot/grub/menu.lst as root, edit it, File>Save, File>Quit). (See Note below.)
    2 Easy method: Use Super Grub Disk (see References) to boot into any of your OSs and do the editing.
    3 Experienced users: Use a live K/Ubuntu CD to do the edits.
    4 Experienced users: When the failed boot menu appears, press "c" key, get a GRUB prompt, grub>, and boot manually into one of your OSs to do the edits.
    5 Experienced users: When the failed boot menu appears, perform edits using the "e" key, boot into an OS, then do the edits.

    Note: In Kubuntu, the external USB HDD actually shows up as three “mounted removable media,” usbdisk, usbdisk-1, and usbdisk-2 for /, /swap, and /home, respectively (yours may differ somewhat). So, open usbdisk (where the / files are), in Konqueror open media/usbdisk/boot/grub, right-click on menu.lst, Actions > Edit as root, do the edits, then File>Save, File>Quit.

    GRUB methods--see References for my How To GRUB Methods – Toolkit.

    -- Conclusion of Step #5: With GRUB configured, you can now boot from your external USB HDD into your newly installed Kubuntu -- You're done!

    Step #6: Optional: Configure other boot capabilities with the external USB HDD.

    You can set up any boot configuration if you understand the posts in this thread, Reply #8, “Simplifying your menu.lst and all the rest of it.” and drive-shifting, Reply #5. This work, on your external USB HDD, is done the same way we've done it for a flash drive (UFD) throughout this thread.

    -- Example 1: Boot your other OSs from the external USB HDD boot menu.
    To do this, you simply edit the /boot/grub/menu.lst of Kubuntu on the external drive to include proper boot entries for the other OSs.

    Windows. In our example above, to boot Windows on the internal (hd0,0), do this:
    Because of drive shifting, the GRUB on the external drive sees (hd0,0) as (hd1,0). But that puts Windows on a non-first drive, so an adjustment using the map command is needed.
    So make the XP boot entry look like this:
    title Windows XP
    rootnoverify (hd1,0)
    map (hd1) (hd0) # the map statements give the illusion that Windows is still on (hd0,0)
    map (hd0) (hd1)
    chainloader +1

    For the map dance, see either the GRUB manual or the GRUB How-to (see References).

    Kubuntu. Again, using our example, to boot Kubuntu on (hd1,4)=sdb5 from the GRUB boot menu on the external drive, do the following:
    Because of drive shifting, (hd1,4) becomes (hd2,4) viewed from the GRUB on the external drive. Access /boot/grub/menu.lst (on the external drive), edit the boot entry for Kubuntu on sdb5=(hd1,4) so the root statement becomes root (hd2,4).
    Note: You may find there is no such boot entry to edit!. So you have to put one there, then edit it for the drive-shifting. To do this, in Kubuntu (any Kubuntu), from the sdb5 Kubuntu menu.lst, copy the boot entry for this sdb5 Kubuntu and paste it into the Kubuntu menu.lst on the external USB HDD. Then edit the new boot entry, replacing root (hd1,4) with the drive-shifted version: root (hd2,4). (Do all this as root, and finish by File>Save, File>Quit).

    Booting other OSs from your external drive: Be patient -- the USB is not a fast connection -- it may take awhile after you click something. If you ever see a blank screen with a blinking cursor at the top left, or "Starting up," hang in there awhile (up to 3 minutes) before you conclude something is wrong.

    -- Example 2: Boot Kubuntu on the external USB HDD from your regular boot menu
    Using our example again, you need to edit your regular menu.lst (located at /boot/grub/menu.lst, usually in Kubuntu--on sdb5=(hd1,4)) to include a boot entry for the Kubuntu on the external drive. To do this, copy the boot entry from the external drive menu.lst to the menu.lst on sdb5=(hd1,4), then edit the root statement to read root (hd2,0). (Note: On the external drive menu.lst, Kubuntu is on (hd0,0) as seen from the GRUB there; but as seen from the sdb5 menu.lst, the external Kubuntu is on (hd2,0).)

    -- Example 3: Boot Kubuntu on the external USB HDD from a flash drive.
    You can do this one on your own; and if you read and understand the references, along with this thread, you CAN do it! (Just be aware that the order of the flash drive and the external drive may change, depending on which was connected first--it may be hd2=sdc & hd3=sdd, for the flash drive and the external drive, or the reverse of that.)

    - - - - - - - - - - - - - - -

    Extreme GRUB: Just as we did in the flash drive (UFD) examples of this thread, you can install the special GRUB from Super Grub Disk, super_grub_disk_usb, to the external USB HDD. Doing so eliminates the need for manual drive-shifting (no need for hdx --> hd(x+1) adjustments). If you do this, move the old GRUB out of /boot on the external drive before copying the new usb GRUB into /boot. Then setup the new usb GRUB on the external USB HDD MBR using, at a grub> , root (hdx,y), setup (hdz), quit – exactly as we've done in the UFD examples of this thread.
    (In our example, with two internal HDDs, the setup would be grub> root (hd2,0), grub> setup (hd2), grub> quit.)

    - - - - - - - - - - - - - - -
    Caveats and Tips:

    - - Your BIOS/motherboard must support USB booting.
    - - Don't forget to set the boot flag on the external USB HDD (do this using GParted).
    - - On the Intel D915GAVL Desktop Board), here's how the BIOS works:
    If you remove the external USB HDD and re-boot, the BIOS reverts to booting the first internal HDD as usual. If the external USB HDD is connected, BIOS automatically detects it and puts it at the top of the boot-order list and then boots from it. Your BIOS may work differently. You may have to enter BIOS and set it to boot from your external drive each time you boot.
    - - Sometimes a BIOS may seem to be just simply be a bit buggy. Sometime, you have to re-set your BIOS to make it work again. Sometimes, you may have to re-set your BIOS twice, or re-boot twice.

    - - - - - - - - - - - - - - - - - - - -
    References:

    GRUB manual: GNU GRUB Manual 0.97 at: http://www.gnu.org/software/grub/manual/
    (See map commands in Section 4.2.6, for Windows.)

    How To GRUB Methods – Toolkit http://kubuntuforums.net/forums/inde...opic=3081671.0
    See the Table of Contents in the first post.
    See also the topics in Reply #1.

    GParted: http://gparted.sourceforge.net/

    Partitioning—how to, Rog131:
    http://kubuntuforums.net/forums/inde...opic=3090704.0

    Super Grub Disk: http://supergrub.forjamari.linex.org/
    (Downloads -- scroll down to usb)

    If your BIOS does not support booting from USB, see this:
    https://help.ubuntu.com/community/BootFromUSB

    Finally, see the first post (above) -- The techniques used for the flash drive (UFD = USB Flash Drive) also work for an external USB HDD.
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: How To: Make GRUB Thumb Drive

      Sticky, plz?

      Comment


        #4
        Re: How To: Make GRUB Thumb Drive

        No need. I prefer this format. It's easy enough to search the How-To's here. But let's not use this space to discuss protocol. Thanks, Qqmike.
        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Re: How To: Make GRUB Thumb Drive

          Re: How to install Kubuntu to an external USB hard disk drive (HDD).

          - - On the Intel D915GAVL Desktop Board), here's how the BIOS works:
          If you remove the external USB HDD and re-boot (in any manner), the BIOS reverts to booting the first internal HDD as usual. If the external USB HDD is connected, BIOS automatically detects it and puts it at the top of the boot-order list and then boots from it. Your BIOS may work differently. You may have to enter BIOS and set it to boot from your external drive each time you want to do so.

          To clarify what I did and why, and how you would use the external USB HD, here’s an add-on comment:

          If you put Kubuntu on an external USB HD, when you want to use your Kubuntu, you’ll make sure the external USB HDD is properly connected to the PC and turned ON when you turn on the PC and boot-up; then the PC boots up using the GRUB on the external USB HDD. That should take you to your Kubuntu. If you don’t wish to use the Kubuntu on the external USB HD, you would disconnect/turn off the external unit, and you would boot up as you normally do without the external USB HDD (in my example, the boot menu would come from the GRUB installed to the MBR (hd0) of the XP drive sda).

          There may be no good reason to use the GRUB on the external USB HDD to boot any OS except the Kubuntu installed to the external USB HD. However, in the above post, you’ll notice that I did demonstrate how you would boot two OSs on the internal hard drives, both the Windows XP (on sda1) and a Kubuntu (on sdb5) *using the GRUB on the external USB HDD.* That was done only as an example to demonstrate the adjustments for the drive-shifting (for both XP and Kubuntu) and the map-dance (for XP). In practice, you may have no good reason to use your external USB HDD to boot OSs other than the one you installed on the external USB HDD.

          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #6
            Re: How To: Make GRUB Thumb Drive

            USB experiment: USB drive shifting

            Comment about this post:
            I won't be maintaining this post in the future. It is “as is.”
            This material is included now in the first post above.
            I have completely revised and improved the first post--the original post--
            of this thread and will try to maintain it.
            Reply #1: “Installing Kubuntu to an external HD “ --
            This material is still current and useful, and I'll make
            and effort to keep it up-to-date.
            2-12-09


            This seems obvious, but here's a naïve way to actually see how the USB drives are seen by BIOS and GRUB.

            This works for both a bootable UFD (USB Flash Drive, or thumb drive) that has GRUB installed to it and for a bootable external USB HDD that has GRUB installed to it. So I'll refer to either as a (bootable) USB device.

            *** See the above posts for any words or references that are not explained here.

            Connect the USB device to the PC. Restart the PC.
            [If necessary, enter BIOS setup, enable Boot from USB, and make the PC boot from the USB as first in sequence.]
            Boot up with the USB device then.

            At the GRUB menu (that comes from the GRUB on the USB device), press”c” to get a GRUB prompt.

            Now test your drives using the geometry command, starting with
            grub> geometry (<TAB key>
            for a TAB-completion, and you'll get a list of your drives, hd0, hd1, hd2, ...
            Now test each one, in turn, like geometry (hd0), then geometry (hd1), etc.
            and you'll see that the USB device comes up as hd0, and your normal hd0 drive comes up as hd1, your hd1 drive is bumped to hd2, etc. That's the drive shifting taking place when the USB device is present.
            * All this as seen by the GRUB installed to the USB device. *

            [Optional diversion: usbshift
            If adrian15's new GRUB from Super Grub Disk for USB happens to be installed to your USB device, then try:
            grub> usbshift # that's adrian15's new command in the GRUB on sgd_usb
            and then test your drives again using geometry:
            the usbshift command puts them back in the order we might expect.
            That is, hd0 is your normal hd0, hd1 is your hd1 drive, etc., and the USB device comes at the end (eg., it will be hd2 in the case where you have two “normal” internal drives in the PC).
            * All this as seen by the “new” SGD GRUB installed to the USB device. *
            That ends the Optional diversion.]

            Continuing with the experiment . . . and with the USB device still connected . . .

            Boot into your K/Ubuntu/Linux (by whatever means you have).
            Open a terminal (K>System>Konsole)
            Check out your drives by typing sudo fdisk -lu, then press Enter.
            Then get a grub prompt (by typing sudo grub), and check out your drives with geometry (hd0), geometry (hd1), etc.
            In your K/Ubuntu grub shell, * as seen by the GRUB installed to your K/Ubuntu *, your drives appear as they normally are, without any USB drive shifting, and the USB device comes at the end of the list (e.g., if you have two internal HDDs, hd0 and hd1 will be as they normally are, and your USB device will be seen as sdc (at sudo fdisk -lu) = hd2 (at geometry command).

            And so it is. Another GRUB adventure.


            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #7
              Re: How To: Make GRUB Thumb Drive

              Knoppix on USB Flash Drive (UFD) (See also Reply #7)

              Comment about this post:
              I won't be maintaining this post in the future. It is “as is.”
              It serves as another example of what can be done with flash drives.
              I have completely revised and improved the first post--the original post--
              of this thread and will try to maintain it.
              Reply #1: “Installing Kubuntu to an external HD “ --
              This material is still current and useful, and I'll make
              and effort to keep it up-to-date.
              2-12-09


              I used primarily GUI in Kubuntu 7.04. And I used GRUB for the bootloader; in fact, the “special” GRUB from Super Grub Disk for USB. Here's a general outline of what I did to get Knoppix on the flash drive and make it bootable by GRUB. This ties in with the first post and provides another example of making a bootable thumb drive using GRUB as the bootloader.

              - - - Step 1: Download Knoppix & MD5 sums, burn it to CD (using K3b) and test the live CD to make sure it works.
              http://www.knoppix.com/ (KNOPPIX_V5.1.1CD-2007-01-04-EN, 696.4 MB)

              - - - Step 2: Prepare the flash drive (minimum 1 GB). Remove U3, partition as FAT32 in GParted, and in GParted set a boot flag for sdc1 (Partition > Manage Flags).

              I used a 2 GB Memorex Travel Drive with U3. Remove U3:
              http://www.sandisk.com/Assets/u3/launchpadremoval.exe or http://www.u3.com/uninstall/final.aspx
              Partition in a way that ensures a proper Master Boot Record (MBR) is setup in the first sector (512 B) of the UFD. I used GParted to make one big FAT32 partition and get a MBR. The partition came up as sdc1 (I have two internal HDDs sda and sdb). The command at Konsole, sudo fdisk -lu, gave:
              Device Boot Start End Blocks Id System
              /dev/sdc1 63 3935924 1967931 b W95 FAT32
              (which *usually!* indicates a MBR since sdc1 starts at sector 63, 512 B = 1 sector)

              - - - Step 3: Copy the contents of the Knoppix CD into the UFD.

              I did this using GUI, Konqueror, drag/drop, cut/paste, whatever worked. You may use the more elegant and less clumsy CLI to do this. So, on the UFD, I now have /media/disk/ filled with stuff from the Knoppix CD (/media/cdrom0/). It takes awhile (700 MB @ 1 MB/s = 12 minutes). You may have to do some/all of this work with root privileges. (E.g., open Konqueror by kdesu konqueror; also use Right-Click > Actions > Edit as root; and so on.)
              (Note: When using file management methods in GUI (e.g., copy/paste, or Edit > Select All, or drag-and-drop), before doing so, always enable View > Show Hidden Files.)

              - - - Step 4: In the /boot directory on the UFD (/media/disk), put GRUB from Super Grub Disk (SGD) for USB, and go ahead and put all of the SGD files there as well (that way, you'll also have SGD on the UFD).

              Details: Get the SGD for USB (sgd_0.9588_for_usb.tar.gz) from: http://supergrub.forjamari.linex.org/
              Download that sucker to your Desktop, Right-Click, extract Here (by ARK), and you've got a folder called sgd_0.9588_for_usb, and inside that is a /boot folder, and inside that is the GRUB and SGD you need. Now simply copy all the contents (only the contents, not the /boot folder itself) of this /boot folder and paste them into the /boot folder of the UFD (which is actually the /boot folder that came from the Knoppix CD). (Check it now : On the UFD, /media/disk, you've got all those Knoppix files you copied from the Knoppix CD. There's a /boot folder there, too. Open that boot folder and you see: The isolinux folder from the Knoppix CD which we are NOT going to use; and all those files we copied from the sgd_0.9588_for_usb folder, notably including a grub folder and a supergrub folder.)

              - - - Set up (install) GRUB on the Master Boot Record of the UFD.

              My UFD shows up as sdc (in Linux) = hd2 (in GRUB). Check this for yourself at Konsole with the command sudo fdisk -lu and at a grub> prompt (sudo grub), geometry (hd<TAB Key>, then geometry (hd0), geometry (hd1), geometry (hd2), etc. Make sure you know which is your UFD.
              At Konsole, type sudo grub (and press Enter) to get a GRUB prompt. Then:
              grub> root (hd2,0)
              grub> setup (hd2)
              grub> quit
              $ exit

              - - - Edit the main menu.lst on the UFD to include a * workable * boot entry for Knoppix.

              To get this to work quickly, and not too concerned with finding an elegant solution, this is what worked:
              I found out at Knoppix site that it uses the standard linux kernel 2.6.19. To get kernel and initrd statements for the menu.lst, I looked at the configuration file (/boot/syslinux/syslinux.cfg) of the Knoppix bootloader Syslinux. It said this:

              DEFAULT linux
              APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt.gz nomce loglevel=0 quiet BOOT_IMAGE=knoppix
              TIMEOUT 300
              PROMPT 1
              DISPLAY boot.msg
              F1 boot.msg
              F2 f2
              F3 f3
              LABEL knoppix
              KERNEL linux
              APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt.gz nomce loglevel=0 quiet BOOT_IMAGE=knoppix
              . . . and a bunch more boot entries . . .

              I used that to construct the following boot entry for Knoppix:
              # These 7 lines are part of the Super Grub Disk GRUB for usb menu.lst and are needed, as is usbshift, for reasons I've explained elsewhere on this forum.
              default 0
              timeout 10
              setgrubdevice # This is compulsory
              #gfxmenu /boot/grub/message
              foreground ffffff
              background 0c00ff
              color white/brown yellow/cyan

              title Knoppix 5.1.1 # the details here come from /boot/syslinux/syslinux.cfg
              usbshift # necessary, it makes USB booting work very nicely
              root $(grub_device) # this refers to the flash drive
              kernel /boot/syslinux/linux root=ram0 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=79 nomce loglevel=0 quiet BOOT_IMAGE=knoppix
              initrd /boot/syslinux/minirt.gz

              Result: Didn't work. I don't know why, but it didn't like the root=ram0, and I'm researching this right now.
              Solution: Replace that part with
              kernel /boot/syslinux/linux root=UUID=XXXX-XXXX ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=79 nomce loglevel=0 quiet BOOT_IMAGE=knoppix

              where the UUID came from sudo blkid at Konsole in my sdb5 Kubuntu 7.04. (I tested this in Knoppix at a terminal and in another sdb6 Kubuntu at Konsole: same UUID comes up for the USB Flash Drive, as we would expect.)

              This points to an advantage of the UUIDs. The above kernel line also worked with root=/dev/sdc1, but I didn't like tying it to sdc1 (what if I had another USB device connected to the PC at the same time? which one would be sdc and which would be sdd? etc.). The UUID is a unique identifier and goes with that specific flash drive.

              - - - Other stuff and comments

              This is a work-in-progress, and I'll post more if I get more. If you get any, please post yours.

              -- I did not try using the syslinux bootloader, but I did set it up using the command sudo syslinux -s /dev/sdc1 from Konsole in Kubuntu, but it didn't go, and I got:
              sh: mcopy: not found
              syslinux: failed to create ldlinux.sys
              However, it did go from a terminal in the Knoppix on the UFD. Obviously, Knoppix has been souped-up with some helper scripts for this USB work and related.
              -- I have not yet been successful booting Knoppix on the UFD by chainloading from a grub>, but have come close (“Error: could not find kernel image”).
              -- I have not been successful getting a persistent /home on the UFD Knoppix, but I haven't tried appending the kernel option home=/dev/sdc1 (and for which I would try with the UUID instead of sdc1).
              -- I have not had luck using symlinks to the Knoppix kernel, but again, have only tried a couple obvious/easy things.
              -- I'm not sure I believe we should be doing this. Doesn't an OS belong on a HDD? Maybe not, perhaps, but this just seems clumsy. That may change as the software technology changes to make things seem, well, a bit more seamless.

              - - - - - - - - - -

              I consulted the following excellent How-To:
              http://www.knoppix.net/wiki/Bootable_USB_Key
              You might wish to try it on your system. I could not improve upon it if I tried all weekend. As expected (in Linux), parts of it worked for me, parts didn't, and some parts needed tweaking.
              He does it at the CLI in Knoppix. He uses syslinix as the bootloader. I gave up and just tried some common sense.

              Syslinux/Isolinux, why it's used for stuff like this:
              http://en.wikipedia.org/wiki/Syslinux
              http://syslinux.zytor.com/

              Linux on a pen drive (flash drive): http://www.pendrivelinux.com/
              Choices: http://distrowatch.com/

              HowTo: Install Feisty on a bootable USB Flash drive
              http://ubuntuforums.org/showthread.php?t=476302
              (good stuff)

              How To GRUB Methods - Toolkit
              http://kubuntuforums.net/forums/inde...opic=3081671.0
              (and the posts that follow the first post)
              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

              Comment


                #8
                Re: How To: Make GRUB Thumb Drive

                (Regarding Reply #6 above) Knoppix on UFD
                The boot stanza entry for Knoppix in the GRUB menu.lst on the UFD:

                I said that in the kernel statement I was unable to get root=ram0 to work.
                It will work if you also use an additional option on the kernel line: fromhd. So the final, workable boot stanza entry is:

                title Knoppix 5.1.1 # the details here come from /boot/syslinux/syslinux.cfg
                usbshift # necessary, it makes USB booting work very nicely
                root $(grub_device) # this refers to the flash drive
                kernel /boot/syslinux/linux root=ram0 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=79 nomce loglevel=0 quiet BOOT_IMAGE=knoppix fromhd
                initrd /boot/syslinux/minirt.gz


                Apparently, and I've read this in other places, Knoppix wasn't built to run on USB Flash Drive, but I've also read that it has been modified somewhat to do so lately. Whatever the reasons, on my system it looks like I need the kernel option fromhd to set the ramdisk as root.
                Thanks to adrian15 (Super Grub Disk project owner) for suggesting this.

                Note: The use of the UUID for the UFD also works and, therefore, is an option to try if you have problems.
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  Re: How To: Make GRUB Thumb Drive

                  Simplifying your menu.lst and all the rest of it

                  Comment about this post:
                  I won't be maintaining this post in the future. It is “as is.”
                  This material is included now in the first post above.
                  However, it may still be of use/interest to keep it here.
                  I have completely revised and improved the first post--the original post--
                  of this thread and will try to maintain it.
                  Reply #1: “Installing Kubuntu to an external HD “ --
                  This material is still current and useful, and I'll make
                  and effort to keep it up-to-date.
                  2-12-09


                  You can use the post above “USB experiment: USB drive shifting” (Reply #5) to simplify using your UFD to boot Linux operating systems. This applies also to the Linux OSs you’ve installed on an external USB hard drive (see post Reply #4 above).

                  If you are * only * going to use the UFD to boot OSs you've put on the UFD (and not boot OSs on your internal HDDs), then you can simplify things.

                  So, if you have OSs installed to your bootable UFD, the menu.lst on the UFD can use (hd0,0), (hd0,1), (hd0,2), etc., to refer to the UFD partitions. Furthermore, you do not need any special GRUB or the usbshift command or the setgrubdevice. You can copy the GRUB files from any GRUB Live CD you've burned. *** In fact, when you boot from ANY drive (internal, UFD, or external USB HDD), it is named hd0, and so all this applies. ***

                  Next . . .
                  If you understand this and are ready to put Puppy Linux on your flash drive, then proceed to the next post.
                  Or, if you wish to read a full guide on installing GRUB on your USB device using these principles, read on here . . .

                  - - - - - - - - - - - - - - - - - - - - - - - - -

                  Installing GRUB to Your Flash Drive or External USB HDD: Simplified Guidelines

                  This guide will help you decide how to set up GRUB on your flash drive, depending upon what you intend to use the flash drive for.
                  External USB HDDs: This is written for the flash drive (USB Flash Drive), but it also applies to setting up GRUB on your external USB hard disk drive.

                  Abbreviations: HDD = hard disk drive; MBR = Master Boot Record; OS = operating system; SGD = Super Grub Disk; UFD = USB Flash drive; #: in commands and boot menus, the # sign introduces a comment and is ignored by the command interpreter

                  - - - - - The Basic Decision Rule (This is all you really need):

                  -- If the UFD is used only to boot OSs located on the UFD, then you may install any GRUB, either from a regular SGD for CD or a special GRUB from a SGD USB file; i.e., from a super_grub_disk_usb download.
                  -- If the UFD is used to boot OSs on your internal HDDs, then you should use a special GRUB from a USB file. (It is possible to use any GRUB, though, but it is can be a mess--see below.)

                  Super Grub Disk Downloads: To get either the regular SGD GRUB or special super_grub_disk_usb, go to
                  http://supergrub.forjamari.linex.org/?section=download

                  - - - - - - - - - - - - - - -
                  Dedicated GRUB partition -- Installing GRUB/SGD to your UFD
                  It is good practice to partition the UFD using GParted and use the first partition as a dedicated partition for GRUB and/or SGD.
                  - - - - - - - - - - - - - - -
                  Cases: Here's a breakdown of various cases * based on how the UFD is to be used *. Following this are notes/tips about them.

                  - - - Case 1 UFD used only for Super Grub Disk (SGD):
                  Install the special GRUB from SGD--the latest version of super_grub_disk_usb.

                  - - - Case 2 UFD used only to boot OSs on internal HDDs:
                  Two choices (both will work, the first one 2a simplifies things for you):
                  2a Install the special GRUB from super_grub_disk_usb to the UFD.
                  2b Install any GRUB to your UFD, then adjust your menu.lst (on the UFD) to account for drive-shifting and adjust any other affected menu.lst's on your internal HDDs. This can be complicated and confusing. For examples, see:
                  Kubuntu Edgy -> Installation & Boot -> GRUB on Thumb Drive at
                  http://kubuntuforums.net/forums/index.php?topic=12995.0
                  and at hardwareguys, Software -> Operating Systems -> GRUB on Thumb Drive:
                  http://forums.hardwareguys.com/ikonb...ST;f=12;t=5353
                  - - - Case 3 UFD used only for GRUB and to call your own (regular GRUB) menu.lst to boot OSs on your internal HDDs:
                  This case is a sub-case of Case 2, and it is easier to use solution 2a (i.e., to install GRUB from super_grub_disk_usb) than it is to make all the menu.lst adjustments discussed in case 2b.

                  - - - Case 4 UFD used only to boot OSs and programs installed on the UFD (such as GParted, Puppy Linux, etc.):
                  Then you can use any GRUB on the UFD.

                  - - - Case 5 UFD used for all of the following:
                  - - for SGD
                  - - to call your own menu.lst (and/or to boot OSs directly that are on internal HDDs)
                  - - to boot OSs and programs you've installed on various UFD partitions
                  You should install the special GRUB from SGD--the latest version of super_grub_disk_usb.

                  - - - - - - - - - - - - - - -
                  Notes and Tips About the Five Cases

                  Example We'll use this example to demonstrate things:
                  Assume you have two internal HDDs sda and sdb:
                  sda = hd0 Windows is on (hd0,0) GRUB is installed to the MBR
                  sdb = hd1. Kubuntu is on (hd1,4)
                  and your flash drive:
                  sdc = assume the UFD is seen in Kubuntu as sdc = hd2.

                  Note: How the drives get "shifted."

                  When the PC boots using the UFD, the drives are seen as follows (from the point of view of the GRUB on the booted UFD). The order or naming of the drives gets "shifted":
                  UFD sees itself as hd0
                  The Windows drive (which was hd0) is seen as hd1.
                  The Kubuntu drive (which was hd1) is seen as hd2.


                  --- Cases 2, 2a: UFD used only to boot OSs on internal HDDs

                  Edits for Case 2a (for the special GRUB from super_grub_disk_usb):

                  In Case 2a, using the special GRUB from super_grub_disk_usb, you must edit the menu.lst from that GRUB (located at /boot/grub/menu.lst on the UFD) to include these two entries for Windows and Kubuntu:

                  title Windows on internal HDD (hd0,0)
                  usbshift
                  rootnoverify (hd0,0)
                  makeactive
                  chainloader +1

                  title Kubuntu on (hd1,4)
                  usbshift
                  root (hd1,4)
                  configfile /boot/grub/menu.lst

                  Note: Configfile will cause the menu.lst in Kubuntu on (hd1,4) to be called up, from which you will then select Kubuntu to boot.
                  Note: Instead of configfile, you can use the kernel and initrd statements that apply to your Kubuntu.
                  Note: The command usbshift is special to the GRUB from super_grub_disk_usb; it puts the drives back into their natural order: hd0 is the Windows drive, hd1 is Kubuntu, and the UFD is seen as hd2. This drive shifting is passed along through configfile to your menu.lst in Kubuntu so everything works as it should.

                  Edits for Case 2b (UFD used only to boot OSs on internal HDDs and you install any regular GRUB to your UFD):

                  In Case 2b, using the regular GRUB for CD-Rom, as mentioned, you must edit the menu.lst from that GRUB to include workable entries for Windows and Kubuntu.
                  To boot Windows on (hd0,0) from the UFD, include the following boot stanza entry for Windows in your UFD /boot/grub/menu.lst:

                  title Windows on (hd0,0)
                  rootnoverify (hd1,0)
                  map (hd1) (hd0)
                  map (hd0) (hd1)
                  chainloader +1

                  Note: The UFD sees the Windows partition as (hd1,0); thus the root (hd1,0) command. But since that puts Windows on a non-first HDD, we must use the two map statements.
                  (See the GRUB manual, Section 4.2.6; also see How To GRUB Methods - Toolkit
                  http://kubuntuforums.net/forums/inde...opic=3081671.0
                  Reply #12, Install Windows XP *after* Kubuntu, and install XP to a non-first hard drive)

                  To boot Kubuntu on (hd1,4) from the UFD, include the following boot stanza entry for Kubuntu in your UFD /boot/grub/menu.lst:

                  title Kubuntu on (hd1,4)
                  root (hd2,4) # The UFD sees the Kubuntu partition as (hd2,4)
                  kernel boot/vmlinuz-2.6.20-16-generic root=UUID=XXXXX ro quiet splash
                  initrd /boot/initrd.img-2.6.20-16-generic
                  boot


                  --- Case 3 UFD used only for GRUB and to call your own (regular GRUB) menu.lst to boot OSs on your internal HDDs
                  If you use the UFD only for GRUB and to call your own menu.lst (e.g., myLinuxMenu.lst which only boots OSs on your internal HDDs)), this case is a sub-case of Case 2. It is best to use solution 2a (i.e., install GRUB from super_grub_disk_usb) than it is to make all the menu.lst adjustments (to myLinuxMenu.lst) discussed in case 2b. When you use GRUB from super_grub_disk_usb, the boot entry for your myLinuxMenu.lst (located in /boot/grub/menu.lst on the UFD) is as follows:

                  setgrubdevice # this is necessary and should follow the timeout and default statements
                  . . .
                  title myLinuxMenu.lst – my own GRUB menu.lst to boot the OSs on my internal HDDs
                  usbshift
                  configfile $(grub_device)/boot/grub/myLinuxmenu.lst

                  Note: The command usbshift causes the listing of the drives to shift *as seen by the GRUB on the UFD * as follows: hd0 is your normal hd0 (Windows); hd1 is your normal hd1 (Kubuntu); and hd2 is the UFD. This drive order is then passed to and used by myLinuxMenu.lst--essentially putting the drives into their regular order and putting the UFD at the end of the list.

                  Note: The special GRUB from super_grub_disk_usb.
                  The statement setgrubdevice sets the UFD as the "grub_device." The configfile statement uses $(grub_device) as its root device, where the variable device name $(grub_device) refers to the first partition of the UFD (where the GRUB is). The statement usbshift, the variable $(grub_device), and the statement setgrubdevice, are special features of the GRUB from super_grub_disk_usb.

                  Note: *** You will store your menu.lst, called myLinuxMenu.lst, as a text file, on the first partition of the UFD, along with the files from super_grub_disk_usb (i.e., all this is placed in /boot/grub/ on the UFD's first partition).


                  --- Case 4 UFD used only to boot OSs and programs on the UFD (such as GParted, Puppy Linux, etc.):
                  Then you can use any GRUB on the UFD.
                  In the menu.lst of the UFD, you will refer to the partitions of the UFD (where you've placed your programs and OSs) as (hd0,0) for partition 1, (hd0,1) for partition 2, (hd0,2) for partition 3, etc. You will NOT use usbshift before these root statements.
                  For example, the boot entry for an OS on the second partition of the UFD would have this form:
                  title An OS on the 2nd partition of this UFD
                  root (hd0,1)
                  kernel /boot/etc etc
                  initrd /boot/etc etc
                  boot # actually, "boot" is optional in a menu.lst (but is required at the command line)

                  and you would copy the /boot files (including the kernel and initrd) from that OS and all the other OS files into the second UFD partition.


                  --- Case 5 Suppose you use the UFD for all of the following:
                  - - for SGD
                  - - to call your own menu.lst (and/or to boot OSs directly that are on internal HDDs)
                  - - to boot OSs and programs you've put on various UFD partitions

                  Then install the special GRUB from SGD--the latest version of super_grub_disk_usb. That makes SGD work, and it makes myLinuxMenu.lst work easier.

                  Note: The general UFD menu.lst for Case 5

                  The menu.lst on the UFD (in /boot/grub) will look something like the following:
                  # Introductory stuff etc etc
                  timeout = 10 seconds
                  default = 0 # This makes myLinuxMenu.lst the default choice
                  setgrubdevice # equals this UFD -- This is necessary to use the $(grub_device) variable

                  title myLinuxMenu.lst – my own GRUB menu.lst to boot the OSs on my internal HDDs
                  usbshift # necessary since myLinuxMenu.lst boots OSs on internal HDDs
                  configfile $(grub_device)/boot/grub/myLinuxMenu.lst

                  title Another of your programs (like GParted) or an OS on the UFD (e.g., Puppy Linux)
                  root (hd0,x) # The UFD partition x where you installed this OS
                  configfile /boot/grub/menu.lst
                  # Or, use root, kernel and initrd statements that apply to the OS

                  title Super Grub Disk (SGD)
                  usbshift # necessary since SGD boots OSs on internal HDDs
                  configfile $(grub_device)/boot/sgd/sgd.lst

                  - - - - - - - - - - - - - - -
                  Installing GRUB to the UFD to make it work!

                  When you copy any GRUB files to the UFD, you must "install" that GRUB to make it work. Using our example, where the UFD is seen as sdc = hd2 from your Kubuntu, you do this as follows:
                  In Kubuntu, open Konsole (K-Menu>System>Konsole).
                  Type sudo grub to get a grub prompt, grub>. At the grub> type each of these commands followed by Enter:
                  grub> root (hd2,0)
                  # (hd2,0) is partition 1 of the UFD where you put the GRUB files from super_grub_disk_usb
                  grub> setup (hd2) # (hd2) is the MBR of the UFD
                  grub> quit
                  $ exit

                  - - - - - - - - - - - - - - -
                  Other examples: See the various posts in this thread!
                  - - - - - - - - - - - - - - -
                  References

                  How To GRUB Methods - Toolkit
                  http://kubuntuforums.net/forums/inde...opic=3081671.0
                  Scroll down, after the first post for various topics:
                  How to make a separate “GRUB boot partition.” (Dedicated to the GRUB files and make your PC boot from those GRUB files) 7-8-07
                  Install Windows XP *after* Kubuntu, and install XP to a non-first hard drive: map command 7-24-07
                  Dedicated GRUB partition. Recent experience with it. Install Kubuntu 7.04. Two HDDs. 9-19-07.

                  GRUB manual:
                  GNU GRUB Manual 0.97: http://www.gnu.org/software/grub/manual/

                  Super Grub Disk Downloads:
                  http://supergrub.forjamari.linex.org/?section=download

                  An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                  Comment


                    #10
                    Re: How To: Make GRUB Thumb Drive

                    Puppy Linux on USB Flash Drive (UFD) . . . (and booting Linux OSes on your UFD)


                    - - - - - Automatic Puppy install to UFD

                    First, get the Puppy CD download, burn the Live Puppy CD, run it, and go to the following menu selection: Puppy Menu > Setup > Puppy Universal Installer

                    You have every choice here you can imagine, installing Puppy to all sorts of places. If you wish, you can install a bootloader (Syslinux/Extlinux) to the Master Boot Record (MBR) of the UFD, or you can install Extlinux to the Puppy root partition and use another bootloader in the MBR. (For old/quirky BIOSes: Interestingly, you can use the Universal Installer to install a superfloppy mode to your UFD, where you have no MBR, no partitions, and the drive is accessible as /dev/sdc (no partition designation).)

                    So, to use this option, first, do as usual: Use GParted to partition & format the UFD (FAT32 seems to be the usual choice--?). That gives you a MBR and a partition. Set the boot flag on that partition (Partition > Manage flags > boot). And it's ready. I'm sure the Universal Installer will also partition/format the UFD for you, too, and maybe help set the boot flag by a call to GParted.
                    *** See my tip about GParted at the end, in the references.


                    - - - - - Manual install of Puppy to UFD, using Syslinux/Extlinux as the bootloader: You're on your own here. See the Syslinux reference below for learning the commands to do this. I've done it just once, it's very easy (a one-line command at Konsole), but I wouldn't pretend to know much about it.


                    - - - - - Manual install of Puppy to UFD, using GRUB as the bootloader

                    NOTE: I'm including this for two reasons: (1) You may prefer to use GRUB; and/or, (2) GRUB is a general bootloader, and you may wish to use it if you also intend to put other OS's on this same UFD.
                    ***If you are using the UFD only for FAT32 data storage and for Puppy, and especially if you don't care to play with GRUB, then, certainly, consider using only the Puppy Universal Installer to make the UFD bootable with Syslinux/Extlinux.

                    Now, back to using GRUB:
                    The Flash-Puppy page (see links below) tells you a lot, but it doesn't tell you about the kernel option PMEDIA=usbflash (which I learned by watching carefully for such while clicking the menus of the Universal Installer).

                    To manually install Puppy to your UFD, and also to use GRUB as the bootloader, follow these steps:

                    - - Use GParted to partition and format the UFD as FAT32 and set the boot flag on that partition (Partition > Manage flags > boot). For this example, *in Kubuntu and in GParted * the UFD is seen as hd2 and the Puppy partition on the UFD is the second partition, (hd2,1). (Note that I have two internal HDDs on this PC, hd0 and hd1. Yours may be different, but you get the idea.)

                    - - Download Puppy CD, check MD5 sums, burn the CD, run the CD to test it, eject CD, then go to your K/Ubuntu. Insert the CD, right-click Open the CD on the Kubuntu Desktop. Plug in the UFD and Open the partition to be used for Puppy. Now copy all the (top-level) Puppy files you see into the open UFD partition. (Or use CLI--Konsole for this work.) (Note: When using file management methods in GUI (e.g., copy/paste, or Edit > Select All, or drag-and-drop), before doing so, always enable View > Show Hidden Files.)

                    - - Set up GRUB:

                    Get any recent Super Grub Disk file from http://supergrub.forjamari.linex.org/
                    Download it to your Desktop, Right-Click, Extract Here (by ARK), and you've got a folder, and inside that is a /boot folder, and inside that is the GRUB you need. Now simply copy the /boot folder and it contents into the Puppy partition of the UFD. (In particular, you'll now have a grub folder inside /boot.)
                    * Alternative way: Use any GRUB! In your Kubuntu you have GRUB files under /boot (in Konqueror); simply copy all of them into your UFD.

                    Set up GRUB in the MBR of the UFD, as usual, as follows. At Konsole:
                    Again, first make sure you know how GRUB (and BIOS) sees your UFD. My UFD shows up as sdc (in Linux) = hd2 (in GRUB) (note: I have two internal hard drives hd0=sda and hd1=sdb). Check this for your system at Konsole with the command sudo fdisk -lu and at a grub> prompt (sudo grub), geometry (hd<TAB Key>, then geometry (hd0), geometry (hd1), geometry (hd2), etc. And/or use GParted to figure it out. Make sure you know which is your UFD.

                    To set up GRUB in the MBR of the UFD, at Konsole, type sudo grub (and press Enter) to get a GRUB prompt. Then:
                    grub> root (hd2,1) # assumes the Puppy partition is (hd2,1) where the GRUB files were copied to
                    grub> setup (hd2) # assumes the UFD is (hd2)
                    grub> quit
                    $ exit

                    Finally, edit the /boot/grub/menu.lst to include a boot stanza entry for Puppy that looks like this:

                    title Puppy on Flash Drive Version 2.17
                    # Some of this comes from the Puppy isolinux/syslinux.cfg file on the CD that you can Open on your Desktop
                    # Note the use of the kernel option PMEDIA=usbflash --
                    # I saw the PMEDIA=usbflash option from the Puppy Universal Installer when running the Puppy Live CD
                    root (hd0,0) # the Puppy partition on the UFD #see Technical Note below in the text here
                    kernel /vmlinux root=/dev/ram0 PMEDIA=usbflash
                    initrd /initrd.gz

                    * This assumes you have a menu.lst built! If not, build one here by copying one from your Kubuntu /boot/grub/menu.lst and deleting everything but the header lines, and include the timeout and default lines.
                    Remember to save this menu.lst as txt but do NOT put a .txt extension on it. So you’d Save As, menu.lst, file type (from the drop-down list) is text or .txt. (That is, don’t type the name as menu.lst.txt !)

                    Finally, in menu.lst, File > Save, then File > Quit.

                    A Technical Note:
                    Refer to the previous post about how we can simplify this menu.lst when we are using the UFD only to boot operating systems we’ve put on the UFD – NOT to boot OSes that are on your internal hard drives. As you build this UFD, if you look at it in GParted or in Kubuntu, it looks like hd2 (if you already have two internal hard drives). But after the UFD is built and bootable, when you actually * boot your PC with it*, it will be named hd0 (as will any drive that boots the PC). [End of Technical Note]


                    (Caution: In the various Puppy files, you may run into something like this:
                    default puppy / label puppy / kernel vmlinuz / append root=/dev/ram0 initrd=initrd.gz pmedia=cd /etc. The pmdedia=cd won't work, nor will =hd, nor do other guesses you might make.)

                    Test it:
                    Close all open windows in Kubuntu. Leave the UFD connected. (And right-click and select Safely Remove or unmount it, but leave it physically connected.) Re-boot, enter BIOS setup, enable Boot from USB, set the hard drive list to include the UFD, set the boot sequence to be CD ROM first, then the UFD, then whatever you wish, Save & Exit BIOS, and re-boot to see your GRUB boot menu, choose Puppy, and off you go. -- Your Manual Install of Puppy with GRUB is done.

                    - - Updating Puppy
                    The way I'd do it is to simply reformat the Puppy partition, download a new version, and install it as we did here. Clean and quick. Make sure your data partition is in the clear, and backed up.

                    - - Modification/Option: Make a separate GRUB partition
                    If you wish, you can set up a separate GRUB partition as the first partition on the UFD, (hd0,0), and Puppy then would go on the second partition (hd0,1). For this, see:
                    How To GRUB Methods - Toolkit
                    http://kubuntuforums.net/forums/inde...opic=3081671.0
                    (Scroll down to: July 8, 2007 – Reply #10)

                    - - Modification/Option: Put more than one OS on the UFD.
                    Repeat what you did for Puppy. Of course, you must make the partition(s) you need (using GParted)). Your second OS would be referenced as root (hd0,1), the third as root (hd0,2), etc. (If you use a separate GRUB partition (see the note above), then it will be in (hd0,0) and your OSes will start at (hd0,1), (hd0,2), etc.) ** Allow for any separate FAT32/ext2 data partitions you may need!!!

                    I did this recently, putting the following on a (GRUB-bootable) UFD (Memorex 2 GB):
                    Partition 1 GRUB files 100 MB root (hd0,0)
                    Partition 2 Puppy Linux 200 MB root (hd0,1)
                    Partition 3 INSERT Linux 130 MB root (hd0,2)
                    Partition 4 Extended
                    Partition 5 Knoppix 1 GB root (hd0,4)


                    - - Modification/Option: Chainload Puppy from a separate GRUB partition.
                    You can also set up a separate GRUB partition in (hd0,0) on the UFD and chainload Puppy from it. So in the menu.lst on (hd0,0) (in the GRUB partition of the UFD), for Puppy, you’d have:

                    title Puppy
                    root (hd0,1) # that’s where Puppy would be installed to
                    chainloader +1

                    * For this to work, you must have some bootloader set up in the Puppy partition (hd0,1). You have (at least) two easy choices to do this:
                    (1) Install Puppy to (hd0,1) (but in Puppy Installer it will be seen as something else, like sdc2) using the Puppy Universal Installer and have the installer install a bootloader (Syslinux/Extlinux) to that same Puppy partition (hd0,1) (=sdc2) and NOT to any Master Boot Record!
                    Or,
                    (2) Put Puppy on (hd0,1) any way you wish (manually or using the Puppy Universal Installer), then you can install a GRUB there too and set it up in (hd0,1) (using root – setup commands). That makes this partition ready to be chainloaded from your GRUB in the GRUB partition (hd0,0). For details, see:
                    How To GRUB Methods – Toolkit http://kubuntuforums.net/forums/inde...opic=3081671.0


                    - - - - - Notes

                    - - Bootable note:
                    You need three things to make the UFD “bootable”: (1) Your BIOS must support Boot from USB, and you must enable it in BIOS Setup; (2) You need a bootloader installed to the MBR of the UFD; and (3) You must set the boot flag for the partition (GParted > Manage flags > boot).

                    - - GRUB facility: In Puppy, Puppy Menu > System > GRUB bootloader config.
                    (Plenty of experiments to be conducted there. Looks very interesting.)

                    - - Working as root in Kubuntu GUI:
                    When all else fails (like permissions that hassle you and you can't or don't know how to change), try opening Konqueror with root privileges using the command at Konsole, kdesu konqueror. When opening a text file to edit, you also have right-click > Actions > Edit as root. At Konsole, sudo su always gets you a root prompt, even if it might be a naughty thing to do. Of course, at Konsole, sudo -i gets you a root terminal, if that helps (but it wouldn't let me open konqueror afterwards, not that day).

                    - - - - - - - - - - - - - - -
                    References

                    (*** see the last one on special Puppy solutions to minimize re-write UFD cycles—the article is reproduced for you here along with the link ***)

                    Puppy Home: http://puppylinux.net/index.html
                    Flash-Puppy page: http://puppylinux.net/flash-puppy.htm
                    Download page (including MD5 sums): http://puppylinux.net/download/downpage.htm
                    (- - > Read the readme re puppy-2.17-seamonkey-fulldrivers.iso 83MB versus puppy-2.17-nolzma-seamonkey-fulldrivers.iso 93MB – the latter is better)

                    http://www.puppylinux.org/user/viewpage.php?page_id=1
                    (helpful site)

                    To remove U3 from your flash drive:
                    http://www.sandisk.com/Assets/u3/launchpadremoval.exe or
                    http://www.u3.com/uninstall/final.aspx

                    GParted: http://gparted.sourceforge.net/
                    *** Get the Live CD. If you use a GParted that you install and run from your K/Ubuntu, it will at times drive you nuts and give you errors. The UFD gets mounted, GParted pops up windows asking you what to do, you close them, but GParted has locked the partitions, you then have to right-click unmount each partition to work on it, on and on, no end of it; and you may get errors that normally you would not get. That's my experience, fwiw.

                    How To GRUB Methods - Toolkit
                    http://kubuntuforums.net/forums/inde...opic=3081671.0

                    Syslinux/Extlinux: To manually install Puppy to your UFD and use Syslinux/Extlinux as your bootloader, learn the commands to set up Syslinux (to the MBR) at http://syslinux.zytor.com/ .

                    UFD life cycle:
                    http://www.getusb.info/what-is-the-l...sb-flash-drive

                    - - - - - - - - - -
                    *** Puppy: Special solutions to minimize UFD re-write cycles.

                    I had a hard-darned time finding this for the second time, so I'm going to reproduce it here for you, along with the link (which is somewhat tough to chase down):

                    http://puppylinux.org/wikka/FlashDetail
                    The following, to the end of my post here, is a direct quote, (a blanket sic invoked!):

                    Flash memory has only about 100,000 write cycles. After that the particular cell cannot be overwritten reliably. At least some devices (CF) have automagical management of errors and remapping, and "wear leveling" features to keep one spot from burning out from overuse.
                    Standard Linux make frequent wite to log files such as /var/adm/log /usr/log and others.
                    Any Linux suitable for flash memory sticks (called "flash puppy" or Linux-on-a-stick) must therefore reduce writes to the mem-stick by:
                    * using ram-disk
                    * using ram-disk and union-fs (as in puppy 1.0.1)
                    * allowing for read-only switchable mem-sticks (with a little mechanical switch on the case of the stick)
                    * using swap partitions
                    flash-puppy once started up leaves the USB stick totally alone, preserving its lifetime, so you can even pull it out, e.g. for security concerns. On shutdown it wants to write all new and downloaded files in the home dir (/root , as you are the user "root" typically) back to the stick - if it is not plugged in, changed data from /usr ( /root/.usr/) and homedir is lost. In some cases this might even be desirable (virus or whatever).
                    flash-puppy uses ram-disk only and does not write log-files or stuff to flash-mem like hard-drive based linuxes or other live CD's, given enough RAM e.g. 256 RAM with 128 stick, 512 MB RAM w/ 256 MB USB pendrive.
                    It is possible to write to the stick manually, though, which would typically be infrequent.
                    This is why it is not advisable to just remaster KNOPPIX onto a flash-stick, because the stick would soon be rendered unusable. Some computer magazines in print seemingly are unaware of the fact that there are these special solutions to the linux-on-a-stick problem - worked out already. [end quote]

                    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                    Comment


                      #11
                      Re: How To: Make GRUB Thumb Drive

                      Update Building a useful flash drive (UFD) -- with tutorial improvements for new Kubuntu users

                      Comment about this post:
                      ==> It shows how to include Puppy on your Grub-SGD flash drive.
                      I won't be maintaining this post in the future. It is “as is.”
                      This material is included now in the first post of this thread (but the OP does NOT include Puppy).
                      I have completely revised and improved the first post--the original post--
                      of this thread and will try to maintain it.
                      Reply #1: “Installing Kubuntu to an external HD “ --
                      This material is still current and useful, and I'll make
                      and effort to keep it up-to-date.
                      2-12-09



                      Project: To put Super Grub Disk (SGD), GParted, and Puppy Linux on a flash drive.
                      SGD is a leading boot rescue tool; GParted a leading partition editor; and Puppy Linux is a popular, compact 80-90 MB Linux distro.

                      Abbreviations: CLI=command line interface, refers to using Konsole; HDD=hard disk drive; GUI=graphical user interface, using Konqueror for file management; MB=megabyte; OS=operating system; SGD=Super Grub Disk; UFD=USB flash drive (thumb drive, pen drive, etc.);

                      - - - Overview:
                      Get (Download) SGD, GParted, and Puppy Linux
                      Prepare the UFD: Remove U3 (if necessary). Use GParted to partition and format the UFD
                      Using CLI--Konsole--Put SGD, GParted, and Puppy files on the UFD
                      Set up GRUB on the UFD and setup the boot menu
                      You're done. Test it now.
                      Then, more tips & tutorial Notes

                      See Note 1: BIOS setup issues -- Read & make a note of this Note!
                      - - - - - - - - - - - - - - -

                      - - - - - Download Super Grub Disk (SGD) to your Desktop, Extract the files.

                      Main SGD page: http://supergrub.forjamari.linex.org...n=download#usb
                      Latest USB: English: super_grub_disk_english_usb_0.9657.tar.bz2 (303.7KB)

                      Download that file to your Desktop. Right-click on it, select Extract Here, you get a folder on Desktop (folder called "boot"; this may vary on the SGD version). Inside this folder are the SGD-GRUB files we need to make the UFD bootable and usable.

                      See Note 2: Compressed files (bz2 & bzip) and Ark in Kubuntu.
                      See Note 3: Using the special SGD USB.

                      - - - - - Download the GParted Live CD (iso file); burn it to a CD.

                      Main GParted page: http://gparted.sourceforge.net/

                      The latest version is gparted-livecd-0.3.4-9.iso (50.4 MB). Burn this downloaded file to a CD as an image (.iso) file. This is a handy live CD, and our other goal is to access the GParted files to copy them to the UFD.
                      See Note 4: Use K3b to burn your GParted Live CD.

                      - - - - - Get Puppy Linux

                      Main Puppy page: http://www.puppylinux.com/,
                      Get the latest Live CD version: puppy-2.17-nolzma-seamonkey-fulldrivers.iso (93.1 MB)
                      Make sure to check the MD5 sum. See Note 5: Md5 Checksum for Puppy--How to check it.

                      We need to access the Puppy files and copy them to the UFD. One way is to burn the iso image (puppy-2.17-nolzma-seamonkey-fulldrivers.iso) to a bootable CD, then in Kubuntu, open the CD to access the files. Another way without burning a CD is explained in Note 6: Accessing files on a downloaded iso file.

                      So, let's assume we have done that (using Note 6) and the Puppy files are on our Desktop in a folder we named Puppy_Files.

                      - - - - - So far, we have all the files we need to build the UFD: SGD, GParted, and Puppy

                      - - - - - Prepare the UFD

                      - - If it came with U3, you may wish to remove U3. See References at the end.
                      - - Partition and format the UFD using GParted Live CD.
                      With your UFD plugged in, find out how Kubuntu sees your UFD: See Note 7. It sees mine as sdc. Put the GParted CD in the tray, close the tray, re-boot into GParted and setup the following partitions: (Partition--Size--Format Type--Contents)
                      1st partition, sdc1 10 MB ext3 SGD and GRUB
                      2nd partition, scd2 100 MB FAT32 GParted
                      3rd partition, sdc3 150 MB FAT32 Puppy

                      See Note 8: Using GParted Live CD -- logistics
                      See also the GParted tutorial in References.

                      - - - - - Build the UFD as planned:
                      Using CLI--Konsole--Put SGD, GParted, and Puppy files on the UFD.
                      Set up GRUB on the UFD and setup the boot menu.

                      - - - Preparation: Find out the Kubuntu mount points for the UFD's partitions.

                      Plug the UFD into a USB port on the PC case. Find the "mount points" of the 3 UFD partitions. In this example, the first partition sdc1 came up "mounted" as /media/disk (as seen in Konqueror--Storage Media), and sdc2 as /media/disk-1, and sdc3 as /media/disk-2.
                      (Caution: If you build the entire UFD in one Kubuntu session without re-booting, the naming of these mount points will not change. However, if you build sdc1 with SGD & GRUB and re-boot to test it before building sdc2, the mount points may change. Be aware of the change and modify your commands accordingly.)

                      Konsole: You will do this work by typing commands at a terminal called Konsole in Kubuntu. In Konsole, anything preceded by the pound sign "#" is a comment and is ignored by the command interpreter. Open Konsole at: K-Menu > System > Konsole. For command-line basics, see tuxfiles and psychocats in References.

                      - - - Copy SGD, GParted, and Puppy files to the 3 UFD partitions and set up GRUB

                      # First, copy the SGD files in the boot folder (on your Desktop) to the first partition of the UFD
                      # My first UFD partition is mounted as /media/disk
                      # The following creates a new directory /media/disk/boot on the first partition of UFD
                      # and copies the contents of the extracted SGD boot folder into it
                      sudo cp -r /home/mike/Desktop/boot /media/disk/boot
                      #
                      # Next, copy the GParted files into the 2nd UFD partition
                      # In my example, that is partition sdc2, mounted as /media/disk-1
                      # When I put the GParted CD in the tray, it is mounted as /media/cdrom0 (as seen in Konqueror)
                      # Copy the entire contents to sdc2 (the wild card "*" means "all contents")
                      sudo cp -r /media/cdrom0/* /media/disk-1
                      #
                      # Next, copy the Puppy files from the Puppy_Files folder on the Desktop to the 3rd UFD partition
                      # In my example, the 3rd UFD partition is mounted as /media/disk-2/
                      # To copy all the files, use the wild card character "*":
                      sudo cp -r /home/mike/Desktop/Puppy_Files/* /media/disk-2/
                      #
                      # So far, SGD, GParted, and Puppy are copied to the three UFD partitions
                      # Set up GRUB on the UFD
                      # Unmount the UFD (spelled umount)
                      sudo umount /media/disk
                      sudo umount /media/disk-1
                      sudo umount /media/disk-2
                      # Get a grub prompt as root:
                      sudo grub
                      # Use geometry to verify the naming of the UFD
                      grub> geometry (hd<press theTAB key>
                      grub> geometry (hd2)
                      # Study the output: It tells me GRUB sees the UFD as hd2
                      # Set up GRUB in the UFD using root & setup commands
                      grub> root (hd2,0) # (hd2,0) is the SGD-GRUB partition of the UFD
                      grub> setup (hd2) # (hd2) is the Master Boot Record of the UFD
                      grub> quit
                      $: exit

                      So far, SGD--and its GRUB--is set up on your UFD. With the UFD connected, if you re-boot now, your PC will boot into SGD on the UFD. The GParted and Puppy partitions are setup, but they are not on the boot menu yet.

                      - - - Edit the boot menu to include GParted, Puppy, and optionally, your own boot menu.
                      The GRUB configuration file (the boot menu) is the file /boot/grub/menu.lst. As root. you must edit the menu.lst to include entries for GParted and Puppy and save your edits. You can do this at Konsole (CLI) or in Konqueror (GUI).

                      Edit menu.lst using Konsole (CLI):
                      The following command opens the menu.lst of the SGD-GRUB on the UFD, as root, in the text editor kate:
                      kdesu kate /media/disk/boot/grub/menu.lst
                      (Recall, /media/disk is the mount point for the first UFD partition, where SGD and its GRUB is located.) After menu.lst opens, make your edits, then File>Save and File>Quit.

                      Edit menu.lst using Konqueror (GUI):
                      Open Konqueror, navigate to /media (by typing /media into the location window, or by clicking Storage Media), click the disk icon (in this example, /media/disk is the first UFD partition), click on boot, click on grub, right-click on the menu.lst file, Actions > Edit as root, give your PW, OK, and the menu.lst will open in a text edior (e.g., KWrite or Kate). Then make your edits, File>Save and File>Quit.

                      - - The structure of /boot/grub/menu.lst on the SGD-GRUB partition
                      It looks like this:

                      # Some comments, etc.
                      default 0 # This means the first "title" entry listed below is the default system booted
                      timeout 10 # You may have to edit this to read 10 or 15 seconds!
                      setgrubdevice # This sets the UFD as grub device--technical stuff
                      # and you may see other stuff like gfxmenu, etc.
                      # Put your own boot entires here, each starting with "title"
                      # We will put boot entries for GParted and Puppy (and optionally your own boot menu)
                      . . .
                      # And then comes all the SGD boot entries

                      - - The boot entry for GParted
                      From the GParted CD file syslinux.cfg, we see:
                      default gparted
                      append initrd=gparted.igz root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/gparted.dat dokeymap splash=silent nosound cdroot=/dev/sd

                      From that, we can construct the following boot entry for GParted, and as root, copy/paste it into /media/disk/boot/grub/menu.lst as indicated above, then File>Save, and File>Quit:
                      title GParted 0.3.4-9
                      root (hd0,1) # GParted is on partition 1 of the UFD
                      kernel /boot/gparted root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/gparted.dat dokeymap splash=silent nosound cdroot=/dev/sd
                      initrd /boot/gparted.igz

                      - - The boot entry for Puppy Linux
                      From the isolinux.cfg file of the Puppy files, we see:
                      kernel vmlinuz
                      append root=/dev/ram0 initrd=initrd.gz pmedia=cd

                      From that, construct the following boot entry for Puppy:
                      title Puppy 2.17
                      root (hd0,2) # Puppy is on partition 2 of the UFD
                      kernel /vmlinuz root=/dev/ram0 pmedia=usbflash
                      initrd /initrd.gz

                      Note: See the Puppy post (Reply #9) about pmedia=usbflash.
                      Note: GParted & Puppy are on hd0 * as seen by BIOS when the PC boots from the UFD *. See Reply #5 and Reply #8 above.

                      - - Optional: Include your own GRUB menu.lst in the SGD UFD boot menu

                      To boot the OSes on my two internal HDDs, GRUB and my normal Kubuntu boot menu, /boot/grub/menu.lst, is set up on partition 1 of my second HDD (sdb1), and the /boot/grub/menu.lst there is the boot menu you see when turning on the PC. (The GRUB from sdb1 is set up in the MBR of the first HDD (hd0).) To include this menu.lst in the boot menu of the UFD, do the following (using Konqueror or Konsole):
                      Off to the side, copy onto Desktop your own GRUB menu.lst; rename it myLinuxMenu.lst (or any name ), save it (as plain text or .txt). Copy the file myLinuxMenu.lst into the /boot/grub directory of the SGD on the UFD :
                      sudo cp /home/mike/Desktop/myLinuxMenu.lst /media/disk/boot/grub
                      (Notes: myLinuxMenu.lst will be created in media/disk/boot/grub; you need to use sudo to do this; in our example, partition 1 of the UFD is mounted as /media/disk)
                      The SGD (on the UFD) also contains a /boot/grub/menu.lst. As root, edit this /boot/grub/menu.lst of SGD, to include the following boot entry (see above, "The structure of /boot/grub/menu.lst") :

                      title myLinuxMenu.lst
                      usbshift # this is necessary
                      configfile $(grub_device)/boot/grub/myLinuxMenu.lst

                      (You may put this first, before GParted and Puppy, so myLinuxMenu.lst will be the default boot entry.)

                      - - - - - You're done. Test it now. See Note 1: BIOS setup issues
                      When you re-boot with the UFD plugged in, the boot menu you see shows myLinuxMenu.lst, SGD, GParted, Puppy, and other SGD choices.

                      - - - - - - - - - - - - - - -
                      GUI Example: Use graphical user interface (GUI) to put GParted on the 2nd partition.
                      In Kubuntu, put the GParted Live CD in the tray. An icon for it appears on your Desktop (if your filesystem table, /etc/fstab, contains an entry for CD drive). Open Konqueror as root. Click Storage Media, click the 2nd partition on the UFD (in the example, /media/disk-1=sdc2). Open the GParted CD icon on Desktop. In the GParted CD window, click View>Show Hidden Files, click Edit>Select All, Edit>Copy, then paste the GParted CD files into the open /media/disk-1 window (click in that window, Edit>Paste or right-click Paste). (You may also use drag-and-drop.)
                      - - - - - - - - - - - - - - -
                      Working with root privileges: When denied access/permission at Konsole, use sudo to make it go.
                      In GUI, open Konqueror with root privileges using Konsole command: kdesu konqueror. In Konqueror, to open a text file to edit, use right-click > Actions > Edit as root. At Konsole, sudo su gets you a root prompt. At Konsole, sudo -i gets you a root terminal.
                      - - - - - - - - - - - - - - -
                      Updating the UFD when new versions are released: Repeat the above for affected modules. Download the new version, reformat the affected partition, and re-install. Re-install GRUB if you use a new SGD version. Check that your boot menu.lst entries work after updates.
                      - - - - - - - - - - - - - - -
                      Notes:

                      Note 1: BIOS setup issues--To set your BIOS to boot from the UFD
                      Your BIOS must support the capability to "boot from USB." With the UFD connected, re-boot, enter BIOS setup, set your BIOS to boot from USB. Set it to boot from CD first, then the UFD, then the 1st HDD. With no CD in the tray, with UFD plugged in, the PC boots from it; when the UFD is not plugged in, the PC boots as usual from HDD. Save and Exit BIOS. The PC then re-boots from UFD.

                      Note 2: Compressed files (bz2 & bzip) and Ark in Kubuntu.
                      Example SGD: super_grub_disk_english_usb_0.9657.tar.bz2
                      The .bz2 is a bzip2 file--a compressed file (to make the file smaller for faster download). (Another type is .gz or gzip.) The extension .tar means the file is a tarball or tape archive file. The tarball has been compressed by bzip2. In Kubuntu, open the tarball with Ark (Archive extractor). Two ways:
                      (1) K-Menu>Utilities>Ark, File>Open, Desktop, click the file super_grub_disk_english_usb_0.9657.tar.bz2, Open, Action>Extract, All files, select destination folder for the extracted files to go. Or,
                      (2) Right click on super_grub_disk_english_usb_0.9657.tar.bz2, select Extract here.

                      Note 3: Using the special SGD USB
                      The special SGDfor usb is needed if the UFD is used to boot OSes NOT located on the UFD, as SGD does or as myLinuxMenu.lst does. See Replies #8 & 9 above.

                      Note 4: Use K3b in Kubuntu to burn the GParted Live CD
                      K-Menu>Multimedia>K3b, Burn CD Image, Image to Burn (Browse to the Desktop, click gparted-livecd-0.3.4-9.iso, click OK, place a blank CD in CD tray, close the tray door; Speed: select 4x or the slowest speed offered, click Start. Wait for it to finish, click Close, then File>Quit, eject the CD, and using a magic marker write on the safe (top) side of the CD "gparted-livecd-0.3.4-9.iso" (and release date10-18-07).

                      Note 5: Md5 Checksum for Puppy--How to check it.
                      Get the MD5 Checksum from the download site. At the Puppy site,
                      puppy-2.17-nolzma-seamonkey-fulldrivers.iso.md5.txt says the MD5 checksum is:
                      260d2651ad2564748e37b468a848f1b2 puppy-2.17-nolzma-seamonkey-fulldrivers.iso

                      At Konsole, the command is: md5sum {name of file}. Then compare the result to the md5sum you downloaded at the site. Like this:
                      mike@mike-desktop:~$ pwd
                      /home/mike
                      mike@mike-desktop:~$ cd Desktop
                      mike@mike-desktop:~/Desktop$ md5sum puppy-2.17-nolzma-seamonkey-fulldrivers.iso
                      Press Enter to get
                      260d2651ad2564748e37b468a848f1b2 puppy-2.17-nolzma-seamonkey-fulldrivers.iso
                      That's the same string as above, so we conclude the download is good and accurate.
                      Note: I had to change to the directory /home/mike/Desktop, where the downloaded iso file is located. "pwd" means print the (current) working directory, which returned "/home/mike", then I changed directory into the Desktop (cd Desktop).

                      Note 6: Accessing files on a downloaded iso file. Example: Puppy
                      We can do this as we did with GParted by burning the file puppy-2.17-nolzma-seamonkey-fulldrivers.iso to a CD using K3b. However, we can access the Puppy files without burning them to a CD. This works for any downloaded .iso file:
                      Download the iso file to the Desktop. (If it's a tar.gz file or similar, get the iso by right-click, Extract Here, or by using K-Menu>Utilities>ARK) The file name is puppy-2.17-nolzma-seamonkey-fulldrivers.iso on the Desktop: /home/mike/Desktop/puppy-2.17-nolzma-seamonkey-fulldrivers.iso
                      Open Konsole, make a directory Puppytemp for your mount point
                      sudo mkdir /mnt/Puppytemp
                      # Mount the iso on Puppytemp
                      sudo mount -t iso9660 -o loop /home/mike/Desktop/puppy-2.17-nolzma-seamonkey-fulldrivers.iso /mnt/Puppytemp
                      # If you wish, you can change directories (cd) to /mnt/Puppytemp,
                      # and list (ls) the files to see what's there
                      # Make another directory called Puppy_Files on the Desktop
                      sudo mkdir /home/mike/Desktop/Puppy_Files
                      # Copy the Puppy files to Puppy_Files
                      sudo cp -R /mnt/Puppytemp/* /home/mike/Desktop/Puppy_Files
                      # (If necessary) Change the ownership so mike can have these files by:
                      # sudo chown -R mike:mike /home/mike/Desktop/Puppy_Files
                      # Then unmount the iso (note the spelling umount)
                      sudo umount /mnt/Puppytemp
                      # To invoke root, use sudo (as I have above when necessary)
                      #Then, you may continue to work at Konsole or continue using Konqueror GUI.

                      Note 7: Find out how Kubuntu sees the UFD.
                      Plug the UFD into a USB port. After it is recognized, click OK, close the window that pops up. Click the System Menu icon at lower left (next to K button). Click Storage Media and up comes a Konqueror window for /media. Let your cursor icon hover over the USB device icon, look for "Device Node." Mine says sdc, so that's it. (I have 2 internal HDDs, sda and sdb.) Also: The /media window shows the UFD icon as "disk" or similar (usbdisk, disk-1, etc.). That's how it is mounted in Kubuntu. Also: Right-click on the UFD icon, select properties, you will see information about how it is mounted. Also: Open Konsole (K>System>Konsole), type sudo fdisk-lu, give your password, you'll see your drives, including the UFD. (Note: for sudo fdisk -lu, "-lu" is "l" as in "list", "u" as in "units")

                      Note 8: Using GParted Live CD -- logistics
                      In Kubuntu, place GParted CD in the CD tray. Close all open programs. Re-boot into GParted (BIOS must be set to boot first from CD ROM). In GParted, insert the UFD, then GParted > Refresh Devices, select the UFD from the list of your drives at the upper right. Partition and format as follows: To create the first partition sdc1, click on the unallocated space, Partition > New, set the size to 8 MB, type is ext3, OK, click the Apply icon to make it go. Repeat this for sdc2 and sdc3, selecting FAT32 as the type for each, and sizes 100 MB and 150 MB, respectively. Then GParted > Quit, double click the red Exit button, Eject & re-boot -- OK, remove both the GParted CD and the UFD, close the CD tray, OK, and wait for re-boot (may take awhile).
                      - - - - - - - - - - - - - - -
                      References

                      To Remove U3 from flash drive:
                      http://www.sandisk.com/Assets/u3/launchpadremoval.exe
                      http://www.u3.com/uninstall/final.aspx

                      How To GRUB Methods - Toolkit
                      http://kubuntuforums.net/forums/inde...opic=3081671.0
                      (Includes: Change default & timeout, make separate “GRUB boot partition,” etc.)

                      GParted: http://gparted.sourceforge.net/
                      GParted how-to: http://www.howtoforge.com/partitioning_with_gparted

                      Puppy: http://www.puppylinux.com/
                      Good tips on downloading/burning bootable iso CD's: http://www.puppylinux.com/cd-puppy.htm

                      For command-line basics, mounting, filesystems, permissions, start with
                      Tuxfiles: http://www.tuxfiles.org/
                      Psychocats: http://www.psychocats.net/ubuntu/index.php
                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment


                        #12
                        Re: How To: Make GRUB Thumb Drive

                        Update, tutorial improvements, and expanded material in this thread, as follows:

                        Reply # 1 How to install Kubuntu 7.04 to an external USB hard disk drive
                        Major re-write, more step-by-step details, more helpful, more tips, expanded coverage.
                        Illustration of USB drive shifting.
                        Optional topics: using the external drive to boot OS on internal drives; booting OS on the external drive from a boot menu on an internal drive.

                        Reply # 8 Simplifying your menu.lst and all the rest of it
                        Major re-write, a full guide to installing GRUB to your flash drive based on how you intend to use the flash drive (5 cases), more detailed tips, explanation of the special Super GRUB Disk for USB, the general form of the UFD menu.lst, expanded coverage.
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment


                          #13
                          Re: How To: Make GRUB Thumb Drive

                          Install Kubuntu 7.10 to a flash drive (UFD)

                          Summary:
                          Do it the same way you would install Kubuntu to your hard drive. No special effort (except adjusting GRUB for the USB drive shifting as we have explained in the posts above). I was surprised.
                          - - - - - - - - - - - - - - -

                          Version/comments:
                          Kubuntu 7.10 installed from the Alternate i386 installer CD. You can use the regular Live Desktop installer CD. The only special thing I did was the following: Select the “Manual” method from the installer; when it came time for GRUB, I put GRUB in the Master Boot Record of the UFD. If you are using the Desktop Live CD installer, choose “Manual,” and when you come to Step 6 (of 6), click the Advanced button at lower right, type in the box the GRUB notation for the MBR of your UFD.

                          Hardware setup on my PC:
                          Intel D915GAVL. Two internal hard drives sda=hd0 (for Windows) and sdb=hd1 (for Linux). The Kubuntu 7.10 UFD is seen as sdc=hd2. Your BIOS must support USB booting.

                          *** Open question:
                          Is there something new/special about 7.10 Gutsy that makes this just work? Will this work for installing Kubuntu 7.04 Feisty to UFD? How about 6.06 Dapper Drake?
                          > I'll leave that for someone else to test.

                          Overview (see this thread for details):

                          1 First, I used GParted Live CD to partition the UFD as follows, all as ext3:
                          sdc1 swap 100 MB; sdc2 /home 200 MB; sdc3 root (/) 3.44 GB.

                          2 Kubuntu 7.10 installer—no problems. It detected all drives and my swap on sdb2 and swap on the UFD at sdc1. But, the USB 2.0 interface is slower than installing to my hard drive (1.5 hours versus 0.5 hours). Final installed size of the root files (/) on sdc3: 2.11 GB used out of 3.44 GB available.

                          3 GRUB:
                          When asked to install GRUB to the MBR of the first hard drive, say “No.”
                          When given the choice of where, I said (hd2), including the parentheses, which indicates the MBR of the UFD (since I have two internal HDDs hd0 and hd1).
                          Be prepared with this information before doing this: find out how your drives are seen, including the new UFD.

                          4 Re-booting after installing—troubleshooting is easy (just be prepared).
                          -- It didn't boot to the UFD. So I entered BIOS setup and set BIOS to boot from the UFD. Your BIOS must, of course, support “boot from USB.”
                          -- In the UFD boot menu, all my OSs were detected and listed.
                          -- I selected the new Kubuntu 7.10 (on UFD). File not found Error 15. As expected (see the posts in this thread about USB drive shifting). That's because the menu.lst shows the Kubuntu 7.10 as from root (hd2,2). As seen from my other hard drives, that's correct, but not as seen from the UFD when the PC is booted from the UFD. Your boot drive (ANY boot drive, internal or external or UFD) is always seen as hd0 by BIOS and GRUB when booted. So simply edit the root statement so you can get into the new Kubuntu 7.10: change (hd2,2) to (hd0,2), where hd0 refers to the current boot device = the UFD.
                          Details: Highlight Kubuntu 7.10 boot entry in the boot menu; press “e” to edit; highlight the line “root (hd2,2)”; press “e” to edit; change it to (hd0,2); press Enter; press “b” to boot. Get a blinking “-” upper left of black screen, takes awhile, 15-20 seconds; then “Starting up ...” and up comes Kubuntu.
                          First off, I fixed the GRUB menu.lst to make this change permanent. See Technical Note at the end here for more on this.

                          Troubleshooting options: (1) Use a Live CD to edit the menu.lst on the UFD; or, (2) use Super Grub Disk Live CD to boot the new UFD Kubuntu and then fix the menu.lst; or, (3) Go into another Linux, access the new UFD Kubuntu (as a mounted removable media), edit the menu.lst.

                          = = = = =

                          Using it:

                          There may be an issue of wearing out the UFD with write cycles. That's addressed elsewhere (e.g., see the post on installing Puppy to UFD for references). This was an experiment, and at the very least, the Kubuntu UFD can be safely used as an emergency OS or as a portable OS to be used occasionally in special situations. Or, just test it out and see if it wears out (backup your /home somewhere OFF the UFD!)

                          = = = = =

                          Testing it: all the following worked normally. Including downloading SGD Live CD and using it to boot the new UFD Kubuntu 7.10.

                          --- Konqueror detected all my other drives and partitions; sudo fdisk -lu made sense, as did GRUB's geometry command – all drives and partitions detected normally, with the UFD seen as sdc=hd2 and a second UFD, a data UFD, seen as sdd1=hd3.
                          --- Internet connection, Konqueror (DSL).
                          --- K3b – download & burn Super Grub Disk Live CD iso, re-boot, use SGD to boot Kubuntu 7.10 on the UFD.
                          --- OOo Writer, saved document to the separate /home on the UFD at sdc2; then copied it to a second (data) UFD, seen as sdd1.
                          --- Printer setup, using HPLIP (HP5650 DeskJet); test printer as Default printer (K > System Settings > Printer).
                          --- Adept Manager updates – selected just a few to test this.
                          --- email: downloaded, installed and used ubuntuzilla script to get Thunderbird email, set it up, and tested it. This is a fairly good test that everything is working good on the flash drive. http://ubuntuzilla.wiki.sourceforge.net/

                          = = = = =

                          Technical Note: Editing the UFD menu.lst to boot Windows XP

                          To demonstrate the UFD menu.lst, take Windows XP. It's on sda1=(hd0,0). sdb = hd1 is my Linux drive. So, when used to boot the PC, the UFD is named hd0, the Windows drive is hd1, and the Linux drive is seen as hd2 by the GRUB on the booted UFD. So Windows is on (hd1,0) as seen from the UFD menu.lst. But that makes Windows on a non-first hard drive, so the map dance is necessary, and the final boot entry for Windows XP on the UFD /boot/grub/menu.lst is:

                          title Windows XP Whatever in the World are You Doing Here!
                          rootnoverify (hd1,0)
                          map (hd1) (hd0)
                          map (hd0) (hd1)
                          chainloader +1

                          Another way to do it:
                          To avoid this map dance, you can install the special (patched) GRUB from Super Grub Disk for USB onto the UFD (under /boot/grub, first remove the old /grub, then do from Konsole, sudo grub, then root (hd2,2), setup (hd2), quit – from Kubuntu Konsole, the UFD is seen as hd2; in the menu.lst, include just before root, the command usbshift, then simply use (hd0,0) for Windows root).

                          See the various posts in this thread, starting with the first post, for more details.
                          = = = = = = = = = =
                          Edit: A clarification

                          Just so we are all together here, there are two general situations where one installs Kubuntu to a flash drive:
                          1 Using a Kubuntu install CD, do a full installation of Kubuntu to the flash drive as one would to any drive.
                          Or, another case:
                          2 Copy just the Live CD contents to a flash drive, make it bootable, and so then you have a "Live Kubuntu USB flash drive" (just like a Live Kubuntu CD). This requires a 1 GB flash drive. An extension of this case is when you make the USB Live flash drive persistent by including a data partition on the flash drive where you can save your user data and settings. For example, see, by IntutiveNipple: http://ubuntuforums.org/showthread.php?t=476302
                          (see the following post below for more on this).

                          What I have done here is simply an example of case 1: a full installation of Kubuntu to a flash drive; mine is not a Live USB flash drive installation and was not intended to be. Issues here, mainly, are that under case 1, we have to be concerned about wearing out the flash drive with so many re-writes that the OS does while running in normal mode. The same applies in case 2 where a persistent partition is used, and the concern would apply only to the partition used as the persistent data partition. And that, too, is a separate subject.
                          --- End of this clarification.
                          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                          Comment


                            #14
                            Re: How To: Make GRUB Thumb Drive

                            Kubuntu LIVE Flash Drive --

                            Installing Kubuntu 7.04 Feisty to a flash drive to work as a * Live * Kubuntu flash drive.

                            (and using it to install Kubuntu on an internal hard drive)

                            As explained at the end of the post above, this is not the same as regular installation of Kubuntu. Instead, here, you are making a flash drive that you can use exactly the same way you use a Live Kubuntu CD.

                            --- Three advantages to having Kubuntu on a flash drive as a live operating system:
                            1 You can use it to install Kubuntu on other PCs.
                            2 It isn't locked into a specific hardware system install; you can plug it into any PC.
                            3 You do not have the concern about wearing out the flash drive from re-write cycles. Just like the Live Kubuntu CD, the Live Kubuntu flash drive works only in RAM (ramdisk).

                            - - - - - - -
                            Tutorial.
                            I worked through the following excellent, readable, and understandable tutorial by IntuitiveNipple:

                            HowTo: Install Feisty on a bootable USB Flash drive, June 17, 2007
                            http://ubuntuforums.org/showthread.php?t=476302
                            (also works with 7.10 Gutsy)

                            You need just a 1 GB flash drive.

                            --- Building the Live Kubuntu flash drive, a few comments

                            He uses 100% CLI in his tutorial. He tells you what packages you need to download and shows you how, using the command line Konsole. He uses LILO (for the IPL--Initial Program Loader--in the MBR) instead of GRUB to build the bootable MBR because LILO will do so in just the first 512 Bytes of the flash drive (i.e., the first sector). (GRUB will want to write more into Stage_1.5, some 17 sectors). Before you start, find out how your flash drive is named. Mine, at the time, was seen as sdc = hd2 since I had two internal hard drives.

                            To partition the UFD as Fat16, I used GParted Live CD; then copied the files from the Live Kubuntu CD to the flash drive using, as root, Konqueror GUI: Edit > Copy/Paste.
                            IMPORTANT NOTE: He does his work at CLI, and you may follow his commands exactly for your setup. If you do any of it at GUI (as I did for fun), you must do two things. (1) Be sure you get all the files, by enabling View > Show Hidden Files. (2) You must work as root, and so use sudo su, or kdesu konqueror, or sudo -i, or whatever works to get root.

                            When I re-booted, SYSLINUX started but then stopped with a message, Could not find kernel image: linux, and a prompt boot:. I re-booted again, and again once more, and then it went OK (and every time after that it was OK). So the hardware/UFD/whatever must have been a bit buggy.

                            --- Using the Live Kubuntu flash drive to install Kubuntu to a hard drive partition: Just like using a Live Kubuntu install CD.

                            I wanted to make a new partition for Kubuntu 7.04 Feisty on my second hard drive. The Live Kubuntu flash drive did not have GParted installed, and although I have GParted on Live CD and on UFD, I decided to use the Live Kubuntu Adept Manager to install GParted in the live ramdisk session from the flash drive. I then used the newly "installed" GParted to make a new partition for Kubuntu on my second internal hard drive, sdb7 = (hd1,6) (ext3, 10 GB). Then ran the Kubuntu installer from the live flash drive and installed a new instance of 7.04 Feisty in sdb7.

                            GRUB: I selected "Manual" partitioning method in Step 4. In Step 6, click Advanced button at lower right, and entered (hd1,6) as the place to put GRUB. That way, GRUB does not overwrite my existing GRUB setup on my two internal hard drives. In particular, I did not let GRUB overwrite any MBR.

                            Installation was fast and took about 10 minutes after pressing the Finish button in Step 6.

                            Booting into the new Kubuntu on sdb7 --
                            Upon re-booting, I got into the new Kubuntu by chainloading the GRUB I had the installer install in the root partition of Kubuntu: Interrupt my regular, working GRUB boot menu by pressing the "c" key to get a grub>. Then did
                            grub> chainloader (hd1,6)+1
                            grub> boot

                            and the newly installed sdb7 Kubuntu booted up with no problems. (Another reason to install GRUB in the root partition--you can chainload it to get there the first time you re-boot, before you've had a chance to edit your menu.lst.)

                            This sounds like another good way to spread the Linux word. And convenient, too.


                            EDIT: See the (new) How-To I wrote here at Kubuntu, at:

                            http://kubuntuforums.net/forums/inde...089474.new#new
                            Build a LIVE Kubuntu Flash Drive, How-To
                            It's a step-by-step of this post, based on the I-N tutorial.

                            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                            Comment


                              #15
                              Re: How To: Make GRUB Thumb Drive

                              I really appreciate the thorough HOW TO. A question from a newbie: I've updated the BIOS on my old Dell Dimension XPST850r (which I got from FreeCycle) to the most recent available and am still not able to boot from the USB device. Is there anyway I could use a floppy to activate/access the Thumb Drive (probably a dumb question)?

                              Comment

                              Working...
                              X