Announcing: Slashdot Deals - Explore geek apps, games, gadgets and more. (what is this?)

Thank you!

We are sorry to see you leave - Beta is different and we value the time you took to try it out. Before you decide to go, please take a look at some value-adds for Beta and learn more about it. Thank you for reading Slashdot, and for making the site better!

USB Key Multitool?

Cliff posted more than 9 years ago | from the booting-from-multiple-images dept.

Hardware Hacking 34

srhuston asks: "I've got a USB key that I use for booting and installing machines (GRUB boots and pulls the rest from the network). This got me thinking, all the floppy disks and CDs that I use for various tasks, such as memtest86, SuperRescue, Plan-B, tomsrtbt and others with which I'd like to experiment, I could probably get a larger key and put a few of them on there. The problem is booting them all - it seems that unless I copy the contents of the CD to the key, I wouldn't be able to boot it properly, and doing that means I can only use one of them at a time and have to copy another to the key when I want to use it. Ideally I'd love to be able to have my GRUB menu (or something similar) pop up, and select which of the items I want to boot. Any ideas how I might accomplish this? GRUB doesn't seem to support booting an image (floppy or ISO), and ISOLINUX seems to want to boot just one image and not give options for multiple ones. Oh, and yes, I did look first and found more questions than answers."

Sorry! There are no comments related to the filter you selected.

partitions? (5, Informative)

ksheff (2406) | more than 9 years ago | (#11056594)

Can you create multiple partitions on a key and then use grub to boot from the different partitions? The HOWTO [tldp.org] implies that it can be done, but I don't have any of these devices to verify it.

Re:partitions? (3, Insightful)

Geoffreyerffoeg (729040) | more than 9 years ago | (#11057517)

I have not been able to repartition my disk. I haven't tried manually fdisking it, but I doubt it can be done. It seems that some flash drives emulate a fixed disk with a partition table, e.g., my dad's flash drive, which comes with multiple partitions to manage its security software. Others, e.g., mine, seem to only emulate a removable disk and a single partition.

Is it possible to use fdisk to "partition" a CD or a floppy - has anyone tried this? If it is, then what you suggest should be workable.

As far as my suggestion, I would suggest letting ISOLINUX switch between multiple kernels. If you need an MS partition, I think I remember a FreeDos kernel that can be loaded into ISOLINUX, and then the MS software can be bootstrapped thence. Within the drive, you can definitely store disk image files as opposed to multiple partitions, and let the kernel you boot mount the image as root instead of /dev/whatever.

Re:partitions? (2, Insightful)

Nasarius (593729) | more than 9 years ago | (#11057663)

I've had no problems repartitioning my Lexar JumpDrive. It acts just like a SCSI hard drive under Linux. I use cfdisk.

Re:partitions? (1)

Geoffreyerffoeg (729040) | more than 9 years ago | (#11057838)

Ok, I'm trying right now. I went to Mac OS X's terminal, sudo unmount'ed the disks (and confused the GUI in the process), and then used fdisk on the partition manually. I don't think there's an easy automatic way of turning a single partition (/dev/disk1) into a boot sector (/dev/disk1 and /dev/disk1s1).

The other method, once you unmount the disk, is to boot a DOS or FreeDOS in Bochs from a floppy/image, and let it think that your disk itself is its C drive. Then you can use DOS fdisk and format to redo the disk.

Under Mac OS X, and presumably under *BSD and Linux, you can read all the partitions. Windows only recognized the first one and didn't read the volume label. Although it sees the other partitions, under Computer Management's disk screen, it refuses to assign letters to the extended partitions, saying that I need to reboot the computer.

I have not tried to create 3 primary partitions. My setup is a single primary partition and two logicals in an extended. I have not tried rebooting, or booting from the USB drive. I'm going to do so now.

Re:partitions? (2, Interesting)

Malor (3658) | more than 9 years ago | (#11058005)

I forget where it is, but there's a setting you have to change under XP to be able to use NTFS on a potentially removable device. I think it might be properties on the disk itself... there's some kind of checkbox that's related somehow to 'optimize for removable'.

From what I gathered at the time (and I'm sorry I'm not clearer about remembering where it is), NTFS requires a lot of write caching to work properly, and thus Windows by default refuses to format removable drives NTFS. But keep in mind that if you do this, you MUST stop the drive with the Safely Remove Hardware applet. You CANNOT just pull it, or you'll probably corrupt it.

I don't know if this will also let you partition it, but it's worth a try...?

A related question about RAID on external media (1)

Glonoinha (587375) | more than 9 years ago | (#11059946)

A while ago I found a site that had a USB 2.0 Thumb Drive set of benchmarks (Here, if interested) [arstechnica.com] and on page 8 [arstechnica.com] he does something VERY interesting - creates a RAID 0 array out of two similar drives and shows us the benchmarks of that array.

Scaled in almost linear fashion - not a surprise but definitely thought provoking. The problem is that he did it under OSX, not Windows. Crap, I was envisioning a six drive stripe under WindowsXP Pro but it doesn't seem to be cooperating and none of the people I have asked have figured out a way to change an external drive into a 'dynamic drive', which of course is the first step towards creating the stripe set / RAID array.

Anyone have any ideas about making this work?
I think a 6G RAID 0 array (six one gig USB 2.0 drives in a stripe) with zero latency and 50MB/s throughput would be a very cool toy indeed - if only I could get it to work.

Re:A related question about RAID on external media (1)

Martin Blank (154261) | more than 9 years ago | (#11073043)

You'd wear it out pretty fast. Flash drives only support a certain number of writes (100,000 per sector, IIRC), which sounds like a lot -- and it is for most uses of the devices. But when used as a hard drive, temp files can eat up those writes very quickly. If you could ensure that you were avoiding unnecessary writing, you might be able to pull it off, but it might not be worth it in the long run.

Re:partitions? (0)

Anonymous Coward | more than 9 years ago | (#11066738)

If you're going to format a USB key as an NTFS partition, it's also worth remembering that by default, windows xp does not let regular user accounts eject NTFS drives. Not a problem for the average home user who runs as administrator, but anyone who uses them at work/university etc might have problems.

Re:partitions? (1)

Geoffreyerffoeg (729040) | more than 9 years ago | (#11061533)

Correction. Yes, it is possible to repartition my USB disk. Windows won't let you do it. Mac OS X let me do it in the Terminal: umount /dev/disk1, fdisk a partition table onto it, and then mkfs or Disk Utility|Initialize /dev/disk1s*. It seems to work great in Mac OS X - once you overwrite the filesystem with a partition table - but Windows can only recognize the first/active partition.

I suppose you can write a bootloader to the disk and let non-MS systems take the upper partitions. I've only been able to get this working under MacBochs, with disk 0 as /dev/disk1. My PC won't actually boot off the USB drive.

I guess my assertion about the two kinds of disks merely refer to disks that come with a partition table and special software to access partitions other than the active one.

Re:partitions? (0)

Anonymous Coward | more than 9 years ago | (#11077576)


Re:partitions? (1)

Basje (26968) | more than 9 years ago | (#11082492)

This only allows you 7 images to be used: 3 primary, and 4 on the extended.

That's pretty limited, even on a 32MB usbdrive, when only using floppy images.

You could.... (0, Redundant)

OAB_X (818333) | more than 9 years ago | (#11057280)

Just google it [justfuckinggoogleit.com]

Re:You could.... (1)

cliveholloway (132299) | more than 9 years ago | (#11058801)

Bad troll! :)

Next time use some inititiative and just Google it [google.com]

cLive ;-)

UBCD. (5, Informative)

kyhwana (18093) | more than 9 years ago | (#11057384)

http://ubcd.sourceforge.net/ (ultimate boot cd, which includes linux and various diagnostic/recovery tools) does this.
It gives you a menu when you boot with all the stuff it has. See the screenshots on the site.

Re:UBCD. (2, Funny)

Anonymous Coward | more than 9 years ago | (#11058798)

Got something against Clickable links [sourceforge.net] ?

<a href="http://ubcd.sourceforge.net/">Ultimate Boot CD</a>

Its not hard.

Try cdshell (5, Informative)

Yogger (24866) | more than 9 years ago | (#11057389)

Try http://www.cdshell.org/ [cdshell.org] . It's a scriptable menu that you can use to boot multiple floppy images off of cds, not sure if it works for usb keys but it's worth a try. With some tinkering you can boot linux or windows live cds but if it's too big to fit in a floppy image, you can only do one of each per disk (or usb key in your case). I have a cd built with it combining http://ubcd.sourceforge.net/ [sourceforge.net] and http://www.ubcd4win.com/ [ubcd4win.com] and a couple other tools I've found usefull

Partitions (0, Redundant)

aldragon (782143) | more than 9 years ago | (#11057439)

I don't see why you don't just use multiple partitions instead of images and use a normal bootloader. In case you don't already know, usb keys do support multiple partitions just like any other block device.

Re:Partitions (1, Redundant)

Geoffreyerffoeg (729040) | more than 9 years ago | (#11057526)

usb keys do support multiple partitions just like any other block device

Depends on the key.

I know that mine can't be partitioned (at least, my efforts thus far have failed).

Is it possible to partition a floppy? If so, does it make sense? Then you might be able to partition every USB key. Otherwise, it will depend on whether the manufacturer put a partition table in the key.

Re:Partitions (2, Informative)

polymath69 (94161) | more than 9 years ago | (#11058306)

Is it possible to partition a floppy?

Not really and kinda/sorta.

The "not really" is that modern OSs treat floppies as once big expanse of sectors, upon which a filesystem of some sort is put (FAT/EXT2/whatever) or not (cpio/tar/etc). There's no partition table as such; the dimensions are just taken as given for the drive and media.

For the kinda/sorta, I recall a utility for the Apple ][ that placed both DOS and ProDOS filesystems on the same side of a 120KB floppy. This was possible, not because of partition tables, but because DOS stored its filesystem markers on tracks 0-2 and ProDOS around track 13. So it was possible to make a disk that looked half-size to either OS. This was seldom useful, but still kind of cool.

Venturing back towards the topic, ZIP floppies do have partition tables, probably because they act like SCSI disks. Memory fobs probably have their choice to allow partitioning (emulating, say, /dev/sda) or to have it fixed (emulating only /dev/sda1 or the like.) Looks like some do it each way.

Re:Partitions (1)

Fished (574624) | more than 9 years ago | (#11060226)

For what it's worth, my lexar fob appears as "sda" and I had no trouble partitioning it exactly as if it were a "regular" floppy.

Ultimate Boot CD (0, Redundant)

Matt Perry (793115) | more than 9 years ago | (#11057443)

I don't have a solution to your USB boot problem, but until then why don't you keep a copy of the ultimate boot CD [ultimatebootcd.com] around. It'll be a good stopgap measure as long as the machines you work on have a CDROM drive.

how do you boot from USB? (2, Interesting)

Leonig Mig (695104) | more than 9 years ago | (#11057677)

is it just more modern machines that do this - does the BIOS need to support it - or can you do it with any USB machine.

Re:how do you boot from USB? (1)

Andy Dodd (701) | more than 9 years ago | (#11057884)

BIOS needs to support booting from USB.

Pretty rare in all but the most recent systems.

Re:how do you boot from USB? (1)

threephaseboy (215589) | more than 9 years ago | (#11057896)

yes, yes, and no
many older motherboards and laptops do not support booting from usb, and of those that do some only support booting from usb floppies.
most new motherboards support booting from usb drives (usb hd as well as most flash drives) and floppies.

get a key for each (2, Interesting)

chocolatetrumpet (73058) | more than 9 years ago | (#11057704)

Just get a usb keychain for each one.. they're cheap these days.

Simple isn't always bad :-)

Re:get a key for each (1)

NanoGator (522640) | more than 9 years ago | (#11058887)

"Just get a usb keychain for each one.. they're cheap these days.

Simple isn't always bad :-)"

It could kind of go either way, couldn't it? On the one hand, if he makes 1 and it dies or something, he's got some work ahead of him to make a second. Not as bad with the mulitple key approach. On the other, those keys are getting so big there's space wasted.

I don't blame him for wanting to keep just one around, though. Juggling a bunch of things like that sucks.

Re:get a key for each (1)

silicon not in the v (669585) | more than 9 years ago | (#11076853)

You might check into the system rescue CD [sysresccd.org] . It is more common for CD drives to be able to boot than USB devices, anyway, but if you want to use your USB key, you may be able to use the same booting method they use to load the images of the different utilities you want.

What about older machines, is there a boot floppy (1)

schmaltz (70977) | more than 9 years ago | (#11058066)

that will in turn boot your USB keychain? It would be nice to be able run one of these on USB 1.1 machines too. That'd cover a pretty wide spectrum of machines out there.

Memdisk (1)

Miffe (592354) | more than 9 years ago | (#11058113)

Try memdisk [zytor.com]
It allows you to boot floppy or harddrive images from grub.

Combine grub and isolinux (1)

JeffL (5070) | more than 9 years ago | (#11058369)

I boot multiple disk images from my usb key using grub as the menu, and memdisk from the syslinux package.

In grub/menu.lst I have something like:

title Hitachi Drive test utility
root (hd0,0)
kernel /boot/memdisk

Some things boot fine, like the above referenced Hitachi DFT, but other disk images don't seem to work. I've successfully booted DOS/Windows floppy images for doing BIOS upgrades, etc.

Memtest86 can be booted directly:

title Memtest 86+
root (hd0,0)
kernel /boot/memtest86+.bin

Re:Combine grub and isolinux (1)

SpaceLifeForm (228190) | more than 9 years ago | (#11059578)

I suspect that the images that won't properly load are those that have their own self-contained loader and expect the image to be in a specific position on the medium (typically floppy).

Boot DOS, then linux with loadlin (2, Insightful)

donutz (195717) | more than 9 years ago | (#11058552)

I've got RUNT [ncsu.edu] booting from my USB key. Actually, I formatted the USB key under Windows 98, SYS'ed it to make it boot to DOS, and then I set up a menu in config.sys/autoexec.bat to give me the choice of booting RUNT via loadlin [ffm.fgan.de] or a DOS prompt. You could load pretty much any kernel you need via loadlin from DOS.

Anyone know of a way to format/SYS a USB key with FreeDOS? Please share.

How about a dip switch to select the partition! (1)

Schnake (99890) | more than 9 years ago | (#11086199)

Would be cool if you could get a multi-partition USB key with dip switches to select the partition of your choice!

VMWare (1)

ballpoint (192660) | more than 9 years ago | (#11110405)

You could keep a VMWare image on the key.
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?