Showing posts with label netinst. Show all posts
Showing posts with label netinst. Show all posts

2012/03/25

Preparing a USB stick using a network installer CD for Debian Squeeze

It can not be easier!

To install Debian GNU/Linux from network using a USB stick, download an installer image from here, from here if you need some non-free firmware or from here for the freshest version available.

Insert your usb stick and identify the device using dmesg.

dmesg

.
..
...
[3848496.714205] usb 3-2: new high speed USB device using ehci_hcd and address 4
[3848496.847464] usb 3-2: New USB device found, idVendor=03f0, idProduct=5307
[3848496.847468] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[3848496.847472] usb 3-2: Product: v165w
[3848496.847475] usb 3-2: Manufacturer: HP
[3848496.847478] usb 3-2: SerialNumber: 00000000000064
[3848496.847595] usb 3-2: configuration #1 chosen from 1 choice
[3848497.230156] Initializing USB Mass Storage driver...
[3848497.230383] scsi8 : SCSI emulation for USB Mass Storage devices
[3848497.230523] usb-storage: device found at 4
[3848497.230527] usb-storage: waiting for device to settle before scanning
[3848497.230541] usbcore: registered new interface driver usb-storage
[3848497.230548] USB Mass Storage support registered.
[3848502.230522] usb-storage: device scan complete
[3848502.231119] scsi 8:0:0:0: Direct-Access     hp       v165w            0.00 PQ: 0 ANSI: 2
[3848502.233229] sd 8:0:0:0: [sdh] 7892040 512-byte logical blocks: (4.04 GB/3.76 GiB)
[3848502.233720] sd 8:0:0:0: [sdh] Write Protect is off
[3848502.233724] sd 8:0:0:0: [sdh] Mode Sense: 00 00 00 00
[3848502.233728] sd 8:0:0:0: [sdh] Assuming drive cache: write through
[3848502.236846] sd 8:0:0:0: [sdh] Assuming drive cache: write through
[3848502.236851]  sdh:
[3848502.906878] sd 8:0:0:0: [sdh] Assuming drive cache: write through
[3848502.906884] sd 8:0:0:0: [sdh] Attached SCSI removable disk


So, in my case the device is /dev/sdh:

cat firmware-6.0.4-amd64-netinst.iso > /dev/sdh
sync


That's it, just boot from the USB stick and enjoy!

2011/08/25

Installing Debian GNU/Linux 6 from network using a USB flash drive and HP firmware for HP DL380 G7

This is the easiest way to do the job (of course, it is not a new procedure but I need to register it).

This Debian webpage shows us the propietary firmware available and this webpage shows how to prepare you flash drive to install Debian GNU/Linux 6 in your server!

The procedure

First, download the image from the Debian's repository with propietary firmware.

Second, download the image to format the flash drive from here, in my case amd64 for the HP DL380 G7.

Third, prepare your flash drive in other Linux machine. Let /dev/sdX be the place where your flash drive is mounted.

zcat boot.img.gz > /dev/sdX
mkdir -p /mnt/pendrive
mount /dev/sdX /mnt/pendrive
cp firmware-6.0.2.1-amd64-netinst.iso /mnt/pendrive
umount /mnt/pendrive

Fourth, boot your server with the flash drive inserted to install the system from network. The firmware for the network card will be available (plus some others).

Enjoy!

2011/03/05

Installing Debian GNU/Linux 6 from network using a USB flash drive and HP firmware for HP DL360 G7

UPDATE: A better way!

To install Debian GNU/Linux 6 in a server HP Proliant DL360 G7 using the network installer and a USB flash drive I wrote a shell script. Maybe you find it useful too.

You must know there is some proprietary firmware needed for the server to install (network at least).

After doing a little research, the know-how is in these sites:


http://wiki.debian.org/HP/ProLiant
http://wiki.debian.org/DebianInstaller/NetbootFirmware

In my case, the target architecture was amd64 (x86-64), but you would need some little modifications for any other architecture.

Before to run the shell script you need:

1- the network installer image from http://cdimage.debian.org/debian-cd/6.0.0/amd64/iso-cd/debian-6.0.0-amd64-netinst.iso

2- A USB flash drive (250 MB minimum).

3- A linux machine where you can run the shell script, I used a Debian GNU/Linux  Lenny.

The shell script is interactive, will download some files and write the USB flash drive. Be careful, data will be destroyed (after confirmation) because of formatting!

Remember to grant the needed permissions: chmod u+x script.sh


Use it on your own risk .



#!/bin/bash
function show
{
cat <<End-of-message
--------------------------------------------------
$0 TargetDevice TargetISO

Prepare a bootable pendrive with some HP Firmware!

Use it on your own risk.
-------------------------------------------------

End-of-message
}

##################################################################

show

# Validations

TARGET_DEVICE=$1
TARGET_ISO=$2
myPWD=$(pwd)

if [ $UID -ne 0 ]
then
    echo "You need to be root! (sudo?)"
    exit 3
fi

if [ -z "$TARGET_DEVICE" ]
then
    echo "You must specify the target device!"
    exit 1
fi

if [ -z "$TARGET_ISO" ]
then
        echo "You must specify the target iso!"
        exit 2
fi

echo "The current status of your device, beware any data will be destroyed!"

fdisk -l $TARGET_DEVICE

echo

ls -l $TARGET_ISO

echo

echo "Data will be destroyed!, press [Y] to continue"
read input

if [ "$input" != "Y" ]
then
    echo "Your answered [$input]"
    exit 0
fi

echo
echo "Creating bootable pendrive..."

if [ -n "$(mount | grep $TARGET_DEVICE)" ]
then
    echo "Unmounting $TARGET_DEVICE..."
    umount $TARGET_DEVICE

    if [ $? -ne 0 ]
    then
        echo "Error umounting the device!"
        exit 5
    fi
fi

if [ ! -e boot.img.gz ]
then
    echo
    echo "Downloading... boot.img.gz..."
    wget http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-amd64/current/images/hd-media/boot.img.gz
fi

echo
echo "Formatting..."

zcat boot.img.gz > $TARGET_DEVICE
rm -fr /mnt/pendrive.tmp
mkdir -p /mnt/pendrive.tmp
mount $TARGET_DEVICE /mnt/pendrive.tmp

echo
echo "Copying iso..."

cp $TARGET_ISO /mnt/pendrive.tmp/

ls -l /mnt/pendrive.tmp/*.iso

echo
echo "Updating the initrd.gz with HP firmware..."

# Make a temp dir and transform the firmware tarball into an firmware initramfs addon
FWTMP=$HOME/tmp/d-i_firmware
#rm -rf $FWTMP
mkdir  -p $FWTMP
cd $FWTMP

target=firmware.tar.gz

if [ ! -e $target ]
then
    wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/lenny/current/firmware.tar.gz
fi

tar -zxf firmware.tar.gz

if [ -z "$(which pax)" ]
then
    echo
    echo "Installing pax..."
    apt-get install pax
fi

for name in *.deb ; do
    ar -p $name data.tar.gz | tar -zxf -
done

pax -x sv4cpio -s '%lib%/lib%' -w lib | gzip -c >firmware.cpio.gz

# cd to the directory where you have your initrd
cd /mnt/pendrive.tmp

echo
echo "Backing up initrg.gz..."
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat $FWTMP/firmware.cpio.gz >> initrd.gz

ls -l initrd.gz*

cd $myPWD

echo
echo "Unmounting device..."

umount /mnt/pendrive.tmp

echo
echo "Done."



Ooops, I found this a little late :-|