Create a Debian install USB key without erasing data (Squeeze 6.0.5)
Posted by mazet on Sep 19 2012 in Debian
Install syslinux installer on your system. If you're using a Debian Linux, just type:
Shell
sudo aptitude install syslinux |
Let's say that the associated device of the USB key is /dev/sdb
. Install syslinux boot loader on your USB key.
Shell
sudo syslinux --install /dev/sdb |
Mount USB key.
Shell
sudo mount /dev/sdb1 /media/usbkey |
Download Debian installer from SNT
Shell
wget http://ftp.nl.debian.org/debian/dists/stable/main/installer-i386/current/images/cdrom/gtk/initrd.gz -O /media/usbkey/gtk-initrd.gz | |
wget http://ftp.nl.debian.org/debian/dists/stable/main/installer-i386/current/images/cdrom/initrd.gz -O /media/usbkey/initrd.gz | |
wget http://ftp.nl.debian.org/debian/dists/stable/main/installer-i386/current/images/cdrom/vmlinuz -O /media/usbkey/vmlinuz |
Download latest business card image from CD image.
Shell
wget http://cdimage.debian.org/debian-cd/current/i386/iso-cd/debian-6.0.5-i386-businesscard.iso |
Mount it and copy .disk, dists and pool
Shell
mkdir image | |
sudo mount -t iso9660 -o loop debian-6.0.5-i386-businesscard.iso image | |
cp -r image/{.disk,dists,pool} /media/usbkey | |
sudo umount image | |
rmdir image |
You don't need anymore the Debian image, thus you can remove it.
Shell
rm debian-6.0.5-i386-businesscard.iso |
Create boot menu.
Shell
cp /usr/lib/syslinux/menu.c32 /media/usbkey | |
cat > /media/usbkey/syslinux.cfg <<EOF | |
DEFAULT debian-gui | |
UI menu.c32 | |
PROMPT 0 | |
TIMEOUT 0 | |
| |
MENU TITLE Debian GNU/Linux i386 6.0.5 | |
MENU WIDTH 78 | |
MENU MARGIN 6 | |
MENU VSHIFT 1 | |
MENU ROWS 13 | |
MENU TABMSGROW 19 | |
MENU HELPMSGROW 21 | |
MENU TABMSG Press ENTER to boot or TAB to edit. | |
MENU CMDLINEROW 22 | |
| |
LABEL debian-txt | |
MENU LABEL Install | |
LINUX vmlinuz | |
APPEND vga=788 initrd=initrd.gz -- quiet | |
| |
LABEL debian-rescue-txt | |
MENU LABEL Rescue mode | |
LINUX vmlinuz | |
APPEND vga=788 initrd=initrd.gz rescue/enable=true -- quiet | |
| |
LABEL debian-gui | |
MENU LABEL Graphical install | |
LINUX vmlinuz | |
APPEND video=vesa:ywrap,mtrr vga=788 initrd=gtk-initrd.gz -- quiet | |
| |
LABEL debian-rescue-gui | |
MENU label Graphical rescue mode | |
KERNEL vmlinuz | |
APPEND video=vesa:ywrap,mtrr vga=788 initrd=gtk-initrd.gz rescue/enable=true -- quiet | |
| |
EOF |
That's it!
Shell
sudo umount /media/usbkey |
This entry was posted by mazet and filed under Debian.