Transterrestrial Musings  


Amazon Honor System Click Here to Pay

Space
Alan Boyle (MSNBC)
Space Politics (Jeff Foust)
Space Transport News (Clark Lindsey)
NASA Watch
NASA Space Flight
Hobby Space
A Voyage To Arcturus (Jay Manifold)
Dispatches From The Final Frontier (Michael Belfiore)
Personal Spaceflight (Jeff Foust)
Mars Blog
The Flame Trench (Florida Today)
Space Cynic
Rocket Forge (Michael Mealing)
COTS Watch (Michael Mealing)
Curmudgeon's Corner (Mark Whittington)
Selenian Boondocks
Tales of the Heliosphere
Out Of The Cradle
Space For Commerce (Brian Dunbar)
True Anomaly
Kevin Parkin
The Speculist (Phil Bowermaster)
Spacecraft (Chris Hall)
Space Pragmatism (Dan Schrimpsher)
Eternal Golden Braid (Fred Kiesche)
Carried Away (Dan Schmelzer)
Laughing Wolf (C. Blake Powers)
Chair Force Engineer (Air Force Procurement)
Spacearium
Saturn Follies
JesusPhreaks (Scott Bell)
Journoblogs
The Ombudsgod
Cut On The Bias (Susanna Cornett)
Joanne Jacobs


Site designed by


Powered by
Movable Type
Biting Commentary about Infinity, and Beyond!

« Where's The ACLU (Part Two)? | Main | I Never Fail To Be Amazed »

External Hard Drive Question

I've been thinking that a good way to make my laptop dual boot without messing with the current Windows installation would be to install a Linux distro on an external USB drive. Two questions:

Are there any problems with this (assuming that I can boot off a USB port) and are there any external drives that get their power from the USB port (so I don't have to find a power socket to use it)?

[Update a few minutes later]

OK, the search word I was missing was "portable." There do seem to be some available that run off the USB port.

[Update a couple minutes later]

It seems to me that the cool thing about this is that you could boot from anyone's computer into your own system, as long as the machine was bootable from USB.

Posted by Rand Simberg at June 26, 2006 10:37 AM
TrackBack URL for this entry:
http://www.transterrestrial.com/mt-diagnostics.cgi/5710

Listed below are links to weblogs that reference this post from Transterrestrial Musings.
Comments

Yes, that's a very big advantage, and something I was thinking about earlier today as I was using my new USB keydrive. I figured that, with a sufficiently sized drive, you could basically have a portable computer that you could plug in to any public "workstation" and have everything you needed, customised and ready to go.

With the way Windows handles drivers and registration, this would be next to impossible to actually implement, but with something like Linux or Mac OS X, probably much easier to accomplish.

Posted by John Breen III at June 26, 2006 11:13 AM

USB does not provide enough power to run a 3.5" drive comfortably. It's 500mA max, and software has to enable it first. If you use a low-power 2.5" drive, then it will work -- with the associated loss of performance. Another unfortunate aspect of this is that the failure modes are often random when the device tries to draw more than it promised to the host.

For that reason, I carry a power supply (taken from my GPS kit) with my drive.

The theory is that the architecture of software-visible device descriptors and power states should ensure a reliable operation of the system and the power negotiation, or a clear indication of power overrun. But apparently it was just too much to ask from the lose conglomerate of software hackers and firmware monkeys to develop to a complex spec without a reference implementation. Both Windows (of all stripes) and Linux exibit issues, and there's bunch of broken devices lying about their power, having power spikes, or throwing signal integrity problems when drawing closer to the limit.

I think your only 100% safe bet is an iPod Video. 3G and below will not charge from USB. The 4G and Mini have off-by-one problem reporting their sizes. Nano is too small to install Linux.

Posted by Pete Zaitcev at June 26, 2006 11:16 AM

iPod nano is available in 1, 2, and 4 GB models. Are you sure you can't install a small but usably complete system in 1 GB?

Posted by Sam at June 26, 2006 11:27 AM

iPod Video because it has its own power?

I'm starting to think maybe I should just get a powered drive for now, and not use it on a plane.

Posted by Rand Simberg at June 26, 2006 11:45 AM

I thought you couldn't boot of a USB device.. you needed 1394 for that. Maybe I'm mistaken.

Posted by Jane Bernstein at June 26, 2006 11:53 AM

On booting from USB--It all depends on what BIOS you're running.

I do think the ultimate solution is a multi-gig memory stick. I would guess that you could run a lean'n'mean Fedora installation on a couple gigs, but I wanted to also put the data on it, rather than having to mount the laptop's Windoze hard drive.

Posted by Rand Simberg at June 26, 2006 11:59 AM

No, Video does not have "its own power", save for the battery. However, starting with 4G, Apple changed the charger circuit to draw less and thus made it able to use USB power. The iPod Video inherits that hardware.

All iPods have batteries, but they discharge very quickly if the hard drive is used. You probably can count on one hour only. If you play music, you can hear it starting and stopping the drive. That's how it gets the hours of use on one charge So, this capability is useless when iPod is used as a bootable device.

I suspect that the battery helps iPod to be always compliant. E.g. in the begining, the USB port is initialized to 10mA, which is what the USB-to-IDE bridge has to use when it answers software requests and before software enables full power. Guess what, ALL my enclosures spin up drives when connected, which cannot possibly be legal, one would think! This obviously was not a problem for iPod's designers.

Not all hard drive enclosures are bootable. I have one which isn't, and two which are. This has to do with USB storage specification documenting a bewildering array of transport protocols and command sets, and BIOSes only supporting one combination typically: Bulk-Only transport and Transparent SCSI protocol.

I suggest buying from a store with good return policies and be mentally prepared to experiment.

Also... Traditionally Linux was hostile to booting from USB, and setting it up for booting was very arcane. The biggest issue was that the USB enumeration daemon, khubd, and the usb-storage probing thread both forked off the init, thus letting init run free, attempt to mount not-yet-probed device and fail.

For example, in Fedora before FC5 the mere idea was ridiculed. The FC5 did have a code in initrd (in its /linuxrc) which waited for the root device to come o-n-l-i-n-e, but I do not remember how functional that was. I always declined any bug reports about it. In FC6 Test 1 which hit the streets last week, this is supported officially, but it well be months before FC6 ships. Other distributions (e.g. Ubuntu, Gentoo) have approximately the same acceptance timelines.

So, many people boot their Linux off USB, but even now they follow some obscure FAQs and edit their initrd images manually to insert delays.

Posted by Pete Zaitcev at June 26, 2006 12:16 PM

With a flash based device, you run into issues of the flash lifetime and write levelling. In Linux terms this means that you must use jffs2 filesystem, which is a log-structured filesystem providing software write levelling. Guess what, installers in mainline distors do not support the jffs2 as a root filesystem.

Posted by Pete Zaitcev at June 26, 2006 12:19 PM

Thanks for all the info, Pete, but what's the bottom line here? I have a company laptop, with Windows XP, and they wouldn't look kindly on my adding another OS to the drive (as far as I know--I haven't actually asked). So I'm wanting to come up with some other way of running Linux on it on the road.

Ideally, I'd be able to use it on it on a plane, but I'd be willing to sacrifice that and suffer with Windows for those short periods of time, as long as I could run Linux when near a power socket.

So is there a portable solution, or should I just get an external powered USB drive? And if the latter, are there any "gotchas" with that, other than the USB issues you already discussed? Would FireWire be better (I'd have to get a PCMCIA card in that event)?

Posted by Rand Simberg at June 26, 2006 12:30 PM

I picked up a 2.5" drive enclosure that has a special double-headed cable that sucks power from 2 USB ports to power the drive. 40GB to 100GB, no problems. 5.1" X 2.8" X 0.5", VANTEC NST-250U2 from Newegg.

Never had a problem with using two ports, but one port does get flaky on laptops (desktops work fine on one port).

Posted by Dave G at June 26, 2006 12:32 PM

I picked up a 2.5" drive enclosure that has a special double-headed cable that sucks power from 2 USB ports to power the drive.

I assume that they're on separate cables, so I could use a hub (I need a port for my mouse and (occasionally) my memory stick)?

It sounds like whatever solution I use, if it's portable, I'm going to have to get a backup battery for the laptop...

Posted by Rand Simberg at June 26, 2006 12:36 PM

If it isn't too much trouble, you could buy a second laptop hard drive, and just swap out the entire drive.

Posted by lmg at June 26, 2006 01:00 PM

If it isn't too much trouble, you could buy a second laptop hard drive, and just swap out the entire drive.

That is another option I've considered (particularly considering that my current laptop drive is flaky). But it is a pain in the...keister.

Posted by Rand Simberg at June 26, 2006 01:02 PM

I should also add that, given that the machine is a Dell (did I tell you that it's my employer's machine?) I'm not sure that it will take an off-the-shelf laptop drive.

Posted by Rand Simberg at June 26, 2006 01:03 PM

My Inspiron 7000 (ca 1999) did take a standard laptop drive, as did the company Latitude 300. It was just a matter of stripping off the carrier parts to get down to the bare drive. It is a pain, but after the first time it's pretty easy. You can also put the extra drive into an external USB carrier to access the data when it isn't being booted from, assuming you can read the foreign file system.

Posted by lmg at June 26, 2006 01:24 PM

I have to admit, if I was doing that I would use:

http://rz-obrian.rz.uni-karlsruhe.de/knoppix-usb/

to make a bootable USB flashdrive, which in rc.local would 1) mount the harddrive, 2) mount a file on the harddrive as a loopback device, and 3) chroot into that and start your services. That way you can use as much drive space as you want, and you don't have to worry about "stepping in the Microsoft".

Apart from that, just use a really big flashdrive, I guess. If possible run without swap (or have a swap file on the windows drive).

Posted by David Summers at June 26, 2006 01:38 PM

For the ultimate "always boot into your own system" device, use a small USB flash linux base to mount your home system's drive over ssh - that way any internet connected computer can be your computer!

Posted by David Summers at June 26, 2006 01:54 PM

The hive mind came up with some good ideas. Knoppix would bypass any bootability concerns, especially if booted off a real CD. If the drive bay is swappable, it's the way to go, by buying an extra at some parts site. Unfortunately, often the drive has no its own bay, but it's something to investigate. Firewire though, I do not see that working, unless coupled with Knoppix CD.

The bottom line is
1. Investigate drive bay, and, failing that,
2. Buy a drive to try. Test if it boots at all by installing just GRUB, not whole distro:

# grub
grub> device (hd0) /dev/sda
grub> root (hd0,0)
grub> setup (hd0)

3. If it does not, live with CD+stick or CD+drive

If #2 succeeds, you'll need to read some documents floating on the web about the way to install to a USB disk. I would just clone an existing system, personally.

Posted by Pete Zaitcev at June 26, 2006 02:54 PM

Rand, if you have a recent-model Dell, there's no reason it won't take a standard drive. I have a 9300 and an XPS M170, and they both take standard 2.5" drives. You probably would want to buy a new drive cage assembly to ease the swap-out. They seem to run about $30.

Posted by Rick C at June 27, 2006 03:48 PM

You can pick up a thumb drive for $20 bucks and load 'Damn Small Linux' on it. Only 50MB in size and has : Fluxbox, 2 web browsers, Slypheed, xPDF, XMMS, Bashburn, Xpaint, and VNCviewer.

Posted by Josh Reiter at June 27, 2006 07:27 PM

I've been using a SimpleTech USB drive w/ 60G storage. It's very light weight, moderately performant, and draws all of its power from the USB. It can also take an external power source if needed. I haven't investigated whether that would boost performance.

I know that Linux (at least RH 3.x) did not out of the box support USB devices. There were additional packages and configurations to be done after the distribution was installed. Not certain if RH 4 solves that.

Posted by dla at June 29, 2006 09:24 AM


Post a comment
Name:


Email Address:


URL:


Comments: