Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

[GUIDE] - Boot Multiple Live Operating Systems from a Flash Drive

  • 05-05-2009 2:47pm
    #1
    Registered Users, Registered Users 2 Posts: 1,849 ✭✭✭


    I came across this idea of booting Live OS’s from USB a few days ago and went about researching it, eventually I found a very helpful thread here at the neowin forums with a guide to booting multiple systems. Most of the credit for this guide goes it Si and the others on the neowin forums. I just adapted it and go about it in a slightly different way. This tutorial assumes you are running Windows Xp/Vista.

    This is very useful for anyone working in IT or anyone that finds themselves asked to fix pc’s on a regular basis so I thought a few people here might find it useful. It is also a nice way to get into some form of Linux without the hassle of installing it.

    Right now I have a 16gb memory stick which, when I boot from, gives me these options
    I have only used about 5gb or so for all of these so you can do this with smaller drives too.

    UBCD4Win, Backtrack 3,Backtrack 4 Beta, Hiren’s Boot CD 9.8, SystemRescueCD 32/64bit, Knoppix 5.1.1, Puppy Linux, Damn Small Linux, Slax, Windows Recovery Console, Memtest86+, WinDiag, Darik's Boot and Nuke and NTFS-Dos (among others) (yes, I went a bit OTT with the linux distros but I have a lot of time on my hands :p )

    The method I describe here assumes you want to be able to boot the Ultimate Boot CD for Windows (very useful Bartpe implementation including large amount of utilities)
    The Bartpe setups can be tricky to setup so I find it easier to start with this and work from there.

    If you have a very large drive and do a lot of Windows installations in theory you could copy the i386 folders from your Windows cd’s somewhere on the flash drive and launch the installers from the NTFS command line installed by UBCD. (Although I have not tested this)
    You cannot however boot multiple windows/PE type environments from one drive (As far as I know)

    Part 1: Preparing Drive and Installing UBCD4Win

    Note that if you don't want UBCD4win and just want to go ahead and start installing other things you can follow the instructions here... You can also install any other BartPE/WinPE implementation using PetoUSB found here

    • Download UBCD4Win from here -
    Follow the guide to build UBCD here (you need to have a windows xp cd handy)

    • While UBCD is building insert your flash drive and open up my computer, Format the drive by right clicking on it and pressing format, Use FAT32 and quick format to speed things up *Note this will delete everything on the flash drive

    • When your ubcd ISO is built navigate to C:\UBCD4Win\plugin\!Critical\ubcd4wintoUSB
    Double click ubcd4winTOUSB.exe and choose your usb drive on top. Untick Enable Disk Format as FAT16 will run into problems with larger flash drives. Leave everything else as it is (make sure grub4dos is selected) and press start.
    This program will modify the MBR on your drive to make it bootable, install grub4dos and copy over the files for UBCD.
    UBCD4Windows is now installed on your bootable USB drive, reboot and change bios settings or boot menu settings (F12 on a dell) to test the disk (most computers from the past 2 or 3 years should be able to boot from USB). UBCD also installs a number of other things like Memtest, Windows Recovery Console, ntfs-dos and Dariks Boot and nuke and you should see these in the grub boot list.

    If you would like to be able to access some of the programs inside UBCD/Bartpe from inside windows (which is what happens when you use a ubcd cd inside windows) go to the root of the flash drive and make a new text file called autorun.inf (make sure it dosent have a .txt after it) and add these lines:
    [autorun]
    open=Programs\nu2menu\nu2menu.exe
    

    Part 2: Installing other Distributions

    •Download the distributions you want to install to your usb drive.

    This only works with Live-Cd type distributions like those I have listed above but you could also follow instructions for installing full distributions to usb on pendrivelinux.com. Should you choose to install a full distribution however, be careful not to overwrite the MBR installed by UBCD.

    One distribution I have always found very useful is Hiren’s boot CD so I will start with that as an example.
    Download the Hiren’s Boot CD ISO (Google it)
    Open the ISO with Winrar or similar or mount it on a virtual drive.
    Copy the HBCD folder to the root of your flash drive (on older versions this may be called Bootcd or similar)

    Now to add it to the grub boot menu:
    Open the root of your flash drive in explorer and find menu.lst . Open this file in notepad.
    Now you can see all the existing listings and comments inserted by UBCD.
    Choose somewhere in the list you would like Hirens (I have it 2nd) and make some space.

    Now enter this:
    Please see below for updated HBCD instructions
    title Hiren’s Boot Cd
    kernel /HBCD/memdisk
    initrd /HBCD/boot.gz
    

    Save the file and your done! HBCD is now installed and bootable. While your in menu.lst if you would like to remove the backdrop picture installed by UBCD (it makes the text hard to read) you should delete this line “splashimage /LOGO.xpm.gz” When you now boot into the USB stick you will see the Hirens Boot Cd entry in grub and it should boot when you press it.

    • The steps for Backtrack/Slax/DSL/Knoppix are basically the same so one example should do it.
    Open the Knoppix ISO (this works for V5.1.1) and copy the folders boot and knoppix to the root of your flash drive. On your flash drive rename the boot folder to bootknop (this lets you boot more than one distrib, they all have a boot folder)
    Open up menu.lst again and make a new entry like this:
    title Knoppix 5.1.1
    kernel /bootknop/isolinux/linux ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off vga=791 nomce quiet loglevel=0 nolapic_timer
    initrd /bootknop/isolinux/minirt.gz
    

    The startup options and menu.lst entries are different for each distro and im not even sure if they are necessary but I will post my complete menu.lst below so you can see what I have used. I got most of mine from other forums. Dsl only has one folder (boot) but the process is the same.

    For Puppy Linux copy the contents of the iso to a folder called Puppy on the root of the flash drive and use the menu.lst entry you can see below.

    For SystemRescueCd copy the folder isolinux and the files sysrcd.dat, version and sysrcd.md5 to the root of your flash drive. Don’t rename anything, use the menu entry below.

    I was going to include ntpasswd but this dosen’t seem to work corrently with grub, the application is available inside UBCD.



    Included below are screenshots of my folder layout and my menu.lst file. If you found this helpful I would appreciate a thanks.
    Tagged:


Comments

  • Registered Users, Registered Users 2 Posts: 1,849 ✭✭✭Redisle


    # This is a sample menu.lst file. You should make some changes to it.
    
    color black/cyan yellow/cyan
    default /default
    
    # menu.lst - See: grub(8), info grub, update-grub(8)
    #            grub-install(8), grub-floppy(8),
    #            grub-md5-crypt, /usr/share/doc/grub
    #            and /usr/share/doc/grub-doc/.
    
    ## default num
    # Set the default entry to the entry number NUM. Numbering starts from 0, and
    # the entry number 0 is the default if the command is not used.
    #
    # You can specify 'saved' instead of a number. In this case, the default entry
    # is the entry saved with the command 'savedefault'.
    # WARNING: If you are using dmraid do not change this entry to 'saved' or your
    # array will desync and will not let you boot your system.
    default		0
    
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout		10
    
    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    #hiddenmenu
    
    # Pretty colours
    #color cyan/blue white/blue
    
    ## password ['--md5'] passwd
    # If used in the first section of a menu file, disable all interactive editing
    # control (menu entry editor and command-line)  and entries protected by the
    # command 'lock'
    # e.g. password topsecret
    # password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    # password topsecret
    
    
    title The Ultimate Boot CD for Windows
    fallback 1
    find --set-root /minint/setupldr.bin
    chainloader /minint/setupldr.bin
    savedefault --wait=2
    
    title Hirens Boot Cd 9.8
    kernel /HBCD/memdisk
    initrd /HBCD/boot.gz
    
    title SystemRescueCD 32bit
    kernel /isolinux/rescuecd
    initrd /isolinux/initram.igz
    
    title SystemRescueCD 64bit
    kernel /isolinux/rescue64
    initrd /isolinux/initram.igz
    
    title Backtrack 3
    kernel /bootbt3/vmlinuz vga=0x317 ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;kdm nosound
    initrd /bootbt3/initrd.gz
    
    title BackTrack 4 Beta
    kernel /bootbt4/vmlinuz vga=0x317 ramdisk_size=6666 root=/dev/ram0 rw quiet
    initrd /bootbt4/initrd.gz
    
    title Knoppix 5.1.1
    kernel /bootknop/isolinux/linux ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off vga=791 nomce quiet loglevel=0 nolapic_timer
    initrd /bootknop/isolinux/minirt.gz
    
    title Puppy Linux
    find --set-root /grldr
    kernel /puppy/vmlinuz root=/dev/ram0 initrd=initrd.gz PMEDIA=usbflash PKEYS=uk
    initrd /puppy/initrd.gz
    
    title Damn Small Linux
    kernel /bootdsl/isolinux/linux24 ramdisk_size=100000
    initrd /bootdsl/isolinux/minirt24.gz
    
    title Slax
    kernel /bootslax/vmlinuz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4 changes=/slax/
    initrd /bootslax/initrd.gz
    
    title Windows(tm) Recovery Console
    fallback 1
    find --set-root /cmdcons/setupldr.bin
    chainloader /cmdcons/setupldr.bin
    #####################################################################
    # write string "cmdcons" to memory 0000:7C03 in 2 steps:
    #####################################################################
    # step 1. Write 4 chars "cmdc" at 0000:7C03
    write 0x7C03 0x63646D63
    # step 2. Write 3 chars "ons" and an ending null at 0000:7C07
    write 0x7C07 0x00736E6F
    savedefault --wait=2
    
    title Memtest86+
    map --mem (hd0,0)//Images/memtest.img (fd0)
    map --hook
    chainloader (fd0)+1
    rootnoverify (fd0)
    
    title WinDiag
    map --mem (hd0,0)//Images/windiag.img (fd0)
    map --hook
    chainloader (fd0)+1
    rootnoverify (fd0)
    
    title Darik's Boot and Nuke
    map --mem (hd0,0)//Images/dban.ima (fd0)
    map --hook
    chainloader (fd0)+1
    rootnoverify (fd0)
    
    title GOBACK Removal Tool
    map --mem (hd0,0)//Images/goback.ima (fd0)
    map --hook
    chainloader (fd0)+1
    rootnoverify (fd0)
    
    title NTFS-Dos
    map --mem (hd0,0)//Images/ntfs4dos.img (fd0)
    map --hook
    chainloader (fd0)+1
    rootnoverify (fd0)
    
    title CommandLine
    savedefault --wait=2
    commandline
    
    title Reboot
    savedefault --wait=2
    reboot
    
    title Boot Hard Disk 1
    map (hd0) (hd1)
    map (hd1) (hd0)
    map --hook
    chainloader (hd0)+1
    
    

    21429967.th.jpg


  • Closed Accounts Posts: 2 manimal666


    fantastic guide made things so much easier for me i spent ages trying to get it to boot 3 different live cd's from different partitions giving them all there boot manager and a seperate boot manager to load them and various other techniques, come across this and bam done 10 minutes no messing lol.

    i was however wondering if its possible to add two other things im currently trying to add

    1. Paragon partition manager boot disk
    2. vista or xp setup (possibly both)

    any ideas on tht gratefully appreciated and thanks again for the guide


  • Registered Users, Registered Users 2 Posts: 3,091 ✭✭✭Antar Bolaeisk


    Wow, great post, thanks. One vote for it to be stickied.


  • Moderators, Education Moderators, Technology & Internet Moderators Posts: 35,125 Mod ✭✭✭✭AlmightyCushion


    Wow, great post, thanks. One vote for it to be stickied.

    Kinda but not quite. I added a new section to one of the stickies.

    http://www.boards.ie/vbulletin/showthread.php?p=60838550#post60838550

    Some day I'll amalgamate all the stickies into one super sticky. If anyone has any more guides like this please post 'em up.


  • Posts: 3,620 ✭✭✭ [Deleted User]


    I typed this up before I saw this thread! Excellent work btw.

    I got myself an 8 gig key and I've been experimenting with putting bootable tools on it.
    Ideally I want a USB version of the BartPE disk we use, Backtrack, memtest and perhaps ntpasswd. Basically all the bootable stuff we could use week to week.
    I'd like the 6gig odd free for storing files etc.

    The first obvious problem is most PCs that will boot off of a USB device will only do so off plain old FAT16 formated devices (for bart pe).
    The maximum that it can be is 4gig and thats pushing it. So only 4 of the 8 gig will be available to windows(becuae bartpe will be sitting in the only readable partition) Put an extra 4 gig partition with a 3rd party utility? Unfortunatly windows will only recognize the first partition on the USB device.
    Linux has no such qualms and will read any partitions you put on it.

    I have successfully got all the bootable apps working including BartPE using GRUB to choose at boot time. The problem still remains that the bulk of the space is inaccessible to windows?

    Whats the best way to partition the drive to get this working? Ideally I'd like to use some of the drive for plain old storage.


  • Advertisement
  • Closed Accounts Posts: 2 manimal666


    you can make any operating system see your usb stick as a fixed drive instead of a removable drive by "flipping the bit" as it is called there a few programs out there that do this and that will give your usb stick the ability to have multiple partitions and any operating system read them without the aid of a filter driver its what i did with my 16 gig i got 8 gig for recovery/problem software and 8 gig for my personal files and every pc or laptop iv plugged it in up to now its read both partitions fine xp/vista and win98.


  • Closed Accounts Posts: 3 kiwiruss


    Getting an error with Knoppix

    insmod: error inserting '/cdrom/KNOPPIX/modules/cloop.ko: -1 Invalid module format.

    Cant Find KNOPPIX file system, .....

    The file is there ( o kb though) but looks the same as in the iso.

    And,
    Got any tips on getting ubuntu going also ? I'd rather do Ubuntu than Knoppix.


  • Closed Accounts Posts: 3 kiwiruss


    I got knoppix 6 working.


  • Closed Accounts Posts: 3 kiwiruss


    kiwiruss wrote: »
    I got knoppix 6 working.

    title Knoppix 6
    kernel /bootknop/isolinux/linux ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off vga=791 nomce quiet loglevel=0 nolapic_timer
    initrd /bootknop/isolinux/minirt.gz


  • Registered Users, Registered Users 2 Posts: 7,893 ✭✭✭The_B_Man


    i'm tryin to get ubuntu and fedora working on my 16GB drive.
    i can get ubuntu working on its own using the tutorials on pendrivelinux.com but i havent got the know ho to combine it with this excellent tutorial.

    I noticed one thing though. Ubuntu uses syslinux and this uses grub4dos. could this be an issue? I'm sure ubuntu and fedora support both.

    also, look at this link about half way down.
    Preparing files for USB Memory Stick
    is this what i need to add to the menu.lst?

    cheers


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,849 ✭✭✭Redisle


    Ha, Just decided to check back on this to see if it got any replies. I stopped checking after the first few weeks and started thinking maybe I had WAY too much time on my hands :p
    Lucky I go back to/start a new college course in a few weeks.

    Ive just been cleaning out my own flash drive so now all I have is

    Backtrack 4
    Ophcrack
    Hirens Boot CD 9.9
    Puppy Linux
    SystemRescue CD

    Honestly though I haven't had the chance to really use any of the stuff I have on my flash drive. Was working in IT support/admin Summer 07 and 08 but nothing this year.. damn recession :/
    The other thing is I have forgotten a lot of what I wrote here a few months ago..

    @ronoc
    I only have 2 partitions on my drive. One is 13gb and the other is 2gb. I use the 2gb one for changes files for Backtrack and I have everything else in folders on the 13gb one. What I have done is set the folders related to bootable things as Hidden and just have a folder called "Data" to use for normal storage.

    @The_B_Man
    Il look into that grub / syslinux thing. If I remember correctly I did have some problems using them together.

    Something I have just discovered today is the use of Virtualbox to test the usb drive. Very handy when trying to get multiple things to boot from a flash drive since you don't need to reboot to test.

    Follow the tutorial here to get this working. Will make this process go much faster..

    Im also currently installing tons of portable apps to run inside windows from my flash drive. I started with Liberkey Ultimate which is great because it comes with tons of apps and is really well organised into categories. Ive been adding a load of my own apps to this so now Ive got nearly 300 :D
    It can now pretty much do anything I could ever want to within windows so after a fresh windows install I can just copy this to the harddisk and add it to startup to have instant access to almost 300 apps..and of course I also have access to these wherever I am from the flash drive... This one is much handier than other portable app suites since it can automatically update the apps that are included with it, very handy for security related ones at least.


  • Registered Users, Registered Users 2 Posts: 1,849 ✭✭✭Redisle


    Alright

    @The_B_Man

    I did have problems with Fedora and have not got that working as of yet but..
    It’s actually easy enough to get Ubuntu working with grub4dos.
    After some experimenting and searching I have it working and saving changes.


    So if you followed my tutorial above and have grub4dos installed this is straight forward enough.

    If you don’t have a bootable USB yet or have it installed with syslinux you can follow the above tutorial using UBCD4Win or if you don’t want UBCD4Win you can just follow this: Figured I should post this anyway so people don't have to install UBCD4win.


    Alternative Method for Making Flash Drive Bootable and installing Grub4Dos.

    Format your flash drive using windows, FAT32 should be fine.

    You don't need to repartition your flash drive (unless you need a linux partition for something specific like Backtrack change files)



    • Download Grub4Dos here
    • Extract grub4dos and copy grldr and menu.lst to your flash drive.
    • Download grubinstall here
    • Extract and run grubinst_gui.exe

    • Choose Disk up on top and choose your drive in the drop down menu, you may need to press refresh to make the drives appear.
    Make sure to select correct drive as this will modify the MBR of the selected drive. Press Refresh opposite Part List then choose Whole Disk (MBR)

    • Leave everything else as is and press install down the bottom. If this goes okay your drive is now bootable and you can start copying over live cd’s and modifying your menu.lst to suit. You can feel free to delete any existing entries in the menu.lst or just make a blank menu.lst.


    Now on to ubuntu.

    Adding Ubuntu 9.04 Live CD to a grub4dos Setup


    • Download the ubuntu ISO. Open the ISO with Winrar or mount it on a virtual drive.
    • Copy all the folders except isolinux to the root of your flash drive, don’t bother with the loose files.

    Add this to your menu.lst
    title Ubuntu 9.04 Live 
    find --set-root /casper/vmlinuz
    kernel /casper/vmlinuz noprompt cdrom-detect/try-usb=true persistent file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
    initrd /casper/initrd.gz
    boot
    

    If you want it to be persistent (save changes) you need to get a casper-rw file from here and add it to the root of your flash drive.

    The 1gb casper-rw file is included in the u9.04p.exe (Self extracting exe) download but get one of the larger ones if you so wish.

    That's it! The above works fine for me anyway, you could just follow the pendrivelinux tutorial if you just need ubuntu but it's handy to be able to add it to an existing grub4dos installation.

    Adding Hiren's Boot Cd 9.9 To Grub4Dos Setup.

    Just thought id give this a mention while Im updating this thing. The menu.lst entry is different this time (and im not even sure if that last one worked correctly, never got a chance to test it correctly)

    • Download the Hiren's Boot Cd ISO (Google it)
    • Copy the HBCD folder from the ISO to the root of your flash drive.

    Add this to your menu.lst:
    title Hiren's BootCD 9.9
    find --set-root /HBCD/boot.gz
    map --mem /HBCD/boot.gz (fd0)
    map --hook
    chainloader (fd0)+1
    rootnoverify (fd0)
    map --floppies=1
    boot
    

    Done!



    I highly recommend anyone trying to make one of these Bootable USB's to install Virtualbox and follow the tutorial I mentioned in the previous post. It makes testing way way easier and Im sorry I only just discovered it!
    Think Im gonna be trying out a few more random Live cd's now that it's so easy to test it!


Advertisement