LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   creating a bootable usb thumb drive (https://www.linuxquestions.org/questions/linux-software-2/creating-a-bootable-usb-thumb-drive-381819/)

tlarkin 11-10-2005 11:35 AM

creating a bootable usb thumb drive
 
hello

I am working on a project for my job (IT for a school system) that will enable all the techs to effeciently do their jobs better. I am trying to make a bootable thumb drive that has menus on it for our imaging software. Each tech has a 1gig thumb drive and an 80gig usb/firewire HD given to them.

We support mostly PCs and windows, with like a 7% or so mac enviroment. I was looking into the DSL (damn small linux) kernel to make my thumb drive bootable.

However, I am running into a few snags...

I want the thumb drive to run on FAT32 file system, which I read is possible with this small linux kernel. So, I did that. I downloaded the ISO of DSL and used ISO buster to extract it to the thumb drive.

Now I would like to make a custom boot menu so that the tech has a choice of a few options, one being to image the computer. They could hit option 3 per se, and it would automatically launch the imaging software, and they would just have to pick the image (which would be on the external HD) and go from there.

We do most of the imaging over the network but sometimes that is not an option, because of location or other factors (you just can't reach a hot drop sometimes) and our wireless is way to slow to image systems over.

Anyone familiar with this stuff and could point me in the right direction, or could maybe give me some pointers/tips.

Thanks in advance for any and all who can help me on this, I am new to custom making linux boot menus.

tlarkin 11-10-2005 01:52 PM

update:

So, I ended up using this utility along with a 98 boot disk to make my thumb drive bootable.

http://h18007.www1.hp.com/support/fi...oad/20306.html

It is actually a nice utility. Then I downloaded syslinux, and made my thumb drive bootable.

No problem it will try to boot to linux, but here is the snag i am having now. At boot up it will try to boot off my thumb drive but then say it cannot find the kernel image. I copied the knoppix iso (using ISO buster) directly onto the thumb drive. The boot loader is there and the boot.cfg file is there too.

Is there any extra configuration I must do? Is there a better way to extract .iso files onto a thumb drive? Unfortunately nero will not let me directly write an ISO file to anything other than some type of burner.

The thumb drive is formatted FAT32 and so far I think this will work.

tlarkin 11-10-2005 03:25 PM

Okay, I got it working except I need help on a few things. If anyone else is interested in doing this I will list the steps, and I did this on a windows xp machine.

1) download winimage here

2) Download the floppy-usb.img file here

3) Download WinRAR here

4) Download DSL (damn small linux kernel) here

5) Make sure your thumb drive is formatted for FAT and not FAT32. Run winimage and use it to extract the boot image you downloaded onto your usb thumb drive. This process will erase all other data.

6) Launch win.rar and open up the dsl.iso and extract the whole contents as is to the thumb drive. I tried using iso buster at first but it kept putting everything in a sub folder and it won't work that way. I find win.rar easier.

7) It takes a minute to extract but once you are done, its time to set the bios to support usb booting (every bios is way different) and it will work.

Here is the snag, it boots with no usb support at all, so once i do boot into DSL my mice and keyboards do not work (I have a TON of usb keyboards and mice on systems here at my work) and would like to have support for it. I noticed in the syslinux.cfg file I found this line of coding:
Code:

APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off
vga=normal initrd=minirt24.gz noscsi noideraid nosound nousb
nofirewire
noicons minimal nomce noapic noapm quiet BOOT_IMAGE=knoppix

How can I change this to support both FW and USB?

Also, we have several systems in different configurations and boot disks for them. I would like to load each boot disk on my thumb drive and then use the "Other boot options" menu at the begining to boot of my desired boot disk? Is that easy to do?

Anyone else who is interested in helping it would be appreicated, I am learning this as I go, and if I find a solution I will post it incase anyone else in the future wants to do this as well.

saikee 11-11-2005 06:25 AM

Seems a long way to load a DSL.

The normal route I have thought should download DSL iso image, burn into a CD, boot up DSL in the CD, use the facility there to install DSL into the thumb drive and fullstop.

I think DSL will format it possibly to FAT16 system as most of the thumb drives are larger than 2Gb. FAT16 is read by all DOS and Windows and files can be copied converted into FAT32 and NTFS partition completely transparent to a user. FAT16 is used because that has the lowest overhead for a small storage and many small distros have been written to do just that. Having said that DSL will probably cope with whatever filing system you make in the thumb drive. Think I had done it in Ext2 as well as FAT16 with it.

On no usb support I am not familar with syslinux.cfg but I believe you can delete the nousb entry to re-activate the USB support. The configuration is for fast booting and some unwanted bits were possibly opted out. I am over 50% sure DSL supports USB drives.

I can't help on USB keyboard and mouse because to avoid installing the driver I have been stick with PS2 connections.

I do not understand your imaging projects and initailly thought it is to do with graphic packages. However you did say booting them so may be you are refering to different operating systems.

tlarkin 11-11-2005 08:26 AM

well here is why I took those steps, I should have been a bit more clear.

I wanted to create an image, that everyone I work with could image to their thumb drive or their external HD. However, apps like nero/roxio do not allow you to write an image file to anything other than a burner. Winimage allows to to write an image to any type of drive.

I was just basically playing around with how to make a master image that everyone could image their thumb drives with. That is all, if you know a good way to do this please share.

As for the boot menu, I was reading up on GRUB, and thinking I could possibly load it on there, and it could allow me to choose to boot off of several already made boot disks. We run novell here at my work and we pull images off a novell server. However, there are like 5 or 6 main boot cds for each of the different systems we support here. Then you add in all the specific drivers for all the different nics, and you have yourself a few different main bootable cds. For some reason, the person making the cds has never combined them into one compilation. So, I was researching on the net the best way to do so, and since I have already been playing with suse here at work I decided to look into a linux solution.

I found DSL, and thought it would be cool to have it to test out systems with (kind of like a PE) and I also have BartsPE as well. I would like to make an ultimate bootable image that will allow all techs to do the following:

At boot up off this image, choose which OS you want, DSL or bartsPE for winxp

Choose which boot disk to use to boot to our image server

or

Just choose what image you want to pull off an external usb2/firewire HD

And I would also like to load my hardware diagnostics on this as well (we currently use the newest version of PCcheck).

I think I could possibly do this with GRUB, and then be able to boot up to a menu and then select what option I want. The problem is, I have never edited a boot loader before, and I have never made a boot menu before. I had the luxury of working with a programmer and I just made him do it, and now I no longer work with him so I am learning it myself.

I think this is possible, is it not?

thanks for your reply

tlarkin 11-11-2005 01:41 PM

so i got a grub boot loader image and imaged it to a floppy. Here is the default config:

Code:

default 0
timeout 60
fallback 1

title This is a sample menu.lst file for FAT12 floppy
        commandline

title find /menu.lst
        fallback 2
        find --set-root /menu.lst
        configfile /menu.lst

title find /boot/grub/menu.lst
        fallback 3
        find --set-root /boot/grub/menu.lst
        configfile /boot/grub/menu.lst

title find /grub/menu.lst
        fallback 4
        find --set-root /grub/menu.lst
        configfile /grub/menu.lst

title enter commandline mode
        commandline

title reboot
        reboot

title halt
        halt

Could I just possibly add the line in title find/utilities/boot disk with the other parameters and then have those directories on the boot disk itself?

Sorry if this is a dumb question I just do not really know grub that well:jawa:

saikee 11-11-2005 02:25 PM

Well as faith has it you hit the jack pot this time as I use Grub to boot 50+ systems, so I may be able to offer some advice on the front.

The first one is "yes" you can edit Grub's boot menu with any editor you can lay your hand on. Grub always stores its menu file as /boot/grub/menu.lst in every Linux that uses Grub as it boot loader.

For DOS application there may not be a /boot directory (with which Linux holds the kernels) and it can be in \grub or in a:\ directory as suggested by the content of your last post.

Your last post isn't a Grub menu. It is a configuration file for Grub to construct menu.lst.

It is always the menu.lst that you want to edit for controlling the booting process!

On the question of copying pen drive to thumb drive I think that should be a straight forward application of the dd command in Linux if the source and target thumb drives are identical in size and make. Say if you want to mirroe whatever in sda into sdb then the following command should do it

dd if=/dev/sda of=/dev/sdb

This is the exact command (minus the parameter on block size) I use successfully for cloning large hard disks, say 200Gb. I can't be absolutely that sure thumb drives will work but my experience with the thumb drives would indicate no technical difficulty. In dd the binary pattern is mirrored so although Linux cannot write a NTFS partition it can clone a bootable XP operating system!

You are asking a lot of things which are nonstandard and not off the shelf item. I think you better make up your mind as what you want to achieve before I could assist. There is a language problem too and I am not familiar with your set-up. My knowledge in Linux is relatively green, about 1.5 year. The bit I am comfortable is to advise how one can use Linux to boot DOS, Win3x, Win9x, Win2k,XP, Linux, BSD and Solaris. Running software from the system onward depends on my previous exposure to such programs.

I guess there may be one thing of interest to you. Grub is used by over 50% of the Linux. It is also used by DOS 7.10 and in the latest Solaris. However Grub can also be used without any operating system attached and used to boot any PC system. The arrangement is you put the image inside the computer in a standard way then Grub can boot it up. You can have as many systems as you want. Grub can be made available in a floppy or a CD.

tlarkin 11-11-2005 02:39 PM

saikee-

Yup, you hit it right on the nose. Sorry if I confused you, let me be clear of what I want to accomplish here. We are mainly a windows enviroment and do have some macs, but no users actually use linux. We have one linux server (which is used for data storage and network shares) and a few of the fellow techs in the IT department are running suse 10. I myself am running suse 10 on my laptop, and so far I like it for the most part, but wish they would fix some bugs.

Now, we do have about 3 or 4 main bootable cds we use to image systems over the network. Each one is only a few megs in size and they could all easily be compiled on one nice image, which in return could be imaged onto an external HD, a thumb drive, a cd whatever.

Why I chose grub is because it is OS independant. I would like to boot to a grumb menu and have the following options for like a master boot disk. So whenever you boot off it you get these choices from a boot menu. I am guessing that grub can do this from what I have been reading.

1: restore an image
2: Boot to OS
-sub menu-
DSL linux
WinxpPE
3: Run PCcheck
4: Boot to command line
5: Boot disk
-sub menu-
choose which boot disk


Something like that. I am almost done building the PE for winxp as we speak with all of our networking clients and such loading up. I would also like grub to boot up with usb support so if need be, it can load stuff off my 80gig external 2.5" HDD.

I hope that is a bit more clear and sorry if I was confusing you sometimes I start rambling and do not focus on one subject at a time. Since we also mostly run in a windows enviroment I would like to make an image of this using winimage (since it will image to any drive/device) so all the other techs can just grab it and go. Not everyone I work with uses linux only a few of us.

saikee 11-11-2005 05:45 PM

tlarkin,

OK I see your problem and I repeat Grub only boots an operating system.

My main concern is your image is a binary program executable in a PC. You need an operating system to handle its execution and Grub isn't the right guy for the job. What Grub can do is simply boot the system that can execute your image.

I estimate Grub is no bigger than one-third of DOS. It can boot up a system by two methods.

(a) It can load the kernel of that system, as it does for Linux, BSD etc
(b) It can load the boot loader of a foreign system that has no kernel, like DOS or Windows

Therefore in order for Grub to load anything for your use you must supply Grub either

a kernel that Grub can read and retrievable from a hard disk
or the location of the boot loader of the system.

Grub has been succesfull in what it does because in PC standard every operating system can be arranged inside one partition. Inside every partition there is a reserved track specially for the boot loader. Thus all Grub need to load an operating system is just the partition number and whick disk.
-------------------------
So much for the above rubbish but you may review it and assess if Grub can do the job you want.

I think within reason you may be able to achieve you above objectives by displaying sufficient instructions from the booted system screen to guide the user into loading the image after Grub has given you the operating system.

Your idea of skipping the operatiing system is appreciated by me as I would like to see such thing happening but there is one huge brick wall infront of you. Every PC has enormous amount of hardware variations and just to keep on top of it even with a full blown kernel is a huge task for ant Linux distribution. How on earth you can expect to do away without a kernel? If you have Linux's kernel, or DOS or XP then you can run any program you like.

So my experience in computing has convinced me that asking Grub to load a program or an image without going through a kernel type stage to obtain the hardware support is a no-go area.

Apart from the above I can confirm you can ask Grub boot another Grub, or Lilo or Windows' NTloader and so command line, sub-menus etc are no problem for Grub.

Grub is a boot loader. It's duty is to bring a full operating system into the PC and bugger off before you can say than you. Grub is an binary image with its first part readily grabbed by the BIOS. The grabbed first part pulls the second stage into the meorary.

If you want Grub to load an image (or binary code) it can be done by storing it in the boot sector of a partition. The image has to be specially written so that Grub can "cut and paste" itself with the first sector (or 512 bytes) of your image. In other word Grub use 512 bytes of itself and pastes at the 513th byte of your image. The combined code has to be executable in a pc though! IN such a case your image will be regarded as another boot loader.

The above is my assessment of your proposal.

tlarkin 11-15-2005 01:13 PM

well each bootable diagnostics tool or boot disk has some sort of bootable os on it. Whether it be caldera dos, pc dos, euro dos, a bootable linux kernel, windows PE, ghost boot disk, etc, I want to create a boot loader menu that will allow me to consolidate all of my disks onto one cd or dvd. Then I want to be able to select my desired function from a menu and go from there.

The images can be stored on a network drive or on an external HD, the boot disk would just have the boot loader menu come up first and allow the tech to select what they want to do.

I won't be using grub to do anything else besides setting it up to allow me which boot disk, which utility, or which OS to load. Is that not possible? From grub's documentation it seems that it would be possible to accomplish this.

If not, what else can I use linux wise to make an ultimate boot disk?

I will give you a link of an example of what I found online, this is pretty much what I want, but I want to put my configuration on it.

http://www.ultimatebootcd.com/

homey 11-15-2005 02:07 PM

Quote:

I won't be using grub to do anything else besides setting it up to allow me which boot disk, which utility, or which OS to load. Is that not possible?
Yes, I use grub and memdisk to load various disk images.
For example:
title Freedos V.9
kernel /boot/memdisk
initrd=/images/freedos.img
title Ranish Tool V2.44
kernel /boot/memdisk
initrd=/images/ranish.img

tlarkin 11-15-2005 02:19 PM

Quote:

Originally posted by homey
Yes, I use grub and memdisk to load various disk images.
For example:
title Freedos V.9
kernel /boot/memdisk
initrd=/images/freedos.img
title Ranish Tool V2.44
kernel /boot/memdisk
initrd=/images/ranish.img

Thanks can you point me in the right direction of some documentation on how to custom build my own personal menu?

thanks for your reply

homey 11-15-2005 02:40 PM

I got inspiration from RIP linuxcd which uses the grub menu.
You can read up on memdisk at http://syslinux.zytor.com/memdisk.php and you should be able to download the latest from there also. You could also use the one from the RIP cd.

I created a folder for putting stuff into and sub folders like this
cdbuild is the /
isolinux
images
other stuff...

Then, I make the grub menu ( nice example on RIP )
Here's my latest grub menu ( needs updating one of these days )
Code:

      color light-gray/blue black/light-gray
title *=*=*=*=*=*=*=*=*=*=*=*=* CDROM BOOT MENU *=*=*=*=*=*=*=*=*=*=*=*=*=*=*
root (hd0)
title Windows
        rootnoverify (hd0,0)
        chainloader +1
title Fedora Core
        root (hd1,1)
        kernel /boot/vmlinuz ro root=/dev/hdb2 rhgb quiet
        initrd /boot/initrd.img
title Rescue CD V0.2.15
kernel /boot/vmlinuz1 acpi=off root=/dev/ram0 init=/linuxrc nokeymap vga=785
initrd=/boot/initrd1
title Insert Linux V1.2.18
kernel /isolinux/vmlinuz ramdisk_size=100000 init=/etc/init lang=en apm=power-off hdc=scsi hdd=scsi vga=791 nomce quiet BOOT_IMAGE=insert
initrd=/isolinux/miniroot.gz
title RIP Linux V12.3
kernel /boot/kernel devfs=nomount vga=normal nokeymap init=/linuxrc root=/dev/ram0 rw
initrd=/boot/initrd.gz
title Feather Linux V0.7.4
kernel /isolinux/linux24 ramdisk_size=100000 nodma init=/etc/init lang=us apm=power-off vga=791 nomce quiet BOOT_IMAGE=knoppix
initrd=/isolinux/minirt24.gz
title Slax Linux V5.0.0
kernel /boot/vmlinuz2 max_loop=255 init=linuxrc livecd_subdir=/ load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=4444 root=/dev/ram0 rw
initrd=/boot/initrd2.gz
title Puppy Linux V1.0.0
kernel /boot/vmlinuz3 root=/dev/ram0 PFILE=pup001-none-262144
initrd=/boot/image3.gz
title Freedos V9
kernel /boot/memdisk
initrd=/images/freedos.img
title Ranish Tool V2.44
kernel /boot/memdisk
initrd=/images/ranish.img

Then, I make the iso image using the grub iso9660_stage1_5
Code:

mkisofs -J -R -b boot/grub/iso9660_stage1_5 -c boot/boot.cat \
-o /home/bootcd.iso -no-emul-boot -boot-load-size 4 -boot-info-table .


aus9 02-21-2006 06:39 AM

homey and saikee

as I admire your minds greatly I thought I would hijack this thread a tiny bit to mention that I am thinking of making an howto for linux users who do not have access to winimage....or other MS executables for extracting floppy images to a bootable cd.

Mainly because many new computers have no floppy drives but some may want to flash their kernel etc.

Ultimate cd looked good until I saw it uses winimage.

I am thinking aloud I might go down the path of

extract floppy image downloaded from say bootdisk...with dd
create cd iso with mkisofs
cp the dd file
add the needed extra file
test with a mounted loop

has this wheel already been invented ? any links?
anything better?

(2) the goals will be to make a bootable cdr that has bios files on it....may have to be decompressed....or executable files


All times are GMT -5. The time now is 09:24 AM.