Page 1 of 9 123 ... LastLast
Results 1 to 10 of 84

Thread: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

  1. #1
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,097
    Distro
    Ubuntu 14.04 Trusty Tahr

    HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    REVISED on Wednesday, January 02 2008
    Thanks Tekno_Cowboy in post #2 of this thread.
    • Do you want to try out Ubuntu, Kubuntu, Xubuntu or any other *buntu and install without using a CD?
    • Would you like having something that works like a live CD but runs a lot faster?
    • Have you ever experienced a partitioning disaster of or an installation failure that could have been caused by a scratched CD or a dirty optical lens in your CD/DVD drive?
    • Does your computer support booting a USB disk? (Either from the BIOS or even from a GRUB menu or command line).
    • You can also keep it in the USB disk for any emergency you might have later on someday, the Ubuntu Live CD can be used to rescue and repair your Ubuntu operating system and re-install if that's ever necessary. It makes a great rescue disk because it leaves your CD/DVD drive available in case you want to make a file rescue that way, or you can SSH to a networked computer or copy to another USB disk too, whichever will be the easiest.
    • Super Grub Disk is used to boot the Live CD Ubuntu operating system in the USB disk, and it can also be used for emergency booting or fixing the boot of any operating system in your hard drive too if you ever need it.

    This how-to is made of a combination of bits and pieces of several other how-tos on Ubuntu USB making. This how-to is different in that it uses GParted as the partition editor and Super Grub Disk for USB as the boot loader.
    I got information from these other great how-tos, these are all very good, Installation/FromLinux, LiveUsbPendrivePersistent - Ubuntu Wiki, LiveCDPersistence - Community Ubuntu Documentation, and PendriveLinux Ubuntu 7.10 USB persistent Linux installation,


    You'll need:
    1. First you will need a computer that is already running Ubuntu or some other Linux distro.
    2. You will need a USB flash memory stick or other type of USB drive of at least 2.0 GB in capacity or bigger. You might be able to get away with a 1.0 GB drive, but bigger is better a 4.0 GB or larger flash memory drive would be nice. You can also install this way in a real hard disk in an external drive caddy, it doesn't have to be a flash drive.
    3. You'll need a copy of SGD for USB, at the time of typing, the latest is super_grub_disk_english_usb_0.9673.tar.bz2
    4. You'll also need an .iso file for whichever *buntu you want to install, or to run as a LiveCD (USB) to try it out. Super Grub Disk and Ubuntu Live CD is a good combination for a rescue disk, so you can keep this USB Disk for a rescue disk after Ubuntu is installed in your computer. You can use any Ubuntu Live CD you like.


    NOTE 1: The Ubuntu 'Alternate CD', is supposed to work if you add 'vesa vga=771' as kernel parameters, but when I tried it, the Gutsy Gibbon Alternate CD starts but fails 'mounting the CD-ROM', so I couldn't install from it. - refer: page 3, post #23, #24, #25.

    NOTE 2: Hardy Heron users:
    MQMike discoverd that Hardy Heron LTS wouldn't boot work in persistent mode. Please see page 7, posts #66-69 for MQMike's special work-around that enables Hardy Heron to boot with persistence. Thanks MQMike, adrian15, meierfra and others for your hard work on that. (Starts on Page 5, post #49.)

    Okay, let's get started.

    Formatting your USB disk

    1. Unmount your USB disk and open GParted in Ubuntu.
    2. Delete any other partitions that were there before, (back up your data somewhere first, of course!)
    3. Make the first partition with an ext2 file system, at least 745 MiB in size. Better make it 750 MiB to be sure.
    4. Make the second partition ext3 taking up all the rest of the available space in the USB disk.

    We need to label the file systems with commands similar to the following ones
    Code:
    e2label /dev/sdb1 ubuntu710
    Where: your first partition in your USB disk is called /dev/sdb1
    If you're not sure, open GParted again and check.
    If it's something else then change your command to suit your own computer.
    Code:
    e2label /dev/sdb2 casper-rw
    Where: your second partition in your USB disk is called /dev/sdb2
    If you're not sure, open GParted again and check.
    If it's something else then change your command to suit your own computer.

    Eject and unplug your USB disk.



    Mount your .iso file using these commands,
    Code:
    sudo mkdir /media/ubuntu_iso
    Code:
    sudo mount ubuntu-7.10-desktop-i386.iso -o loop /media/ubuntu_iso
    Plug in your USB disk again, so it will be mounted automatically in /media.
    Icons should appear on your desktop.

    Note: the name of your USB disk's partitions should now appear on your desktop as: ubuntu710 and casper-rw.

    If the ubuntu710 file system doesn't get automatically mounted, it may need to be mounted manually,
    Code:
    sudo mkdir /media/ubuntu710
    Code:
    sudo mount -t ext2 /dev/sdb1 /media/ubuntu710
    Where: your first partition in your USB disk is called /dev/sdb1
    If you're not sure, open GParted again and check.
    If it's something else then change your command to suit your own computer.

    Copy the files from the .iso file to the USB disk,
    Code:
    sudo cp -rfv /media/ubuntu_iso/* /media/ubuntu_iso/.disk /media/ubuntu710

    Super Grub Disk
    Code:
    wget http://forjamari.linex.org/frs/download.php/778/super_grub_disk_english_usb_0.9673.tar.bz2
    Code:
    tar jxvf super_grub_disk_english_usb_0.9673.tar.bz2
    Copy Super Grub Disk's /boot into your USB disk's ubuntu710 partition.
    Code:
    sudo cp -rv boot /media/ubuntu710/
    Install Super Grub Disk's IPL to MBR in your USB disk, do something like this, but your disc and partition numbers might be different, replace with the right numbers to suit your system,
    Get a GRUB shell,
    Code:
    sudo grub
    Now. Don't copy and paste the 'grub>' part in the next few code boxes, that's the prompt, I'm just including it to indicate we're in a GRUB shell right now. Also, don't copy the outputs, just the commands. Or even better, type your own commands for this part, and remember to use your 'tab key', it's very useful in a GRUB shell.

    Test to remind you which hard disks and partitions in your computer contain GRUB files,
    Code:
    grub> find /boot/grub/menu.lst 
    (hd0,1) 
    (hd1,0)
    Test with GRUB's 'geometry' command to find out if (hd1) is really your USB disk.
    Here is an example of how to use GRUB's geometry command to verify that (hd1) is your USB disk.
    Code:
     grub> geometry (hd1)
    drive 0x81: C/H/S = 250/255/63, The number of sectors = 4030464, /dev/sdb
       Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
       Partition num: 1,  Filesystem type is ext2fs, partition type 0x83
    Tell Grub which partition it's supposed to be working in, (this depends on the output from the preceding commands, and may vary between computers, please watch it and alter the command to suit your own particular machine.
    Code:
    grub> root (hd1,0)
    Set the boot flag, GParted can do that too but we didn't tell it to, never mind, we''ll do it with GRUB now,
    Code:
    grub> makeactive
    Install GRUB to the partition's first sector (optional).
    This also depends on the output from the earlier 'find' and 'geometry' commands, so you can be most certain that you are definitely installing GRUB to the correct partition.
    Code:
    grub> setup (hd1,0)
    Install GRUB to MBR in the USB drive, (this also depends on the output from the 'find' and 'geometry' commands)
    Code:
    grub> setup (hd1)
    Close the GRUB shell
    Code:
    grub> quit
    Open your USB disk's /boot/grub/menu.lst
    Code:
    gksudo gedit /media/ubuntu710/boot/grub/menu.lst
    Copy this entire menu.lst from this web page (below), and go to your own USB disk's menu.lst and go 'Edit'-->'Select All'-->'Delete'-->'Edit'-->'Paste'-->'Save', and close the file.
    Code:
    # You can edit this file to add your own distribution
    # You can choose default to 0 to select first entry
    # which it is usually the entry for the default distro
    #
    #Thank you adrian15!
    #
    # You can also set timeout to something as 10
    #
    # This is the shortcut to call Super Grub Disk (commented)
    #title Super Grub Disk
    ## 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.
    
    default 0
    #timeout 2
    setgrubdevice # This is compulsory
    # The two commands: setgrubdevice and usbshift are needed
    # so that SGD works well.
    usbshift
    #gfxmenu /boot/grub/message
    foreground ffffff
    background 0c00ff
    color white/brown yellow/cyan
    
    title       Ubuntu Gutsy Gibbon in Persistent Mode
    kernel   $(grub_device)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper persistent quiet splash --
    initrd    $(grub_device)/casper/initrd.gz
    
    title       Super Grub Disk
    configfile $(grub_device)/boot/sgd/menu.lst
    
    title      Ubuntu Gutsy Gibbon in Live CD Mode
    kernel   $(grub_device)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
    initrd   $(grub_device)/casper/initrd.gz 
    
    title       Start Ubuntu in Safe Graphics Mode
    kernel   $(grub_device)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper xforcevesa quiet splash --
    initrd    $(grub_device)/casper/initrd.gz 
    
    title        Install with Driver Update CD
    kernel    $(grub_device)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper debian-installer/driver-update=true quiet splash --
    initrd     $(grub_device)/casper/initrd.gz 
    
    title        OEM Ubuntu Gutsy Gibbon Install (for manufacturers)
    kernel    $(grub_device)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper oem-config/enable=true quiet splash --
    initrd     $(grub_device)/casper/initrd.gz 
    
    title        Check CD for Defects
    kernel    $(grub_device)/casper/vmlinuz boot=casper integrity-check quiet splash --
    initrd      $(grub_device)/casper/initrd.gz 
    
    title        Memory Test
    kernel    $(grub_device)/install/mt86plus  - 
    
    title       Boot the First Hard Disk
    root       (hd0)
    chainloader +1
    
    title       Boot the Second Hard Disk
    root      (hd1)
    chainloader +1
    Now you can exit from your terminal and close any windows you have open and reboot with the USB drive.

    Booting the SGD USB disk

    With some computers you might be able to Boot your USB Disk for your BIOS, here's how I do that, How I boot from my BIOS
    Yours might be different but you might be able to do something like that.

    Another way boot it would be from GRUB's Command Line Interface (effective even in some computers that can't boot the USB directly from the BIOS).
    If you're going to be booting USB devices again, you should make a permanent chainloader type of boot entry for that in your menu.lst. That makes booting the USB easier.

    Here's an example of how to boot Super Grub Disk in your USB disk from your own hard disk installed GRUB's CLI (Command Line Interface) or some other GRUB, such as a GRUB floppy disk, a GRUB CD.
    Code:
    grub> root (    # <tab>
    Possible discs are: fd0 hd0 hd1
    Code:
    grub> root (hd1)
    Code:
    grub> chainloader +1
    Code:
    grub> boot
    Enjoy!

    Regards, Herman
    Last edited by Herman; May 5th, 2008 at 07:59 PM.
    Ubuntu user since 2004 (Warty Warthog)

  2. #2
    Join Date
    Aug 2007
    Location
    Under a rock
    Beans
    66
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    This seems to work well. I wanted persistence, So I made the following changes:

    1. The label of partition 2 needs to be

    Code:
    e2label /dev/sdX2 casper-rw
    where X is the letter of the drive you are working with. BE CAREFUL NOT TO USE THE WRONG LETTER OR YOU MIGHT LOSE DATA!

    2. I added the text in red
    Code:
    # You can edit this file to add your own distribution
    # You can choose default to 0 to select first entry
    # which it is usually the entry for the default distro
    #
    #
    # You can also set timeout to something as 10
    #
    # This is the shortcut to call Super Grub Disk (commented)
    #title Super Grub Disk
    ## 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.
    
    
    
    
    default 0
    # timeout 2
    setgrubdevice # This is compulsory
    #gfxmenu /boot/grub/message
    foreground ffffff
    background 0c00ff
    color white/brown yellow/cyan
    
    title Ubuntu Gutsy Gibbon Live CD
    kernel $(grub_device)/casper/vmlinuz boot=casper root=/dev/ram ramdisk_size=1048576 rw splash persistent
    initrd $(grub_device)/casper/initrd.gz
    
    title Super Grub Disk
    # The two commands: setgrubdevice and usbshift are needed
    # so that SGD works well.
    usbshift
    configfile $(grub_device)/boot/sgd/menu.lst
    
    title Inicio normal / Normal Boot 
    kernel $(grub_device)/vmlinuz lang=es a11y=none root=/dev/ram0 ramdisk_size=100000 initrd=initramfs quiet BOOT=live splash
    initrd $(grub_device)/initramfs
    
    title Soporte de accesibilidad / Accesibility Support -->
    configfile $(grub_device)/boot/grub/menu2.lst
    
    title Normal boot. Kernel is aware of Boot device
    kernel $(grub_device)/vmlinuz lang=es a11y=none root=/dev/ram0 ramdisk_size=100000 initrd=initramfs quiet BOOT=live splash boot_device=$(grub_device)
    initrd $(grub_device)/initramfs
    
    title Normal boot. Selecting kernel and initrd files depending on grub_device
    kernel $(grub_device)/vmlinuz_$(grub_device_string) lang=es a11y=none root=/dev/ram0 ramdisk_size=100000 initrd=initramfs quiet BOOT=live splash
    initrd $(grub_device)/initramfs_$(grub_device_string)
    
    title Selecthd test
    configfile $(grub_device)/boot/grub/choose/selecthd.lst
    
    title findp test
    configfile $(grub_device)/boot/grub/choose/selectpart.lst
    title set SGD variables and boot SGD
    
    configfile $(grub_device)/boot/sgd/menu.lst
    you don't really need the "splash", but I like it =)


    If someone knows how to get this to boot like a live cd too (not just boot live cd, the whole menu), that would be great. I'd like to don a trait from Sabayon Linux and add specialized boots, like for internet browsing, gaming, and multimedia.

    Otherwise, this is the only method I have tried that has actually worked for me, and you get the added bonus of Super Grub Disk, a handy utility if there every was one. You could probably modify this a little to include other utilities, like some kind of system rescue cd, that can be selected at boot. If anyone knows the best way to do this, please post it.
    anime=life

  3. #3
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,097
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    If someone knows how to get this to boot like a live cd too (not just boot live cd, the whole menu), that would be great. I'd like to don a trait from Sabayon Linux and add specialized boots, like for internet browsing, gaming, and multimedia.

    Otherwise, this is the only method I have tried that has actually worked for me, and you get the added bonus of Super Grub Disk, a handy utility if there every was one. You could probably modify this a little to include other utilities, like some kind of system rescue cd, that can be selected at boot. If anyone knows the best way to do this, please post it. October 14th, 2007 03:33 PM
    Okay then. let's try using the Syslinux boot loader now. Here is the Syslinux documentation page in case anyone wants to study up on that and add more boot options or something.
    This how-to was made by combining ideas I found in the Ubuntu Wiki'sLiveUsbPendrivePersistent, with some ideas and a command or two I adapted from this great site, Pendrive.com's USB Ubuntu 7.10 Gutsy Gibbon install. I mixed in a lot of my own ways of doing things with what I learned from those two sites and came up with something different. I'm starting with Super Grub Disk again, but it's in its own independant file system this time. This how-to uses GParted Partition Editor for making the partitions. It's divided into three stages and you can boot the USB after each stage to make sure that part of the how-to has been completed okay. I explained what to do and why as well, in a lot of places, so it might help other people to understand what's going on. That's to make it easier to follow as well as more educational.

    Super Grub Disk for USB + Ubuntu Gutsy Live CD with Persistence

    You will need:
    A computer running an up to date Ubuntu Gutsy Gibbon with GParted Partition Editor installed in it. (sudo apt-get install gparted).
    A Ubuntu Gutsy Gibbon .iso file or a Ubuntu Gutsy Gibbon CD
    A USB flash disk, at least 2.0 GB would be big enough. Even a 1.0 GB one should work.
    A working internet connection for downloading some small files.
    The basic plan is this:
    1. We will make an ext2 partition in the USB disk and install Super Grub Disk for USB in it.
    2. We will install Super Grub Disks's GRUB to MBR and to the Super Grub Disk partition as well.
    3. Then we'll shrink the partition as small as we can.
    4. We'll make another partition named 'ubuntu7.10', formatted FAT32 for the Ubuntu Gutsy Gibbon Live CD and copy the Live CD into it.
    5. We will install Syslinux to it.
    6. We'll shrink that as small as we can.
    7. Another partition will be made, ext3, called 'casper-rw', taking up the rest of the hard disk.
    PART 1 Super Grub Disk for USB
    The reason for choosing an ext2 rather than an ext3 file system is just to save room in the USB disk. An ext2 file system is basically the same as an ext3 file system, but the ext3 file system is better for most general purposes because it features journalling. We don't need journalling for what we're going to use this file system for, 'the static files of a boot loader'. We aren't going to be writing to it once it's made. We're installing in a USB device, which is quite small and cramped, so we want to save space. The ext2 file system, without the extra overhead of the journalling feature, is what would be best for our purpose.
    Filesystem overhead in an empty ext3 filesystem takes up 149 MiB, but for ext2 only about 86 MiB is taken up by the file system's metadata blocks.

    1,1 We begin by using GParted to delete whatever file systems were already in the USB disk, (make sure you save any data out of it first though!), and we create a partition with an ext2 file system in it, using the whole disk.
    So plug in your USB flash memory disk to your computer running Ubuntu Gutsy Gibbon and if it automatically mounts, unmount it, (by right-clicking the icon and clicking 'unmount volume', and open GParted Partition Editor. Delete what's there and make your new partition with the ext2 file system in it.
    While you are using GParted, take note of your hard disks and partitions designations for your own particular computer. Write them down on a piece of paper and draw yourself a sketch if necessary so you'll be sure you know which hard disk is which and what file system is called /dev/hda1 and which is /dev/sda2 and so on. You may need to replace '/dev/sdax' throughout this how-to, with the file systems designations that suit your own unique computer.
    Close GParted.

    1.2 Open a terminal and make a label for the new file system,
    Code:
    e2label /dev/sdb1 SGD
    Where: '/dev/sdb1 is your new ext2 file system in your USB flash memory stick, if yours is /dev/(something else), then please replace it with the appropriate device designation throughout this entire how-to.
    1.3 We can either go on the internet and download a copy of the latest Super Grub Disk for USB, or use wget to get it for us.
    You can do it your way, but here I'll show you the wget comand for it in case anyone wants to do it the easiest way, (just copy and paste),
    Code:
    wget http://sgd.benjamin-butschko.de/download/binaries/sgd/usb/sgd_0.9588_for_usb.tar.gz
    1.4 Now we're going to extract it,
    Code:
    tar xvzf sgd_0.9588_for_usb.tar.gz
    Another way to do the same thing in GUI is to just right-click on the file and click 'extract here', but we're using terminal commands, it's good practice.

    1.5 Your USB disk is probably still unmounted since we just made and labelled the new file system in it. To mount it again, just unplug is and plug it back in again. Most USB devices will be automatically re-mounted.
    If it doesn't, you might need to mount it yourself, see File Systems and Mounting Page.

    Copy the /boot directory and all of it's contents into the new Super Grub for USB disk.
    Code:
    sudo cp -R sgd_0.9588_for_usb/boot /media/SGD
    1.6 Edit the Super Grub Disk's /boot/grub/menu.lst file,
    Code:
    sudo gedit /media/SGD/boot/grub/menu.lst
    BEFORE:
    Code:
    # You can edit this file to add your own distribution
    # You can choose default to 0 to select first entry
    # which it is usually the entry for the default distro
    #
    #
    # You can also set timeout to something as 10
    #
    # This is the shortcut to call Super Grub Disk (commented)
    #title Super Grub Disk
    ## 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.
    
    
    
    
    default 2
    timeout 2
    setgrubdevice # This is compulsory
    #gfxmenu /boot/grub/message
    foreground ffffff
    background 0c00ff
    color white/brown yellow/cyan
    
    
    title Inicio normal / Normal Boot 
    kernel $(grub_device)/vmlinuz lang=es a11y=none root=/dev/ram0 ramdisk_size=100000 initrd=initramfs quiet BOOT=live splash
    initrd $(grub_device)/initramfs
    
    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/menu.lst
    
    title Normal boot. Kernel is aware of Boot device
    kernel $(grub_device)/vmlinuz lang=es a11y=none root=/dev/ram0 ramdisk_size=100000 initrd=initramfs quiet BOOT=live splash boot_device=$(grub_device)
    initrd $(grub_device)/initramfs
    
    title Normal boot. Selecting kernel and initrd files depending on grub_device
    kernel $(grub_device)/vmlinuz_$(grub_device_string) lang=es a11y=none root=/dev/ram0 ramdisk_size=100000 initrd=initramfs quiet BOOT=live splash
    initrd $(grub_device)/initramfs_$(grub_device_string)
    
    title Selecthd test
    configfile $(grub_device)/boot/grub/choose/selecthd.lst
    
    title findp test
    configfile $(grub_device)/boot/grub/choose/selectpart.lst
    title set SGD variables and boot SGD
    
    configfile $(grub_device)/boot/sgd/menu.lst
    AFTER:
    Code:
    # You can edit this file to add your own distribution
    # You can choose default to 0 to select first entry
    # which it is usually the entry for the default distro
    #
    #
    # You can also set timeout to something as 10
    #
    # This is the shortcut to call Super Grub Disk (commented)
    #title Super Grub Disk
    ## 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.
    
    
    
    
    default 0
     # timeout 2
     # The two commands: setgrubdevice and usbshift are needed
    # so that SGD works well.
    usbshift
    setgrubdevice # This is compulsory
    #gfxmenu /boot/grub/message
    foreground ffffff
    background 0c00ff
    color white/brown yellow/cyan
    
     title Ubuntu Gutsy Gibbon Live CD
    root (hd1,1)
    chainloader +1
    
     title Super Grub Disk
    configfile $(grub_device)/boot/sgd/menu.lst
    
    title Inicio normal / Normal Boot 
    kernel $(grub_device)/vmlinuz lang=es a11y=none root=/dev/ram0 ramdisk_size=100000 initrd=initramfs quiet BOOT=live splash
    initrd $(grub_device)/initramfs
    
    title Soporte de accesibilidad / Accesibility Support -->
    configfile $(grub_device)/boot/grub/menu2.lst
    
    title Normal boot. Kernel is aware of Boot device
    kernel $(grub_device)/vmlinuz lang=es a11y=none root=/dev/ram0 ramdisk_size=100000 initrd=initramfs quiet BOOT=live splash boot_device=$(grub_device)
    initrd $(grub_device)/initramfs
    
    title Normal boot. Selecting kernel and initrd files depending on grub_device
    kernel $(grub_device)/vmlinuz_$(grub_device_string) lang=es a11y=none root=/dev/ram0 ramdisk_size=100000 initrd=initramfs quiet BOOT=live splash
    initrd $(grub_device)/initramfs_$(grub_device_string)
    
    title Selecthd test
    configfile $(grub_device)/boot/grub/choose/selecthd.lst
    
    title findp test
    configfile $(grub_device)/boot/grub/choose/selectpart.lst
    title set SGD variables and boot SGD
    
    configfile $(grub_device)/boot/sgd/menu.lst
    You can see what I changed highlighted in red.
    I first I set the operating system entry to be booted by default from 2 to 0, so the first entry will be booted automatically, which is going to be Ubuntu7.10
    Then I disabled the timer by 'commenting out' that line with a 'hash' mark.
    I typed in an entry to boot the second partition by chainloadingit by the boot sector. Later, we'll install syslinux in partition 2's boot sector.
    I cut the entire Super Grub Disk entry from fourth and moved it up to second place and pasted it there.

    If you're in a hurry, just copy mine from this web page and then go to your own Super Grub Disk's /boot/grub/menu.lst, click 'Edit'-->'Select All'-->'Delete', and the 'Edit'-->'Paste', to replace what was there before with the new copy. Don't forget to click 'Save' before you close the file now.

    1.7 The next thing we need to do is install Super Grub Disk's GRUB to MBR in the USB disk, and in the SGD partition as well just to make sure.
    Code:
    sudo grub
    This opens a GRUB shell

    We're going to make use of GRUB's 'tab completion' feature, to help us install GRUB to the right locations.
    So I type 'root (hd ...and press my tab key.
    Code:
    grub> root (hd
    I press tab to see what's here. NOTE: If you're copying and pasting these commands, you don't copy the 'grub>' part for these next few commands, that's just to show you we have a GRUB shell, actually, these next few commands are better off being done manually, because we're going to be using GRUB interactively to make sure we install GRUB to the right boot sector and MBR.

    Grub replies,
    Code:
    grub> root (hd
    Possible disks are: hd0 hd1
    There are two disks here, how will I know which hard disk is my USB disk and which one is my internal hard disk?
    I know that the USB disk only has one partition in it, but my internal hard disk has several partitions in it.

    I'll try a test by typing '(hd1, ' ...and pressing my tab key to see what GRUB can see in (hd0)
    Code:
    grub> root (hd0, 
    Possible partitions are:
    Partition num: 0, Filesystem type is fat, partition type 0x16
    Partition num: 1, Filesystem type is fat, partition type 0xc
    Partition num: 2, Filesystem type is ext2fs, partition type 0x83
    Partition num: 4, Filesystem type is unknown, partition type 0x82
    Partition num: 5, Filesystem type is ext2fs, partition type 0x16
    Partition num: 6, Filesystem type is ext2fs, partition type 0x16
    Nope, I don't want to install Super Grub Disk's GRUB to MBR in (hd0). I'm sure now that (hd0) is my internal hard disk.

    Code:
    grub> root (hd1,
    I'll try backspacing and type a '1' there to replace the '0', and press 'tab' again.
    Code:
    grub> root (hd1,0)
    This time it auto completes. It doesn't give me a list of partitions because there's no choice, there's only one partition I can select. Now I'm really certain I know what I'm doing!
    (The famous last words --only joking!)
    Code:
    grub> setup (hd1,0)
    That installs Super Grub Disk's GRUB to the first partition (boot sector) of the USB disk (hd1).
    Code:
    grub> setup (hd1)
    This installs Super Grub Disk's GRUB to the MBR of (hd1), the USb disk. We don't really need GRUB in both places, it's just overkill. It won't hurt anything though.
    Code:
    grub> quit
    Yay! We're finished setting up the Super Grub Disk Partition! Now we have Super Grub Disk for USB installed, and if we want, we can try it out and boot operating systems in any computer with it already.

    1.8
    One more thing we can do anytime is open GParted again, unmount the SGD partition and shrink it (resize to a smaller size), as small as it will go. We don't need any spare room in the file system at all, we aren't going to be adding any more files in it. Even if we do need to edit the /boot/grub/menu.lst again, it will only be a few lines of typing, that won't make any difference. Shrink it to as small as GParted can shrink it.
    Mine shrank right down to 86.26 MiB, so obviously Super Grub Disk doesn't take up much room at all.
    Now maybe you can see the sense in using ext2 instead of ext3, wouldn't it seem silly to use double the amount of disk space for a fancier file system when Super Grub Disk itself takes up so little room? And we're probably not going to make any more changes to teh file system anyway, so what's the use of having a journalling file system in this instance?

    ===================END OF PART ONE===========================
    Last edited by Herman; February 3rd, 2008 at 01:30 AM.
    Ubuntu user since 2004 (Warty Warthog)

  4. #4
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,097
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    ===================BEGIN PART TWO============================

    2.0
    Using GParted, we need to make a new partition taking up the free space in the USB flash drive.
    Make it formatted with a fat32 file system, because later on we're going to use the syslinux boot loader, and the syslinux boot loader will only work in a FAT32 file system.
    Close GParted and if the file system had been automatically mounted, unmount it again. (by right-clicking the icon fo rit and clicking 'Unmount Volume'.

    Open a terminal again and reformat the partition with a new fat32 file system again and name it 'ubuntu710' with this command, (just to give the file system a volume label),
    Code:
    mkdosfs -n ubuntu710 /dev/sdb2
    Where: sdb2 is the second partition in your USB drive.
    CAUTION: If you use this command again in the future, always remember only to use it on an empty file system one that has all the files backed up first, because this command is not safe like it's ext2 counterpart, this one re-formats the file system, so you will lose any data in it.
    CAUTION: Make sure you aim this at the right partition, don't mis-type the command and wipe out a partition in the wrong hard drive!!!
    This mkdosfs command is the dangerous one, the e2label command we used earlier is actually quite safe and harmless.

    Unplug the USB flash drive and plug it in again so the new file system will be mounted, ready to copy some files into.

    2.1
    I presume you have your ubuntu-7.10-desktop-i386.iso file in your /home/username directory and not inside some other directory. If you have it somewhere else, you should either move it to your /home/username directory or be prepared to type your own file path into the commands I'm going to use or your commands won't work.

    We are going to mount our .iso files so we can copy the files from the .iso files directly to the USB disk's ubuntu710 partition. An easier way to do things would be to copy them off a CD that's already made, but that would be too simple, you don't need me to show you how to do that. If you can mount an .iso file, it's a pretty good shortcut sometimes, because obviously, you don't need to go to the work of burning the .iso to a CD every time.
    Here's the command to make a mount point,
    Code:
    sudo mkdir /media/ubuntu_iso
    Here's the command to mount the .iso
    Code:
    sudo mount -o loop -t iso9660 ubuntu-7.10-desktop-i386.iso /media/ubuntu_iso
    Your USB partition should be mounted automatically already as /media/ubuntu710, because that's the name we gave the file system.
    2.2
    We'll copy the files from the mounted .iso file into the ubuntu710 partition in the USB disk,
    Code:
    cd /media/ubuntu_iso
    Code:
    sudo cp -rf casper disctree dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines ubuntu.ico casper/vmlinuz casper/initrd.gz /media/ubuntu710/
    Expect this to take a few minutes. Your USB flash disk's light will be winking and blinking for a little while.
    Ignore any error messages about 'cannot create symbolic link'.
    Code:
    cd
    2.3
    Now we need to install the boot loader called syslinux in the boot sector of the USB drive.

    Just before we do, we'll run apt-get update so our operating system will be aware of the most up to date packages,
    Code:
    sudo apt-get update
    Now we'll use apt to install the program for syslinux. This program is called mtools and when it's installed we can type 'man mtools' for more information about what it can do.
    Code:
    sudo apt-get install syslinux mtools
    Code:
    syslinux -sf /dev/sdb2
    That installed syslinux to the boot sector of the Ubuntu partition.
    2.4 We need to rename the isolinux file 'syslinux' instead.
    Code:
    sudo cp /media/ubuntu710/isolinux.cfg /media/ubuntu710/syslinux.cfg
    Now try rebooting and boot Super Grub for USB, and try booting into Ubuntu this time, it should boot up okay now. You won't have persistence, but it should work as if it was a live CD, only faster.

    ===================END OF PART TWO===========================
    Last edited by Herman; December 31st, 2007 at 06:22 AM.
    Ubuntu user since 2004 (Warty Warthog)

  5. #5
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,097
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    ===================BEGIN PART THREE============================

    Now for the persistence part of things....
    Boot up your regular hard disk installed Ubuntu operating system again, and with your USB flash drive plugged in, carry out the following steps.
    3.0
    Code:
    gksudo gedit /media/ubuntu710/syslinux.cfg
    We're supposed to use 'gksudo' in Ubuntu (Gnome), instead of plain 'sudo' for opening graphical programs like gedit, use 'ksudo' if your running KDE. I learned that from this article by aysiu, Graphical sudo.

    Editing syslinux.cfg
    We need to change the file paths by deleting all 11 instances of words '/casper, 5 occurrences of the word '/cdrom , and one instance of the word '/install from the syslinuc.cfg file.

    I will tell you a neat trick you can use with the 'less' command to help you find the words you need to delete for sure. Switch to another workspace and open another terminal up. Type this command,
    Code:
     less /media/ubuntu710/syslinux.cfg
    Enter the command 'less /media/ubuntu710/syslinux.cfg', and when the file is open in your terminal window, without closing the window, type ' //casper', and press 'Enter'. Press your 'page up' key too, to go to the top of the file.
    You should see all the instances of the word '/casper' highlighted for you!
    Do the same with '//cdrom', you might need to hit your 'page up' key. Also do '//install', (use your 'page up' key once more if you can't see the whole page properly.
    Unfortunately, I haven't discovered yet how to do any editing with the 'less' command yet. (I'm only joking, but wouldn't it be neat if we could? If anyone knows how to do something like that please let me know, I'll bet there is a program that can do that).
    We can edit the file with gedit, back in the other workspace, and we have to open and close 'less' to see the changes.
    BEFORE:
    Code:
    DEFAULT /casper/vmlinuz
    GFXBOOT bootlogo
    GFXBOOT-BACKGROUND 0xB6875A
    APPEND  file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.gz quiet splash --
    LABEL live
      menu label ^Start or install Ubuntu
      kernel /casper/vmlinuz
      append  file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.gz quiet splash --
    LABEL xforcevesa
      menu label Start Ubuntu in safe ^graphics mode
      kernel /casper/vmlinuz
      append  file=/cdrom/preseed/ubuntu.seed boot=casper xforcevesa initrd=/casper/initrd.gz quiet splash --
    LABEL driverupdates
      menu label Install with driver ^update CD
      kernel /casper/vmlinuz
      append  file=/cdrom/preseed/ubuntu.seed boot=casper debian-installer/driver-update=true initrd=/casper/initrd.gz quiet splash --
    LABEL oem
      menu label ^OEM install (for manufacturers)
      kernel /casper/vmlinuz
      append  file=/cdrom/preseed/ubuntu.seed boot=casper oem-config/enable=true initrd=/casper/initrd.gz quiet splash --
    LABEL check
      menu label ^Check CD for defects
      kernel /casper/vmlinuz
      append  boot=casper integrity-check initrd=/casper/initrd.gz quiet splash --
    LABEL memtest
      menu label ^Memory test
      kernel /install/mt86plus
      append -
    LABEL hd
      menu label ^Boot from first hard disk
      localboot 0x80
      append -
    DISPLAY isolinux.txt
    TIMEOUT 300
    PROMPT 1
    F1 f1.txt
    F2 f2.txt
    F3 f3.txt
    F4 f4.txt
    F5 f5.txt
    F6 f6.txt
    F7 f7.txt
    F8 f8.txt
    F9 f9.txt
    F0 f10.txt
    We need to add a new boot entry titled "Start Ubuntu in USB Persistent Mode" or something like that, with the right commands in the other lines to make it boot in persistent mode.
    AFTER:
    Code:
    DEFAULT /vmlinuz
    GFXBOOT bootlogo
    GFXBOOT-BACKGROUND 0xB6875A
    APPEND  file=/preseed/ubuntu.seed boot=casper initrd=/initrd.gz quiet splash --
    LABEL persistent
      menu label ^Start My Ubuntu USB in Persistent Mode!
      kernel /vmlinuz
      append  file=/preseed/ubuntu.seed boot=casper persistent initrd=/initrd.gz quiet splash --
    LABEL live
      menu label ^Start or install Ubuntu
      kernel /vmlinuz
      append  file=/preseed/ubuntu.seed boot=casper initrd=/initrd.gz quiet splash --
    LABEL xforcevesa
      menu label Start Ubuntu in safe ^graphics mode
      kernel /vmlinuz
      append  file=/preseed/ubuntu.seed boot=casper xforcevesa initrd=/initrd.gz quiet splash --
    LABEL driverupdates
      menu label Install with driver ^update CD
      kernel /vmlinuz
      append  file=/preseed/ubuntu.seed boot=casper debian-installer/driver-update=true initrd=/initrd.gz quiet splash --
    LABEL oem
      menu label ^OEM install (for manufacturers)
      kernel /vmlinuz
      append  file=/preseed/ubuntu.seed boot=casper oem-config/enable=true initrd=/initrd.gz quiet splash --
    LABEL check
      menu label ^Check CD for defects
      kernel /vmlinuz
      append  boot=casper integrity-check initrd=/initrd.gz quiet splash --
    LABEL memtest
      menu label ^Memory test
      kernel /mt86plus
      append -
    LABEL hd
      menu label ^Boot from first hard disk
      localboot 0x80
      append -
    DISPLAY isolinux.txt
    TIMEOUT 300
    PROMPT 1
    F1 f1.txt
    F2 f2.txt
    F3 f3.txt
    F4 f4.txt
    F5 f5.txt
    F6 f6.txt
    F7 f7.txt
    F8 f8.txt
    F9 f9.txt
    F0 f10.txt
    If you're lazy or in a hurry, just copy all the text from my finished one here, and go to yours and go 'Edit'-->'Select All'-->'Edit'-->'Delete'-->'Edit'-->'Paste'-->'Save'. And close the file.

    Now that's finished, unmount the volume and shrink that partition as small as you can with GParted.
    We're not going to be adding any more files to this partition.
    Even if we end up needing to edit a file, the difference will be negligible.
    Mine ended up to be only 699 MiB.

    Make another new partition taking up the rest of the hard disk. This time we'll be writing to it, so we'll make it an ext3 file system.
    Name this file system 'casper-rw'.
    Code:
    e2label /dev/sdb3 casper-rw
    NOTE: It isn't a command with the -rw option, so don't type it that way. There is no whitespace (gap) between the r and the - (dash), it's all one word.
    I started with a 4.0 GB (3.84 GiB) flash memory stick and I have 3.07 GiB in the casper-rw partition.
    The Super Grub Disk and the Ubuntu Live CD partitions are only taking up 784.40 MiB of the Flash Memory.

    Now reboot and boot Super Grub Disk for USB and from there into Ubuntu in the flash memory stick and make some obvious changes.
    Then reboot again to test whether it's persistent. It should be persistent from now on.

    You can update your system with apt-get update and apt-get upgrade if you have enough spare room in your USB drive.
    I installed Partimage, TestDisk, Smartmontools and ssh in mine already using apt-get.
    There are plenty more great applications available for Ubuntu and they're all easy to install.
    I think I can do everything I will ever need to do with my USB stick with Ubuntu.


    ============================THE FINISH LINE====================================
    Last edited by Herman; January 1st, 2008 at 03:39 AM.
    Ubuntu user since 2004 (Warty Warthog)

  6. #6
    Join Date
    Aug 2007
    Location
    Under a rock
    Beans
    66
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    I really like the way you changed the first part, using Super Grub Disk. It's much quicker than the syslinux method, and works (in effect) the same as the syslinux/isolinux that the cd uses, and has less issues when used with some setups with certain hard disk setups than the syslinux solution.

    I think extlinux might be a better solution for the second part, though I havn't had the time to find the documentation on it to see if I'm right or not. If you find out, please share

    Thanks For This Great How-To
    It was very educational.
    anime=life

  7. #7
    Join Date
    Jun 2006
    Location
    jaipur,India
    Beans
    79
    Distro
    Ubuntu Development Release

    Re: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    Thanks a Ton!
    i was looking for something like this, but is there any way by which do not alter the partions, and still boot from USB, as making a ext partion on flash drive, will ruin its main purpose sharing of data because most PC can't read ext partions by default

  8. #8
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,097
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    Tekno_Cowboy,
    Thanks, I'm happy if you like it and thanks for telling me about extlinux too, I'm looking into it.

    gary4gar
    What kind of operating system are you using? All my USB memory sticks are ext3 and all my computers read them just fine.
    Well, if you want you can use the memory stick to install Ubuntu in all those computers you find that don't have it and then you will be able to use your ext3 memory stick in any computer!

    Don't do that really, I'm only joking.
    Last edited by Herman; January 5th, 2008 at 08:16 AM.
    Ubuntu user since 2004 (Warty Warthog)

  9. #9
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,097
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    gary4gar,
    Actually, it doesn't really matter, because when you boot Ubuntu in the USB in any computer, you can use Ubuntu to mount the file systems inside the computer and read and write data in or out of the USB to any file system you like.
    Gutsy Gibbon has NTFS read and write support.
    Ubuntu is the master operating system and other operating systems are under your control when you are using Ubuntu.

    Regards, Herman
    Ubuntu user since 2004 (Warty Warthog)

  10. #10
    Join Date
    Aug 2007
    Location
    Under a rock
    Beans
    66
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOW TO make a USB Disc with Ubuntu LiveCD and Super Grub Disc in it.

    Quote Originally Posted by gary4gar View Post
    Thanks a Ton!
    i was looking for something like this, but is there any way by which do not alter the partions, and still boot from USB, as making a ext partion on flash drive, will ruin its main purpose sharing of data because most PC can't read ext partions by default
    I believe you are talking about using the extra space on a Windows PC, or to transfer files between a Linux PC and a Windows PC. Windows does not play well with ext filesystems, and tends to mount only the 1st partition on the drive. To make it work, you can simply put a FAT32 or FAT 16 filesystem at the beginning of the drive, and partion the rest out for your Linux USB. On a 4GB Survivor, I made a 2.5 GB FAT32 partition at the beginning, an ext2 partition for my live cd files in the middle, and a casper-rw partition with all the remaining space at the end. Windows sees the FAT partition, and so does Linux. Hope this answers your question.
    anime=life

Page 1 of 9 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •