Pages

Installing Debian wheezy from USB over serial console


I wanted to install Debian wheezy on a machine without a video card and no CDROM. I had a 1GB USB and I tried initially the easy way, as described in https://www.debian.org/releases/stable/amd64/ch04s03.html.en#usb-copy-isohybrid by just copying the cd image to my /dev/sda (USB stick) but I did not got any output on the console. I copied the iso file to another linux machine, mounted it as a loop device, made modifications in the isolinux.cfg file to redirect everything on the console, by adding the kernel parameters to look like below and then recreated the iso file but that still did not output anything on the serial console.

 isolinux.cfg
serial 0 9600
default install
prompt 0
timeout 100
label install
  kernel install.amd/vmlinuz
  append console=ttyS0,9600n8 initrd=/install.amd/initrd.gz --quiet
So I gave this up quite easy, and I took another approach. What I did next I followed the flexible way, as described in the debian documentation, but with some changes: 1/ I set up 2 partitions on the USB disk (/dev/sda in this example), both FAT16 (e code in fdisk), both 500MB and set the bootable flag on /dev/sda1 2/ pretty much followed the documentation and setup fat16 on /dev/sda1 and /dev/sda2:
mkdosfs /dev/sda1
mkdosfs /dev/sda2
3/ I installed the MBR on /dev/sda
install-mbr /dev/sda
4/ Installed the syslinux bootloader on /dev/sda1
syslinux /dev/sda1
5/ Copy the kernel and the initial ram image on /dev/sda1. This is done by mounting /dev/sda1 on let's say /mnt and the copying from the netinst cd vmlinuz and initrd.gz from the folder install.amd/ to /mnt (where I have /dev/sda1 mounted). Then I have created the syslinux.cfg file on /mnt according to the documentation and added the entries:


syslinux.cfg
default vmlinuz
append console=ttyS0,96008n initrd=initrd.gz
So now on /dev/sda1 (mounted on /mnt) I have 4 files: vmlinuz - copied from the netinst cd initrd.gz - copied from the netinst cd ldlinux.sys - the bootloader installed by the command syslinux /dev/sda1 syslinux.cfg - created with the entries I outputted above I have unmounted /mnt
umount /mnt
And then I have copied the complete netinst cd on /dev/sda2. I had the netinst image on the hard drive under /home/user and I just copied it to /dev/sda2 (without mounting /dev/sda2).
cp /home/user/debian-7.8.0-amd64-netinst.iso /dev/sda2
sync
Then the USB having on /dev/sda1 the kernel, initrd file and syslinux bootloader with config while on /dev/sda2 the whole debian CD, I plugged it in the machine which I wanted to install. The output was displayed on the console and I could carry on all the install successful

1 comment:

ed pills online said...

Great article! We are linking to this particularly great post on our website. Keep up the good writing.