Rescue FAQ

From Knoppix Documentation Wiki
Revision as of 17:36, 6 October 2005 by UnderScore (Talk | contribs)

Jump to: navigation, search

-German Version: Rescue FAQ Deutsch

-Versión en español : Rescate FAQ

Return to Knoppix FAQ

Knoppix is a great rescue disc too. You can repair Linux or that other OS, backup data, recover passwords, etc. The following solutions assume that you have booted Knoppix on the machine that needs to be repaired.

Q: I need to get into my Debian system to update some packages as my system is unable to boot! How do I do that?

A: Boot with the Knoppix CD and mount that partition using the Knoppix root shell. For example:

  • mount /dev/hda1 /mnt/hda1
  • chroot /mnt/hda1

Gives you a root shell back in your old system! Now get the resolved and updated packages [1] and dpkg -install them to fix the previous show stopping packages.

Q: My other Linux install is broken and I want to reinstall LILO.

A: Mount that partition and run LILO as root:

  • e.g. mount -o dev /mnt/hda1, if its already mounted, you'll have to clear the "nodev" flag: sudo mount -o remount,dev /mnt/hda1.
  • Enter that directory as root and run lilo: chroot /mnt/hda1 lilo.

Q: Ok, I've booted Knoppix, now how do I rescue the data?

A1: See Computer First Aid Using Knoppix, System Recovery and OSCON 2005-08-04 System Rescue with Knoppix.

A2: One of the best ways to recover your files is to plug in a USB drive of some sort.

  • When the desktop loads, you will see at least two hard drive icons on the desktop (one for your hard drive and one for the USB drive).
  • Click on the hard drive icons to open them up and figure out which drive is which.
  • Right-click the USB drive icon and choose "Actions > Change read/write mode" so you can write to the drive (it's read-only by default for security reasons).
  • Now find the files you want to back up and drag and drop them to the USB drive. When you are finished, shut down the system and remove the USB drive.

A3: If you have a CD burner installed (in addition to the drive that you booted Knoppix from), use one of the various tools on Knoppix to create a CD. If you have 1 gig of memory you can use the toram "cheat code" so that you will not need to keep the CD in the drive if you only have one CD drive.

A4: If you want to backup over the network, you can use NFS, Samba (windows share), scp (ssh copy), FTP, email or more. One method, using two networked machines on knoppix is as follows: boot knoppix on both machines (the "broken" machine and the target machine), start ssh server on the target machine, "kmenu->KNOPPIX->Servers->SSH Server", mount a device with sufficient space in read/write mode (note: NTFS does not currently support read/write). Then you can use scp to move the data from the broken machine to the target machine (in this example, the target machine has an IP address of On the "broken" box (get a root shell) issue a command scp -r /mnt/hda1/importantdata/ knoppix@ this will copy an entire directory (recursively) to the target machine.

Q: I'd like to backup/restore the MBR.


  • To backup use:
    • sudo dd if=/dev/hda of=mbr.backup bs=512 count=1
  • To restore use:
    • sudo dd of=/dev/hda if=mbr.backup bs=512 count=1

Caution the MBR contains the partition table (the first four primary entries) it will break things if you changed the partition since the backup.

If you do not want to restore the partition table you should use sudo dd of=/dev/hda if=mbr.backup bs=1 count=448 instead. This will write only the first 448 bytes of the MBR leaving the last 64 bytes intact (4 partition table entries * 16 bytes/entry).

Be warned that you may not be able to boot from this disk if you changed the partition table after the backup of the MBR, depending on the actual boot loader .

Q: I forgot my password for an installed Windows/Linux!?

A1: Yeah, as if anyone would believe you! But in case you're really serious, you might try "john" and expect to wait a while.

A2: You can change password by chrooting into installed linux and running passwd. You may need to mount your linux read-write:

  • mount -o remount,rw /dev/hd.. /mnt/hd..
  • chroot /mnt/hd..
  • passwd root

Q: The other Linux/*nix box does not work correctly, but im sure the network is functional.

A: try "ssh" and/or "telnet" to log in on that remote box. you'll need to know a password, but after that you can use the shell to repair the box.

Q: Rescuing knoppix with knoppix :-) "I am a new user to linux and i just installed KNOPPIX on one partition, but then i installed windows 98 on another partition and now i can't get lilo to come back.... how do i make it so lilo will come back"


  • boot from floppy
    • You can boot the system with the boot floppy you got when you installed Knoppix on HDD.
    • Then edit the file /etc/lilo.conf . After that start "lilo" as root.
  • boot from CD
    • Boot the CD and type "knoppix 2" (see Cheat Codes). This will start knoppix into the shell/commandline.
    • Mount your root partition mount /dev/hda1 /mnt, edit /mnt/etc/lilo.conf (insert your windows partition),
    • Change root to your hd install: chroot /mnt/hda1 (substitute hda1 for your hd install partition)
  • and execute lilo: lilo -v

Q: How do I load Windows (aka Samba) shares from Knoppix?

A: There are several ways but the easiest is probably:

  • Go into Konqueror, Go up to the Location bar and Type the host information in the format: [smb://HOST/SHARE]
  • Three handy utilities to scan the network if you forget the HOST, are Lin Neighborhood (for versions released on or later than 2003-04-18), xSMBrowser (for 3.2 versions released before 2003-04-18) or Komba2 (for earlier versions) which is listed in the menus.

Q: Are there any utilities on the knoppix disk to conveniently manage partitions, e.g. Disk Drake?

A: Tried parted ? [2] [3]

A2: For resizing Windows XP/W2K/W2K3/NT4/Longhorn NTFS, Solution 2 in the ntfsresize FAQ (Frequently Asked Questions) at [4] works well. Ntfsresize version 1.9.0 can even cope with fragmented partitions successfully. For backup of a partition, Partition Image and ntfsclone are great! [5]

A3: Knoppix also includes a graphical partition utility, QTParted, which is compatible with ntfsresize.

Q: How do I setup swap?

A: On machines with small RAM you would want to have a swap file when running knoppix from CD. What you can do is to create a swap file on your partition, register it in /etc/fstab and turn swap on. That is how to do it. Choose a mounted partition which has enough free space, for the purpose of this example let it be /mnt/hda1

  • Create a linear file: dd if=/dev/zero of=/mnt/hda1/swapfile bs=1024 count=65536 for a 64Mb swap file
  • Add the swap partition tables: mkswap /mnt/hda1/swapfile
  • Register the file in /etc/fstab: as a root add a line /mnt/hda1/swapfile swap swap defaults 0 0
  • Turn swapping on: run swapon -a as a root
  • Check that the swap file appears in /proc/swaps

Return to Knoppix FAQ .