Lets build a Debian Jessie live ISO that will include any useful tools, like chntpw for changing/deleting forgotten Windows passwords, Foremost/TestDisk/Recoverdm for recovering lost data or corrupted partitions. Some sort of swiss knife, if you’re into these sort of things.
My host system is Debian Jessie, meaning some commands won’t work on previous versions like Wheezy. The final ISO will be generated with xorriso, and it will be an hybrid iso, that can be burned on CDs or copied onto USB drives.
First lets setup the host machine installing the required packages:
Let’s have a 32bit OS useful on older PCs as well as newer ones. I prefer using the minimal installation variant, meaning some packages will not be included. Also, you should replace the repository’s url with the fastest mirror available for your country. Once packages are downloaded and installed into rootdir/, we chroot and start tweaking our system:
Finally, installing utilities. Include everything you want (even a full-fledged GNOME environment) noting that some standard applications (like man and nano) are not included in the minbase install, and you should remember to install them:
apt-get install nano wicd-curses chntpw cmospwd testdisk foremost chkrootkit man less console-data kbd
Clean up, unmount filesystems and exit the chroot environment:
Create a file under image/isolinux and call it isolinux.cfg, and add these lines to it. This will be the syslinux configuration, giving us a small boot menu that gives us choice about what to boot. And yes, memtest is useful:
prompt 0 menu title Debian Live
label Debian Live menu label ^Debian Live menu default kernel /live/vmlinuz append initrd=/live/initrd boot=live
label hdt menu label ^Hardware Detection Tool (HDT) kernel hdt.c32 text help HDT displays low-level information about the systems hardware. endtext
label Memtest86+ menu label ^Memory Failure Detection (memtest86+)
label Memtest86+ (multiboot) menu label ^Memory Failure Detection (memtest86+) /live/memtest86+_multiboot.bin
At the end, we build the Squashfs filesystem and put it on our hybrid ISO using xorriso.
And here it is our ready to flash (or burn) iso image! Flash it on a usb stick with dd, being careful replacing /dev/sdxY with your usb drive (you can check with lsblk or sudo fdisk -l). It wouldn’t be nice dd’ ing that iso to your hard drive.
My ISO was approximately 150Mb. I didnt chose to install X.org and a window manager. Copying that on a usb drive means that we’ll lose the remaining space on the usb drive. To avoid this, partition the remaining (unallocated) space with fdisk, parted or a graphical frontend like gparted, even if Windows is not capable of mounting any partition other than the first. No problems instead on Linux.