How to create a rescuesystem on an internal flashdrive:

First step you build a VM with a minimal Debian based system (you can use and configure this minimal System booting from a USB-Device for many possibilities). Cloning or using an existing Live-Distribution is a a bit difficult. So this is the easier and faster way.

Next step you save the mbr of the VM-System:

dd if=/dev/sdx of /home/rescue/mbr.img bs=512 count=1

(bs=512 saves the mbr and the partitiontable; bs=448 only saves the mbr)

Next step you save your system using fsarchiver. If you have more than one partition, you have to save /boot-partition, /home and /. For this type:

fsarchiver savefs -vA /yourdirectory/boot.fsa /dev/sdx
fsarchiver savefs -vA /yourdirectory/root.fsa /dev/sdx
fsarchiver savefs -vA /yourdirectory/home.fsa /dev/sdx ... ...

Now you can restore these backup-files to any internal or external flashdrive.

First restore the mbr:

dd if=/yourdirectory/mbr.img of=/dev/sdx bs=512 count=1

Next step you restore the filesystem-archives:

fsarchiver restfs /yourdirectory/boot.fsa id=0,dest=/dev/sdx ...

Last step you have to reinstall grub:

grub-install --root-directory=/ --no-floppy /dev/sdx

After a reboot your rescuesystem should be running.

If you have any problems booting the rescuesystem mostly your grub-install fails. To fix this go to your /boot/grub-directory on flashdrive. Open your grub.cfg and search the path to your boot-files. Many times there is a wrong path given in this configuration. Due to that problem the --root-directory variable during install grub is very important. Without setting this variable correctly, grub will not install correctly.

-- SebastianGleicher - 13 Apr 2012

DocumentationForm edit

Title HowTo configure Internal-Rescue-Flashdrive
Description Way to configure an internal rescuesystem or USB-System for different problems.
Tags rescue,flashdrive,usbdrive
Category Admin
Topic revision: r1 - 13 Apr 2012, SebastianGleicher
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback