View previous topic :: View next topic |
Author |
Message |
cohesion n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Sonic/1.png)
Joined: 27 Aug 2002 Posts: 24 Location: KC, MO, USA
|
Posted: Sun Apr 06, 2003 6:36 pm Post subject: Linux on a USB Flash Drive |
|
|
I just bought the last of the 256mb USB flash drives for $79 from Microcenter.
I had an interesting idea and I need your help filling in the holes:
The drive is fast. Fast enough to use as a root partition. So, I frequently go on computer-help visits to different people I know and there are some really great utilities at the standard Linux console that would be indespensible to have when troubleshooting a Windows problem like cfdisk, lspci, df, dd -- just access to /proc is useful. USB flash disks are bootable. They appear as a SCSI hard drive to Linux. They can be partitioned and formated to any file system. Here is what I want to do:
Divide the drive in half. Make one half a bootable Linux partition with lots of useful command line utilities. Install grub as the bootloader. Put a FAT32 partition on the second half with things like Mozilla 1.3, JRE 1.4.1_02, and OpenOffice on it with some space left over for whatever I want to take back and forth.
I have figured out how to partition it; format it in FAT32 and reiserfs for the respective partitions; install the bootloader. I've confirmed that most modern computers can boot from it. Here's what I don't know:
- What is the best way to get 128mb of the best of the Linux console in to that space? Should I start with a boot floppy distro and build up? What about building my own from a Slackware or Gentoo distro (compiling for i386 generic)? (If so, how can I build on my system and install to the flash drive?) Are there any bootable distros that you have a recommendation for?
- Is there anything I've overlooked in my brainstorming?
- How can I give grub access to the kernel when grub doesn't know how to access USB Storage? Once the kernel is loaded with usb-storage support, I should be okay.
- Will any version of Windows have any trouble skipping over the reiserfs partition and hot mounting the FAT32 partition?
Here are the benefits of USB Storage over a bootable CD-RW:
- It is fast and can opperate in systems that don't have a lot of memory to populate a root RAM disk with.
- I can make changes to the configuration and reboot in the field.
- I can quickly make modifications, enhancements and additions to the distro by simply mounting the Linux partition.
- It's durable enough I can just have it with me wherever I go.
- It's uber-geeky to whip Linux out of your pocket at a party.
the only disadvantage is that I only have 128mb as opposed to 700mb. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
femtotech n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 19 Dec 2002 Posts: 23
|
Posted: Sun Apr 06, 2003 9:34 pm Post subject: |
|
|
Are you sure that you can boot from a USB flash drive? I didn't see a "Boot from USB" option in my BIOS (Asus A7N8X Deluxe) so I assumed it couldn't. It would be great if I could boot Linux from my 512MB Pen Drive. ![Very Happy :D](images/smiles/icon_biggrin.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Ian l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 28 Oct 2002 Posts: 834 Location: Somerville, MA
|
Posted: Mon Apr 07, 2003 1:48 am Post subject: |
|
|
If this is indeed possible, I would love if someone could make something similar to Knoppix (although obviously much smaller) for various card sizes. Then I'd be able to impress people all over the school!
One thing that may help, if your BIOS doesn't support USB Boot...
A few weeks ago, I got a floppy disk from a friend. It loads a boot manager, which allows you to go into the BIOS, shutdown, reboot, boot from floppy (yeah, kind of useless), boot from hard drive, or boot from cd-rom. I believe it's from somewhere on sourceforge.net, but I can't say, as I got it from my friend.
Basically, if something like that exists, I would think to take that, and add in some sort of USB support shouldn't be too hard. Then again, I don't know how it works, so it could be next to impossible.
This is definitly an interesting idea, but as femtotech said, I've yet to see a BIOS that supports "Boot from USB." The other problem you may have is locked BIOSes, as it seems to have become the latest rage at my school, making the previously mentioned bootdisk so invaluble. Plus, if I could get Linux to run on my compact flash card, it'd almost be worth it just to carry a floppy disk around, because it's not that much bigger. ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cohesion n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Sonic/1.png)
Joined: 27 Aug 2002 Posts: 24 Location: KC, MO, USA
|
Posted: Mon Apr 07, 2003 2:24 am Post subject: |
|
|
I have an ASUS A7V133-C motherboard and it has a "boot from removable device" menu in which you can choose either:
Supposedly USB FDD and USB ZIP both work, but have to be configured on the Flash device differently. (This would be something I would have to research a little; see which of those opions is more commonly implemented. I haven't actually tried booting from this thing, yet. Though, I just did finish successfully repartitioning it and installing the grub bootloader to it. I'm not sure if this is all I have to do.
It's really hard to find info on this on Google because of all the online USB Flash device retailers pages that keep coming up in the search results. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
reaz82 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/Cars/6.gif)
Joined: 14 Mar 2003 Posts: 203 Location: Austin, Texas
|
Posted: Fri Apr 11, 2003 1:58 am Post subject: |
|
|
very very interesting project..
building gentoo on that usb will be hard..
not sure if you should use gentoo or slackware..
try building linux from scratch..
that's a distro.. it's very light (doesnt need
the ebuilds that gentoo downloads > 200mb)
you are working in a tight environment.. so i assume
you will build on a pc and then copy to the key drive?
let us know how you progress..
good luck |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
OdinsDream Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1858c05e3cf8f229cadc2.gif)
Joined: 01 Jun 2002 Posts: 1057
|
Posted: Thu Jun 05, 2003 8:43 pm Post subject: |
|
|
This is a great idea, and seeing as how I just came to be the owner of a 512mb flash disk, I'm very interested. A little digging on google turned up:
http://www.ncsu.edu/resnet/runt/
...which seems to be the most useful of the links. The distribution is based on ZipSlack, which is, not surprisingly, SlackWare designed to run from a Zip-100 drive. RUNT is designed to make use of an extra 28MB available on their target media, however, I'm sure it would be a simple matter to add more capabilities...
Booting is done via a floppy. Perhaps this can be modified. _________________ s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi
Don't blame me. I didn't vote for him.
http://john.simplykiwi.com |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
searcher Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/16698560454085849c3ec73.gif)
Joined: 13 Mar 2003 Posts: 175 Location: NL
|
Posted: Thu Jun 05, 2003 9:39 pm Post subject: |
|
|
I'm also working on this as i just bought a small usb keychain (64mb). After reading this i've been trying to get the gentoo boot cd on it. With a little tweaking you could install your own kernel, rip the hardware detection program from knoppix (it's open source and hopefully not too large) and i'd might even be able to run TinyX, a small X server. OpenOffice won't fit with me, but i should be able to put a few small editors on the stick, just for fun.
I'd like to see more people bring in ideas about this, as having gentoo on a usb-stick would be very cool to flip out at lan parties ![Smile :)](images/smiles/icon_smile.gif) _________________ You are unique ... just like everyone else. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Carlo Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/20991155413e41b8130c9ee.png)
Joined: 12 Aug 2002 Posts: 3356
|
Posted: Thu Jun 05, 2003 11:31 pm Post subject: |
|
|
Be aware that flash ram is only capable of ~1.000.000 write accesses per sector, so it seems better to put /proc etc. in a ramdisk.
Carlo |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
zuigzoen n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 07 Oct 2002 Posts: 20 Location: The Netherlands
|
Posted: Wed Jun 18, 2003 10:00 am Post subject: |
|
|
cohesion have you made any progress?
This really is interesting and I'm curious about your progress, 'cause this could be very handy for a lot of us geeks. _________________ minds are like parachutes, they only function when they are open |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sschlueter Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 26 Jul 2002 Posts: 578 Location: Dortmund, Germany
|
Posted: Thu Jun 19, 2003 5:59 am Post subject: Re: Linux on a USB Flash Drive |
|
|
cohesion wrote: | The drive is fast. Fast enough to use as a root partition. So, I frequently go on computer-help visits to different people I know and there are some really great utilities at the standard Linux console that would be indespensible to have when troubleshooting a Windows problem like cfdisk, lspci, df, dd -- just access to /proc is useful. USB flash disks are bootable. They appear as a SCSI hard drive to Linux. They can be partitioned and formated to any file system. Here is what I want to do: |
Maybe this mini distribution is what you want... haven't used it though. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sschlueter Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 26 Jul 2002 Posts: 578 Location: Dortmund, Germany
|
Posted: Thu Jun 19, 2003 6:02 am Post subject: |
|
|
Carlo wrote: | Be aware that flash ram is only capable of ~1.000.000 write accesses per sector, so it seems better to put /proc etc. in a ramdisk.Carlo |
/proc is just a virtual file system... but otherwise you are right... something like /var/log/* (depending on the user's config) could kill the flash media soon. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
klarnox Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Marvel/Marvel_-_Gambit.gif)
Joined: 28 Jan 2003 Posts: 350 Location: Wisconsin, USA
|
Posted: Thu Jun 19, 2003 5:43 pm Post subject: |
|
|
cohesion wrote: | I have an ASUS A7V133-C motherboard and it has a "boot from removable device" menu in which you can choose either:
Supposedly USB FDD and USB ZIP both work, but have to be configured on the Flash device differently. (This would be something I would have to research a little; see which of those opions is more commonly implemented. I haven't actually tried booting from this thing, yet. Though, I just did finish successfully repartitioning it and installing the grub bootloader to it. I'm not sure if this is all I have to do.
It's really hard to find info on this on Google because of all the online USB Flash device retailers pages that keep coming up in the search results. |
My newest system supports booting from USB devices as well (Shuttle XPC SS51G). Options include USB HDD, USB CDROM, USB Floppy. I believe there are more, but I'm not at home to check at the moment. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jago25_98 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 23 Aug 2002 Posts: 180
|
Posted: Fri Jun 20, 2003 5:41 pm Post subject: bootdisk to boot /dev/usb/<massStorage> |
|
|
I've also been trying to do this.
The problem I have is my bios doesn't support booting from USB.
So I need to make a bootdisk.
I thought getting a bootdisk to boot a USB root partition should be simple:-
- Install lilo/grub onto a floppy with support in the kernel for USB mass storage, as many varieties as possible, probably a 2.5 kernel.
Haven't got a computer of my own for a while but going to try just copying bzImage to a disk, hope it fits. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
xlyz Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/916827812416b0d3e6db21.jpg)
Joined: 27 Oct 2002 Posts: 1470 Location: Italy
|
Posted: Sat Jun 21, 2003 9:15 pm Post subject: Re: Linux on a USB Flash Drive |
|
|
cohesion wrote: | What is the best way to get 128mb of the best of the Linux console in to that space? Should I start with a boot floppy distro and build up? What about building my own from a Slackware or Gentoo distro (compiling for i386 generic)? (If so, how can I build on my system and install to the flash drive?) Are there any bootable distros that you have a recommendation for? |
u may want to check http://eaglelinux.w32.net/ to build a console liveCD (or liveUSB ) in 4 mb
latest release is based on debian, but can be easily adapted to be used with gentoo
they plan to release an X version in july |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
IntergalacticWalrus Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/184430277440bbeaa37e068.png)
Joined: 07 Jan 2003 Posts: 513 Location: Montreal QC (Canada)
|
Posted: Mon Jun 23, 2003 1:54 am Post subject: |
|
|
Funny how this topic hits the GWN the exact same day I buy a Verbatim USB2.0 256MB Drive... The thing was expensive (maybe a bit too much for my budget) but it's so cool (in a geeky way) to have 256MB of storage on my keyring that I couldn't help myself... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
onkelfusspilz Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 26 Aug 2002 Posts: 130 Location: Germany
|
Posted: Tue Jun 24, 2003 9:02 am Post subject: |
|
|
Great Idea!
I think about the way to arange the storage on the usb-drive. It seems that knoppix (http://www.knopper.net) which is actualy only available as a 700 MB boot image for cdroms, have a COMPRESSED file, containing the root-fs. This file is mounted, so it is direct accessable as "/" and deflating "on the fly".
My idea is to use a kind of image file, who is NOT read only! It would be great if it were possible to mount this compressed image as "/" and if something is written to the root-fs it is compressed into the image-file "on the fly"
The main difference between a 256MB USB Stick and a cdrom to me, is that it is small, fast and that it is WRITABLE! So there must be way to use this witable capability to store user-related data (profiles...)
I'm dreaming of a knoppix-like image, with tinyX and kOffice, browser (phoenix?) and everything what I need on a 256 USB-Stick, with the ability to write my profile-data to the stick, too.
Does anyone know something about a filesystem, that is able to mount a compressed image for R/W? Is it possible?
Let me hear your ideas ... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sagipolley n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/1408823044096485e91dcb.gif)
Joined: 29 Apr 2002 Posts: 40 Location: Israel
|
Posted: Wed Jun 25, 2003 7:42 pm Post subject: Another (non-Gentoo) alternative |
|
|
There is another way to approach this. (Disclaimer--I am a big Gentoo fan, and run it myself. I'm just offering this information 'cause it might help someone.)
Knoppix-MiB Privacy Edition lets you boot from CD (like regular Knoppix), but also lets you use the USB stick as your home directory.
You can find it here:
http://www.bouissou.net/knoppix-mib/doc-html/Knoppix-Mib.html |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
led42 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 25 Jun 2003 Posts: 1
|
Posted: Wed Jun 25, 2003 10:34 pm Post subject: |
|
|
sschlueter wrote: | Carlo wrote: | Be aware that flash ram is only capable of ~1.000.000 write accesses per sector, so it seems better to put /proc etc. in a ramdisk.Carlo |
/proc is just a virtual file system... but otherwise you are right... something like /var/log/* (depending on the user's config) could kill the flash media soon. |
worst if the filesystem is mounted with atime (default) every time a file is read it's access time is updated... so potencialy some parts of the flash will fail pretty fast.
better to mount with noatime |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ben_h Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/1706959798412c256b5f55d.gif)
Joined: 26 Nov 2002 Posts: 118 Location: Australia
|
Posted: Thu Jun 26, 2003 7:11 am Post subject: |
|
|
If your mainboard can boot from USB, and can handle USB to IDE, then Grub can see the USB drive.
For the record, I have a Gigabyte 8IEXP, and it boots from a USB device beautifully.
I got a USB2 Caddy to pop a laptop HDD into -- grabbed a 6 gig disk out of an old, bereaved laptop in my cupboard. Works really well, and writes at 7 to 8 MB/sec with echi-hcd modprobed.
Now, to get gentoo on it, I partitioned it up nice and simply --
-- /dev/sda1 = /boot (24MB)
-- /dev/sda2 = swap (192MB)
-- /dev/sda3 = / (1 gig)
That leaves me 5 gigs.
Now, mkfoofs and mount the appropriate partitions at /foo/bar (and then /foo/bar/boot, etcetera for whatever else you desire). But, you most probably don't want to compile on the USB device, for space reasons, and you definitely don't want to redownload all those tarballs. So,
Code: | cd /foo/bar
mkdir mnt/tarpit
mkdir mnt/compile
mount -o bind [your host system's DISTDIR path] mnt/tarpit
mount -o bind [your host system's PORTAGE_TMPDIR path] mnt/compile |
Then, chroot into the new tree with
Code: | chroot /foo/bar /bin/bash |
After that, just follow the install instructions from the appropriate point (that is, directly after the chroot command), but make sure you set
Code: | DISTDIR=/mnt/tarpit
PORTAGE_TMPDIR=/mnt/compile | in /etc/make.conf, once you've emerge sync'ed.
Make sure you compile scsi disk support and usb-storage support into the kernel proper, as well as uhci and ehci.
All this worked fantastically for me. However I ran into problems when I was booting the device -- the kernel gets to a stage where it should be mounting the root device and loading /sbin/init. However, because the usb-storage drivers take a good couple of seconds to initialise, they're too late for the kernel's root mounting attempt, and it panics.
A delay can be introduced, but this only worked for me if devfs was turned off. Obviously this isn't a solution, since gentoo dies at about the third init script if devfs isn't enabled.
However, it does narrow the problem to devfs -- and I haven't tried it with 2.4.21, so that might be something to do. (I only tried 2.4.20).
But, the moral of the story is that if this delay problem can be fixed, then there's no need to bollocks around with knoppix, ramdisks, and the like -- if the device is big enough and the computer supports USB booting, then a completely standard Gentoo install will work perfectly, provided the kernel has the necessary drivers compiled in. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
TecHunter Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 15 Feb 2003 Posts: 124
|
Posted: Fri Jun 27, 2003 11:12 am Post subject: |
|
|
cohesion wrote: | I have an ASUS A7V133-C motherboard and it has a "boot from removable device" menu in which you can choose either:
| my mb is AUSU a7v266-ex,but i cant find USB boot options ![Sad :(](images/smiles/icon_sad.gif) _________________ Gentoo is GREAT!!! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
macval n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 28 Dec 2003 Posts: 1
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bakey n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 31 Dec 2003 Posts: 3 Location: Austin
|
Posted: Wed Dec 31, 2003 10:57 pm Post subject: Linux on a USB Flash Drive |
|
|
There are a few distros that are setup for usb key.
flonix http://linuxdocs.tuxfamily.org/flonix/index.php and stixx http://www.stixx.org/
Flonix has a 64meg version and it is based off of Knoppix.
I would like to make a few versions of gentoo on usb key.
Flonix is using a fat filesystem and syslinux to make the usb key bootable.
They have an init ramdisk that has etc and stuff (2meg).
It boots with a good sized ram disk and the knoppix system is cut down from the cd one but it has enough to bring up x and has some basic utils and office apps. The knoppix file system is using cloop instead of cramfs which allows you to break the 16meg file and 256meg filesystem limits. It looks like you get a three to one compression ratio with cloop. So you can fit a lot of apps in a small space. It should be easy to convert the gentoo install cd's and maybe cut down the livecd to fit a 256meg usb key. As soon as I free up a machine I'm going to start work on the basic install cd. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gringo Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9565137345531ca1c9c61.jpg)
Joined: 27 Apr 2003 Posts: 3793
|
Posted: Sat Jan 03, 2004 10:44 am Post subject: |
|
|
Yes, a great job was done with flonix. Have tried it and it´s very impressive !
But i will try to do something like this but based on gentoo. Have already tried to optimize / cut down a knoppix live-cd to fit in the 128 megs pen, without success. Which size should have the tree before compressing ?? More or less 300 / 400 megs i suppose...
I think we should try with "light" apps like tinyx with *box, dietlibc and so on. Will give it a try this weekend... will also try with a 2.6.x kernel without the cloop utility. Let´s see....
Have you tried building with catalyst ??
http://www.gentoo.org/proj/en/releng/catalyst/
regards |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
barnabe n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 19 Mar 2003 Posts: 9
|
Posted: Mon Jan 19, 2004 10:33 pm Post subject: |
|
|
ben_h wrote: | All this worked fantastically for me. However I ran into problems when I was booting the device -- the kernel gets to a stage where it should be mounting the root device and loading /sbin/init. However, because the usb-storage drivers take a good couple of seconds to initialise, they're too late for the kernel's root mounting attempt, and it panics.
A delay can be introduced, but this only worked for me if devfs was turned off. Obviously this isn't a solution, since gentoo dies at about the third init script if devfs isn't enabled.
However, it does narrow the problem to devfs -- and I haven't tried it with 2.4.21, so that might be something to do. (I only tried 2.4.20).
But, the moral of the story is that if this delay problem can be fixed, then there's no need to bollocks around with knoppix, ramdisks, and the like -- if the device is big enough and the computer supports USB booting, then a completely standard Gentoo install will work perfectly, provided the kernel has the necessary drivers compiled in. |
I'm having the exact same problem, with 2.4.22-gentoo-r5. I'm even able to boot from USB as my motherboard permits it, although very slowly, but as soon as the kernel tries to mount the root partition it panics. When booting on another, non-USB disk everything is fine and I can work with the USB disk. Do you know if there's any progress? Thx. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
brncmp n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 22 Jan 2004 Posts: 1
|
Posted: Thu Jan 22, 2004 2:35 am Post subject: |
|
|
This is great idea. I have been using damn small linux since my hard drive craped out in my nootbook and i would love to use my cdrom again.
How hard would it be to port opie or Open Zarurs to a pc. I think sysLinux could be used as the boot loader. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|