What is Knoppix?
A complete Linux distribution that runs directly from a bootable CD-ROM, Knoppix has many uses:
- Demonstrate Linux to newcomers
- Portable Linux Distribution
- Make Linux easier to install
- Tools for system administration
- Rescue disc (for Linux and Windows)
- Make your own live CD
- Many other uses
Demonstrate Linux
Why Knoppix is great for demos:
- No need to install
- Fast
- Great hardware autodetection
- Includes lots of software
- Non-intrusive
Portable Linux Distribution
Take your distro with you:
- Cheat Codes (run anywhere)
- Persistent Settings
- saveconfig
- mkpersistenthome
Cheat Codes
Cheat codes let you tweak boot behavior
- Change screen resolution settings
- Change desktops
- Change kernels
- Bypass mistakes in hardware detection
- Free up the CD-ROM
- Expert and others
Persistent Settings
/usr/sbin/saveconfig
- saveconfig can save a number of settings
- Desktop
- home directory "dotfiles"
- network and display settings
- printers and other settings in /etc
- Doesn't auto-update
- "myconf=scan" restores settings
- Tweak without remastering
Persistent Settings
mkpersistenthome
- Creates a filesystem image of /home
- usb key/floppy drive
- hard drive partition
- Always current settings
- "home=scan" restores settings
Knoppix the Linux installer
- Copies full CD to disk (requires 2GB)
- GUI and text-based
- Knoppix 3.4 and greater has 3 installation types:
- Not exactly pure Debian
Knoppix the Admin Toolbox
- Backup filesystems
- Image disks
- Emergency services
- Apache
- Samba
- NFS, FTP, MySQL, BIND, etc
- Forensics
Knoppix the Rescue Disk
- Excellent hardware detection
- Safe for the underlying system
- Comes with useful rescue tools: lilo, grub, dd, gpart, dpkg, rpm, etc.
- Full Internet access for troubleshooting
Games!Productivity Applications
The Windows "Recovery" Disk
- Included on Windows 2000 and XP install disks
- Has predefined functions to repair a broken Windows system.
The Windows "Recovery" Disk
What it can do | What it can't do |
- View text files
- Check the disk for errors
- Fix the MBR and boot.ini with defaults
- Partition drives and format them
- Restore system files from CD
|
- Edit text files
- Browse outside of %SYSTEMROOT% and the root folder
- Copy to floppies or CD
- Edit registry
- Much, much more
|
Knoppix the Windows Recovery Disk
What Knoppix can do
- Write to the full disk (even NTFS)
- Fix boot.ini
- Scan for viruses
- Install files from .cabs
- Blank passwords
- Edit the registry
Make Your Own Live CD
- Check other Knoppix derivatives
- Copy Knoppix structure to a hard drive
- chroot
- Make changes
- Recreate compressed filesystem
- Recreate .iso
- Test with bootfrom
- Burn to CD
Fix Catastrophic Screw-ups
What are catastrophic screw-ups?
root@ttyp0[/]# rm -rf .
C:\ fdisk /mbr (or installing Windows)
root@ttyp0[/]# dd if=/lib/grub/i386-pc/stage1 of=/dev/hda bs=512 count=1
Death-(well MBR-)defying Live Demo!
Delete the complete Master Boot Record and restore it and grub using Knoppix
I Like My Laptop
- Fujitsu P2110 (867Mhz Crusoe, portable, 10.6" 16:9 display, excellent battery life)
- Dual-boots Debian (95%) and Windows 2000 (5%)
- New 5400RPM 16MB cache hard drive
- Lots of custom scripts and tweaks (http://greenfly.org/fujitsu)
How to Erase Your MBR
root@ttyp0[/]# dd if=/dev/zero of=/dev/hda bs=512 count=1
Boot Knoppix
Use console mode (boot with knoppix 2
)
Not necessary, but saves time since all the recovery tools are command line based
Gpart
- short for "Guess Partition"
- scans a drive for anything that looks like the beginning and end of a partition, then creates a MBR based on it
- works best with primary partitions
- not perfect (double check results)
Run Gpart
First run gpart without the -W option to test
root@ttyp0[/]# gpart /dev/hda
Then use -W to actually write the changes
root@ttyp0[/]# gpart -W /dev/hda /dev/hda
Tweak the Results
gpart might not correctly find the end of all of your partitions.
Use a tool like fdisk or cfdisk to recreate the partition to fill up its space in this case.
Fix Grub
- Mount the Linux partition that contains your /boot directory read-write:
root@ttyp0[/]# mount -o rw /dev/hda3 /mnt/hda3
- Run grub-install to restore grub to the boot sector:
root@ttyp0[/]# grub-install --root-directory=/mnt/hda3 /dev/hda
- Reboot