Thursday, October 23, 2008

Debian etch stable (debian-40r4a-i386-netinst) on my IBM T43 laptop using USB flash drive

Here we go...

Case 1: If your are creating boot device (flash drive) using gnu/linux (I used debian 3 etch as a base system on my PIV HT HCL desktop machine)

1st of all check where your USB drive is getting detected using `dmesg` command in terminal window;

$> dmesg

Oct 23 17:05:48 localhost kernel: usb 5-5: new high speed USB device using ehci_hcd and address 5
Oct 23 17:05:49 localhost kernel: usb 5-5: configuration #1 chosen from 1 choiceOct 23 17:05:49 localhost kernel: scsi4 : SCSI emulation for USB Mass Storage devices
Oct 23 17:05:54 localhost kernel: Vendor: Kingston Model: DataTraveler 2.0 Rev: PMAP
Oct 23 17:05:54 localhost kernel: Type: Direct-Access ANSI SCSI revision: 00
Oct 23 17:05:54 localhost kernel: SCSI device sdb: 3903488 512-byte hdwr sectors (1999 MB)
Oct 23 17:05:54 localhost kernel: sdb: Write Protect is off
Oct 23 17:05:54 localhost kernel: SCSI device sdb: 3903488 512-byte hdwr sectors (1999 MB)
Oct 23 17:05:54 localhost kernel: sdb: Write Protect is off
Oct 23 17:05:54 localhost kernel: sdb: sdb1
Oct 23 17:05:54 localhost kernel: sd 4:0:0:0: Attached scsi removable disk sdb
Oct 23 17:05:54 localhost kernel: sd 4:0:0:0: Attached scsi generic sg2 type 0


i.e it's detected on 'SCSI device sdb' so in my case USB device is indicated by "/dev/sdb"

Now clean/format your flash drive (FAT16 fs), [I used 256M Kingston Data DataTraveler 2.0]

Then unmount /dev/sdb;

$> sudo umount /dev/sdb

Now get the boot.img.gz, which is necessary to make your USB device bootable, I took the following one;

$> wget -c http://ftp.debian.org/debian/dists/stable/main/installer-i386/current/images/hd-media/boot.img.gz


Extract this image and write it to your USB device:

$> sudo zcat ~/boot.img.gz > /dev/sdb



Now mount the volume (flash drive) to any mount point, I used /mnt/sdb1 mount point;

$> sudo mount /dev/sdb1 /mnt/sdb1


In this case a Debian Stable net-install image is used. You may also use a business card iso. Nevertheless, you should be sure to use the same version of the ISO-image as the image.tar.gz that was used before.

Download the ISO to the USB device, I took the following one;

$> cd /mnt/sdb1

$> wget -c http://cdimage.debian.org/debian-cd/4.0_r4a/i386/iso-cd/debian-40r4a-i386-netinst.iso



Now unmount the volume;

$> sudo umount /dev/sdb



Now you can remove the USB device, and plug it in your new system (in my case my IBM lappy). Of course you should tell your BIOS to boot. My laptop booted in minimal base system from USB flash drive and the I started net installation following the debian-installer wizard further ! In my case I could not setup network using DHCP but then there is an option of "Manual n/w configuration" !


Note: I used Flash Drive as a booting device but same procedure should work for other USB devices (viz. USB HDD, etc) as well, I guess, although I haven't tried it yet. One can try for ATA/SATA HDD (internal) boot as well, I would certainly try it myself sometimes in future :-)


Happy Hacking !!


Ref: http://www.debian-administration.org/articles/446