Completely new HD based HowTo page
- 1 HOWTO set up Knoppix to run from harddisk.
- 1.1 Overview of HD installs
- 1.2 Full HD install
- 1.3 Poor man's install
HOWTO set up Knoppix to run from harddisk.
Only for new Knoppix versions (6.x, 7.x)
There are basically different ways to run Knoppix
- Off the CD/DVD, the "classic", fall-back-to method
- Off the CD/DVD ISO image on disk
- From flash/USB media, "Flash disk install"
- From harddisk copy of Knoppix, "Poor man's install"
- From full HD install of Knoppix, "HD install" (Debian-style)
Running Knoppix from flash disk install or from poor man's install is very similar in all respects. In both cases, it is a matter of
- copying the KNOPPIX system files to the root directory of a partition and
- finding a workable booting solution.
Persistent store is created as needed, and copied around together with the Knoppix system.
Except for speed differences, there is nothing you can do with a poor man's install that you can't do with properly formatted flash media, and with increasingly larger capacity flash media (16+ GB), the methods of setting them up and running from them may become similar to hard disk. Also, an external USB harddisk is a preferred way of backup and mobile data storage, and it may easily be set up for booting Knoppix, be several methods.
Knoppix is a "file system agnostic" Linux version. It can be run from different media, like
- FAT16/32 - typically used on flash media (like USB sticks, CF-, SD- and micro-SD cards), but also perfectly usable for hard disk partitions when there is no need for >4GB files.
- NTFS - used on hard disks and larger flash media
- Ext2/3/4 - native Linux file system, can be used anywhere (For Ext4 boot, a small adaptation is needed for Knoppix 6.4 and earlier.)
- ReiserFS, the preferred file system for full Linux HD installs
Overview of HD installs
Knoppix runs very well from harddisk by either install method. In poor man's install, the way of booting is virtualy identical to removable media, and I think it is also very similar in Knoppix full HD installs. The main differences are
- that there is no persistent image union-mounted any more
- all programs are uncompressed to a partition mounted read-write (rw).
Knoppix being very close to standard Debian re program packages, a full HD install resembles standard Debian even more. The structure of such an install is described in Debian documentation, and it is fully possible to convert a Debian install into a Knoppix version - a pure 64-bits version of Knoppix was created that way.
A basic install only relates to the root and swap partitions, but may easily be modified to include several partitions. Knoppix has a "passive" attitude towards volume (partition) mounting, in that nothing is auto-mounted. This can easily be modified, but for safety reasons, it may be good only to mount partitions when they are to be used.
The poor man's install is also in effect very close to standard Debian, uses the same packages, and may be modified for multi-user situations. Also, the union-file system mounting of the compressed and persistent image allows for exactly the same kind of file administration as in ordinary installs, and for hard disk use, one may easily expand the persistent image beyond the 4GB limit on FAT32. Furthermore, on newer processors, the decompression of programs upon running goes so fast that there is not much noticable difference running compressed or uncompressed. The large differences in this respect is with CD/DVDs, and to some extent with slow flash media. Even with external USB harddisks or fast external flash memory, there is, generally, little slowing down compared to full install after the system has been used for some hours.
When running full HD install with the Knoppix-script "0wn", booting is taken care of automatically, but it does not necessarily give the best setup for multi-booting. Poor man's install done fully manually does nothing about booting, and booting could be handled separately, for optimal multi-boot setup. Poor man's install don't need any booting modifications to be used, when not instructed otherwise, Knoppix will in fact search for them at bootup, and boot the first that is found.
Full HD install
Full HD install will create Knoppix "Debian-style", which some of us much prefer to the vanilla version. This is performed by a program called 0wn (zero work needed). It requires
- a swap partition set up and
- a ReiserFS install partition.
It can be installed to a prepared HD, or setup the HD itself. The safest use is to have everything prepared for 0wn in advance. Up to, and including, a bootloader (typically, legacy grub) which can easily be modified with more alternatives.
Planning for preparing partitions
First: Is the disk big enough? If not, the best starting point may be to swap it with a bigger one. Hard disks are cheap, with only a few cents per GB and any problems due to disk size simply can't be defended economically any more. Today, 250GB should be considered a minimum, except for SSD disks. And you won't waste expensive space on SSD disks with full installs, will you? SSD installs should be poor man's install.
Second: You know your partitioning tools? Gparted may be run during the install, but except for minor partition edits, it is really better to run it in advance. Unless Knoppix is surely the one and only system to install on the actual disk, it is normally optimal to allocate max 2-3x the system size for the system partition. So, starting from a compressed DVD image of 3.6GB, we will get ca 9GB when uncompressed, and we may quickly add a few GB of new programs. So, 20-30GB is a good size for a Knoppix system partition. With lots of memory, swap space is not that important any longer, but it may be of use now and then, and 1-4GB isn't a bad choice. The old rule of swap=2xRAM isn't valid anymore. For example with 16GB RAM, we should need 32GB swap, and just reading that whole amount would take minutes on standard hard disks.
Planning for preparing packages on the to-install version
Know what package selection do you want on the new install? Then go ahead and install it on your flash/PMI Knoppix. It is the whole actual Knoppix at install time, not only the initial compressed image, that gets installed. Therefore, it may be an advantage to start with a flash disk install or a poor man's install with a large persistent store, and install as much of the desired programs as possible before doing the HD install. This way, the compressed version will serve as a simple system backup, so it is only userspace on the install that urgently needs to be backed up.
For general use it is, generally, not a good idea to start from CD/DVD media. Tweaking, upgrading, extra install work should be done on beforehand. A fresh remastering may be far better.
Counterindications for full HD install
Full HD install of Knoppix is simple and relatively safe, but there are a few counterindications
- Actual version approaches end of expected lifetime. It is harder to upgrade a HD install than a poor man's install.
- Hardware problems on the actual computer. Only install when Knoppix runs with no grave hardware problems.
- Probable problems with setting up Linux booting on the computer. Poor man's install avoids such conflicts.
- The system is going to be copied to/run on other computers. Much easier to transfer poor man's installs.
- The computer is not going to be run with Knoppix on a daily basis. For occasional use, flash disk installs or poor man's installs are better.
- Poor man's install runs OK, but persistent store is too small. Then grow it! 4GB is limit only on FAT32.
- Wants to run Knoppix faster and smoother. It's not going to help much. Try running 64-bits kernel, upgrading and restricting resource hog processes.
- Hard disk use needs full HD install. That's the worst miscomprehension.
- Want to boot Knoppix from HD. It's even easier with poor man's install.
- Want to be able to tweak settings. Most can be done with a persistent image.
- Want to be able to install programs. Second worst miscomprehension.
Indications for full HD install
Here are a few indications for full HD install
- Have used poor man's install for a while, got a stable system to install
- Will use Knoppix for servers
- Want to work less on a package basis, more occasional compiles etc.
- Development versions. E.g. pure 64-bits version
- Need to make some special adaptations, and the compressed image gets in the way.
- Needs better individual control over files in preparation of remastering
- Want to experiment with mixing elements of Debian, Knoppix and Ubuntu initalization.
- Use Windows tools to shrink Win partition, if necessary.
- Whenever possible, create a separate boot partition 0.2-6GB, and install legacy grub there.
- Create 1-4GB swap partition
- Create a 20-30GB system partition
- Create eventual other partitions for multi-booting. (Developing a 64-bits Knoppix, 4 different installs were used.)
- Need an exchange partition with Windows? Some GB FAT32-space could fix that.
- Possible leaving some space for future use, use the remaining space for a storage partition.
Preparing packages on the to-install version
If you lack some packages, go ahead and install them on your to-install version. Also removal of packages should be done now - they are of course not physically removed from compressed image, but they will not be copied over during install. Check if you have optimal versions, or that some upgrades might be in place. Don't postpone any work to after install, if you don't have to.
Poor man's install
This is, basically, just copying the KNOPPIX system files to an existing partition. Standard is to place them in the root directory of the partition, but elsewhere is also possible, using cheat codes.
This copying may be done from within the version to copy, by other Linux versions, or from Windows. It is possible, but hardly necessary, to set up scripts for it.
Install to NTFS partitions
Writing to NTFS is still (2011) inherently not quite safe, but reported problems are few with restricted use like in this case. Therefore, general backup measures should be adequate also for Knoppix use. If there is more than one partition to install to, it might be smart to avoid the system partition, as the data partition should be well backed up in any case,
- Beware of Boot directory on Windows!