LINUX ON USB FLASH DRIVE/CD
I wanted to test a few different concepts. One was that with the falling of the price of flash drives, is there any benefit to installing programs directly to flash drives? With a 2.0 USB hub, one could 4 gigs of flash drives on the computer for about $100 as of today. (I ordered a 1gig flash drive for $20 -- after rebate and before shipping -- yesterday).
Well, I have not bothered to check the "seek time" of flash drives vs. hard drives. I do know ... well, I think I know ... that ROMs read more slowly than RAMs, though. But for a long time I have wondered why computers did not come with, say, some oft-used Redmond system pre-installed to internal flash drives instead of booting from the hd.
Here are some problems/issues for those of us who do not know anything:
I went with Slax, for the reason that it has "modules" that you can more or less "easily" add to the boot install. There are several small distros that can go on a flash drive -- including one that you can purchase pre-installed on a flash drive. (http://www.damnsmalllinux.org/ -- and in fact, I like the DSL concept. However, in reading through the webpages it was unclear to me how I would customize DSL and I could quickly see that Slax (built on Slackware) had a number of ready-to-go modules.
My first go-round was to turn my Lexar 1gig JumpDrive into a bootable USB drive. I wish I could report that I knew exactly how I did this, but since I crashed it and had to resuscitate the JumpDrive, I can't say specifically which steps are necessary to make the project work.
I downloaded a utility from HP that is for creating a "USB bootable key" and, according to other websites, works on non-hp flash drives. One purpose of such a flash drive is for bios updates, since many current computers no longer can boot from floppies. I have an HP Pavilion ZD7000.
I ran the utility, and the first step was to make a backup of my working JumpDrive. The drive comes with a partitioning utility that splits it into "public" and "private" partitions. The image file was the full 1 gig and took a while to create, but I was glad to have done so.
After running the utility, my jumpdrive may or may not have had some specific "change" that made it bootable, but that doesn't mean it would boot. I attempted to boot it in the ZD7000. This required going into the bios setup and re-ordering the "hard drives" so that the lexar jumpdrive comes first. Now -- what I do not know is whether the lexar jumpdrive option would have existed if I did not run the HP utility.
Here's the annoying part -- unlike when you tell your BIOS to start "first" from CD-ROM and "second" from hard drive, re-ordering the hard drive start order to make the lexar jumpdrive come first "didn't stick." What I mean by that is that so long as the jumpdrive was connected, startup (after I got it working, which is a different story) worked. However, as soon as I booted the computer without the jumpdrive, the order reverted to internal hard drive first, so I couldn't boot from the jumpdrive without going back into bios. And, as far as I can tell, there is no option to make this switch just in "boot order" because the boot order at startup seems to lump all hard drives together as one category.
Okay, I never got the jump drive to boot Windows. You have to get an "image" from somewhere and put the necessary files on the jump drive, and etc., etc. Pain in the tush and not worth the trouble. Why can't you just format /s like one could with a floppy disk in the old days? I don't know, but you can't.
So, I moved on directly to building the bootable linux jumpdrive. Well, not immediately, since in the meantime I had screwed up the jumpdrive functionality. The HP utility had changed the partition(s) so they weren't precisely "there" anymore. I don't know what the true status was, but anyway, in Partition Magic the jumpdrive now showed as 1 gig of "bad" partition.
I had to jump through hoops to solve this problem. First, I restored the backup image, using the HP utility. However, this did not go well. Initially, it wouldn't work. It would tell me "successful" but wouldn't restore anything. Then, I think I formatted the drive with windows (right click, format). Then I did the restore and it worked.
So, I was back to the original jumpdrive state. But, naturally I couldn't leave well enough alone. Lexar has a software upgrade that I had downloaded. It wouldn't run either -- it gave me an error that there had to be only one partition in order for the new software to run. (I wanted to make it work, since Lexar doesn't offer the >old< software anymore and I didn't have a very good backup).
Partition Magic didn't help -- it just showed the "private" half of the drive as unformatted. Linux cfdisk was a bit more helpful -- it showed the "private" portion as being a "hidden vfat" partition.
So, I went back to the "old" jumpdrive software, reduced the private partition to "zero" and then ran the "new" jumpdrive software. This worked -- temporarily. The next step was that the instructions I found on how to make a bootable USB linux suggested to make two partitions on the jumpdrive.
Well, this is typically a good idea in linux installs because your operating system is then on a separate partition than your data and it is easier to change linux systems without losing all your data. But, when I split the partition (I think I used cfdisk), then the jumpdrive system quit working. I had maintained a small portion for the "private" partition, so this is now a wasted area of the jumpdrive.
In retrospect, I will probably merge the two partitions I made since they seem to create more aggravation then value. It won't take much for linux packages to take up a 400 mb partition.
I found some instructions online for making a bootable Slax linux flash drive. This consists primarily of loading the Slax image onto the flash drive and running "syslinux". Naturally, I have misplaced the instructions, they should be linked here.
But in any event, this system booted on my ZD7000, as discussed above.
UNFORTUNATELY, I didn't really need the flash drive to boot the ZD7000 into linux, because I have a dual boot system that already boots to SuSE 10.0 on that computer. What I wanted to do was boot a Toshiba Satellite A15-S129.
As far as I can tell, no can do.
So, I then ended up making a Slax CD for the Toshiba. That works fairly well, although the CD drive in the Toshiba is relatively crappy. It takes some doing to get the Toshiba to recognize it's >got< a CD at boot time. I solved the problem by opening the drive and slamming it shut on boot, just about the time the boot manager is deciding which media to use. Well, after a few times it started working better.
The next issue was figuring out how to add modules. A quick reading of the SLAX webpages said you could add modules. But, now that I had a burned CD -- which was burned from an ISO, how was I going to do that? Figuring this out required a more careful reading of the Slax website -- the info is there.
The steps are that you need to copy the entire CD to your hard drive (either in windows or linux). Then you add "modules" downloaded from the Slax website into the "modules" directory in the hard drive copy. Then, you run the script (or batch file) that Slax provides in order to make a brand new ISO and then you burn the ISO. So, I added OpenOffice, Firefox, Java and Acrobat Reader & burned a new boot CD.
The install comes up with the network working on eth1. I have a PCMCIA wireless card in the computer that was recognized and installed as eth0. I was able to use KWIFI Wireless Manager to get the wireless in contact with my wireless router -- I actually got an IP -- but I could not access anything. I do not know why and so I gave up and used a wire. SuSE Linux puts the wireless on wlan0 and not eth0. Names are not that important, but this inconsistency may have something to do with the problem.
Additionally, while I was working with the wireless I had not yet tried the configuration backup, so I would have to go through the process of inputing my WEP info, etc., each time.
Now, a good thing I am happy about is that it recognized my PA070 Targus hub/docking station. This is helpful because the Toshiba does not have PS/2 mouse & keyboard ports and my ultimate goal was to put the computer on my KVM switch so that I could access several computers from the same console.
The next problem is, how do you save your configuration? Well, Slax has a utility for this, "configsave" and "configrestore" -- and they will give you the syntax if you run them without any options.
Since my computer has a hard drive -- the only reason for the CD linux startup (other than to figure out how it works) is that I don't want to re-partition the system and set up a dual boot. It's only got a 40 gig hard drive that is almost full in windows already.
Well -- I ended up re-partitioning anyway, since you can't write from linux to NTFS. So I made a 5 gig. FAT32 partition (this way I can hand stuff off to windows). (However, ultimately, my goal will be to mount a flash drive and use it the way I am presently using the FAT32 partition. Also, here's something I need in Slax -- a way to incorporate the hard drive partition and/or the flash drive partition into the main install path so that linux packages can be installed to locations other than the boot CD or flash drive.)
Here's what I did, though. My new partition mounts as /mnt/hda5. So, I created some subdirectories -- /mnt/hda5/linux/opt,
/mnt/hda5/linux/cache, /mnt/hda5/linux/scripts, etc.
Then I created some scripts to do the basic stuff -- eg., save the configuration to /mnt/hda5/linux so it will be there the next time I start; restore the configuration & start the swap, which I put in the "cache" directory I created, etc.
In the "opt" directory I was able to put additional Slax packages. There is a command for installing these "on the fly" after linux is up and running. Also, they will then be running from the hard drive rather than from the CD.
The next problem -- and the one I haven't solved -- is how to install linux programs that Slax has not already produced a package for. Slax describes how to make a Slax package, but I probably do not have the diligence to do this. I want to be able to take a package such as NVU and install it >to the hard drive< and be able to access it the next time I start Slax.
Unfortunately, I do not have the linux knowledge to do this.
The other thing I have not figured out yet is how to make accounts. Slax installs as "root" -- and this not particularly secure. Part of the reason I want to run this is to keep my Windows computers off the internet and create better security. Good procedure would include not logging in as an administrator.
Now, there is another "problem" I ran into. I don't yet know if this is a problem with the boot CD & I need to make another one, or whether there is something I saved in the configuration files that is causing the problem. The KDE Media Manager is no longer starting on start up and I have lost several icons. One is the power-management icon (don't know if power management is still running) and two others are icons for the "network connections" of eth0 and eth1. I know that eth1 is running, because I have internet access (and also, the samba browser is working pretty well without any tinkering. This is a real plus as I had a lot of problems with it in SuSE 10.)
Hope this helps. (& as I've noted before, I hope it helps me when I crash everything, which is the main reason I write this stuff.)
Thanks for visiting!
So, there is still a way to go to make this functional. But, it's running and online.