PDA

View Full Version : Knoppix to Compact Flash (CF)



tjscientist
04-02-2008, 01:00 PM
The plan:

I would like to write a script that will install an uncompressed Knoppix system to a CF or even a USB stick of about 4 - 8 Gig (these are quite cheap now). The reason comes down to speed; I need something that runs relatively quick and silent (read - No HD). I am not too sure how much faster an uncompressed version would run but I assume I'll get a bit more speed from it. Also, after it is installed, the automatic HW detection would no longer need to run as all HW drivers and configuration would be saved (installed) on to the CF.

I can not use a "standard" HD install as there are too many writes to the file system for a CF (/var/log, etc.) and there can be no swap file. The final product here is a remastered version of KnoppMyth, a MythTv version of Knoppix which is really cool.

My Questions:

1 - How do I get knoppix installed "uncompressed" but with the unionfs and RAMDisk still working?

2 - I would still like to be able to allocate a portion (partition) of the CF as the users "persistent" home directory.

3 - I would also like to have a script that will allow the use of apt-get or yum to install / update programs on the otherwise RO filesystem. How could I do this?

The "Other" Option:

One other option is to do a remote boot (PXE) of a standard Linux kernel and that actually works really well (and really cool) for a wired network interface but... If the box I am booting is using wireless, that will not work because the MB has no idea how to get to the network. The way around this might be to have a minimal Knoppix kernel on the CF. This kernel would only load up the wireless USB module then mount the rest of the file system over NFS to the "boot server".

If I went with this option I would want to understand how to use the local 1 Gig RAMDrive efficiently. It would obviously run the kernel but with the rest of the files system on the nework how could I use this as a cache?

Any and all ideas and suggestions are welcome and appreciated!

Thanks,
TJ

spaceinvader001
04-02-2008, 05:41 PM
With the flash drive in get the location or whatever the name of the media is you want to run from then use the knoppix tohd command and just send it to your flash drive then when you reboot you have to use the cd but if you copy the boot files over to your flash drive it should work from there too.. else you can always use knoppix fromhd="/media/knoppix/" this is how my current systems work. its easier than a real install for real HD installs I still use Debian.

tjscientist
04-04-2008, 02:19 PM
If I do a tohd to the CF and run it, then things like /var/logs will constantly be writing to the CF and wear it out pretty fast. I suppose I could do a ramdisk and unionfs the /var directory..

cbagger01
04-05-2008, 03:53 PM
If I do a tohd to the CF and run it, then things like /var/logs will constantly be writing to the CF and wear it out pretty fast. I suppose I could do a ramdisk and unionfs the /var directory..

Flash based storage devices have one weakness. After repeated write operations, sectors on the flash drive will begin to fail. By "repeated" I mean 100,000 write operations or so. This sounds like a lot but for some applications (Linux or Windows swap partition or swap file, log files, Web browser cache,etc) you can hit this limit after a few months of usage.

Your best bet is to install the compressed read-only knoppix files from the DVD over to your FAT32 flash drive partition and then use SYSLINUX to make it a bootable device. You can then use a persistent home on a flash drive partition or can manually back up files over to the device. This is known as a "poormans install". It is normally associated with a hard drive installation but can also be done to a USB thumb drive or other flash memory device/card. In fact, the folks at Damn Small Linux (based on an older version of KNOPPIX) have automated this process with an install script called "USB Install", but you can also use it on other flash drives besides USB based ones.

The advantage to this approach is the drive will not quickly wear out due to repeated writes because most of KNOPPIX logging is done by default to your RAM disk and not to your storage device.

An alternative approach is to format your device with a partition type JFFS file system and then install Linux on this partition. This file system is designed to work with flash based storage devices and it maximizes the life of the device by refusing to write to the same spot on your drive over-and-over again. The concept is also known as "wear-leveling".