Recover Linux DataLinux Data Recovery

Linux Recovery Tools


Single User Mode

Single User Mode is extremely useful for working on a sick system. Minimal system configuration is loaded, most file systems aren’t mounted, and the Bourne Shell, sh, is loaded without any profile and basic environment. Single user mode can be accessed several ways. While selecting a image in LILO, single user mode is one the options that can be specified, e.g. “Linux single” Additionally, single user mode can be set from multiuser mode “telinit 1” and opportunities to access single user mode are offered when critical services fail.

Boot Disk

Making a boot disk can be done with utilities or by copying the boot.img file from the Redhat CD. Redhat and Mandrake offermkbootdisk for creating up to date bootable floppies. Create a bootdisk with the current kernel with the command “mkbootdisk `uname -r`” Debian offers mkrboot which creates kernel and rootimage bootable from a single floppy. Most distributions also offer bootable floppy images that need to be copied from the distribution cd to a floppy disk. The dd command “dd if=[path]/boot.img of=/dev/fd0″ will copy the boot image to floppy, bit by bit. This disk will be bootable, but will not contain a current kernel or drive map.

Rescue Disk

With versions of Redhat prior to 6.2, a rescue image was also provided, containing basic file utilities to restore the system. Text editors and disk utilities provide a basic level of support to restore the system to a bootable state.

Utilities

Some Linux partition utilities are gpart and parted which offer partition tools and recovery. I have used the commercial product, Partition Magic, successfully in the past to correct many filesystem and partition problems.

When all else fails…

After the utilities and recovery modes have failed, or the problem is too complex to resolve through simple means (like the time I deleted over half of the software packages on my system including all the text editors) then reloading the operating system will provide the most direct means of recovering the system. User data may be preserved, but system configurations will be lost. Setup varies according to distribution and configuration. Redhat’s “Server” installation wipes all partitions, “Workstation” installation preserves some partitions and installs into blank space. “Custom” grants the most control and should be used for reinstalls. Debian installation is user controlled and very flexible, and partitions are mounted and assigned manually.