Difference between revisions of "Poor-mans install, grub, PDI"


From Knoppix Documentation Wiki
Jump to: navigation, search
(tidied up menu.lst v01: copy files from CD)
(loop -> cdromNotes so far)
Line 79: Line 79:
 
pump -i eth0 &
 
pump -i eth0 &
  
     alias mrw='mount -o remount,rw /cdrom2.loop/'
+
     alias mrw='mount -o remount,rw /cdrom'
     alias mro='mount -o remount,ro /cdrom2.loop/'
+
     alias mro='mount -o remount,ro /cdrom'
  
 
     alias alias.save='alias > ~/.aliases.bash'  
 
     alias alias.save='alias > ~/.aliases.bash'  

Revision as of 17:36, 20 December 2005

Summary

The goal is to boot Knoppix from the HDD using a bootloader (grub) and three files: the ISO, a swap file, and a persistent disk image (PDI).

v01: copy files from CD

  • boot with knoppix from the CD
knoppix dma noswap vga=0 1
# set environment variables
drive=/dev/hda
partition=/dev/hda1
mountpoint=/mnt/hda1

# clear the entire drive - yes, all information will be lost
{ seq -f d$'\n'%g 64 -1 1 
  echo "w"
} | fdisk ${drive} >& /dev/null                                                        
fdisk -l ${drive}

# Partition drive, creating a 1 GB partition that has the bootable flag set
echo -e "n\np\n1\n1\n+1G\na\n1\np\nw" | fdisk ${drive}
fdisk -l ${drive}

# create filesystem
 mkfs.ext2 ${partition}

# rebuild /etc/fstab
 rebuildfstab -r

# mount the partition
 mount ${mountpoint}

# install grub
 grub-install --root-directory=${mountpoint} ${drive}

# copy the files from the CD to /dev/hda1
 cp -a /cdrom/ ${mountpoint}/knx402 &
 ls -la ${mountpoint}/knx402/KNOPPIX/KNOPPIX

# create /mnt/hda1/boot/grub/menu.lst
cat <<eof > ${mountpoint}/boot/grub/menu.lst
timeout=5
default=0
title Knoppix 4.0.2 from ext2 hda1 ISO scan ramdisk=32MB
  kernel (hd0,0)/knx402/boot/isolinux/linux ramdisk_size=100000 \\
    init=/etc/init lang=us apm=power-off vga=0 nomce quiet \\
    fromhd=${partition} knoppix_dir=knx402/KNOPPIX config=scan \\
    home=scan ramdisk=32768 noprompt noeject -b 1
  initrd (hd0,0)/knx402/boot/isolinux/minirt.gz
  boot
title Memory test
  kernel (hd0,0)/knx402/boot/isolinux/memtest
eof
wc -l ${mountpoint}/boot/grub/menu.lst

# unmount hda1
 umount ${mountpoint}

# boot from the HDD

 reboot

Notes so far


knoppix dma bootfrom=/dev/hda1/k402.iso vga=0 1

knoppix dma bootfrom=/dev/hda1/k402.iso vga=0 -b 1

knoppix dma noprompt noeject vga=0 1

{
rmmod tulip
modprobe de2104x
pump -k
pump -i eth0 &

    alias mrw='mount -o remount,rw /cdrom'
    alias mro='mount -o remount,ro /cdrom'

    alias alias.save='alias > ~/.aliases.bash' 
    alias cls='clear' 
    alias cp='cp -i' 
    alias dir='ls -la' 
    alias function.delete='unset -f' 
    alias function.list='declare -f' 
    alias function.save='declare -f > ~/.functions.bash ' 
    alias h='history' 
    alias l.='ls .[a-zA-Z]* --color=tty' 
    alias less='less -iX -S -# 10' 
    alias ll='ls -l --color=tty' 
    alias ls='ls --color=tty' 
    alias more='less' 
    alias mv='mv -i' 
    alias path='echo $PATH' 
    alias pause='kill -19' 
    alias pd='cd -' 
    alias perl='perl -MEnglish -w' 
    alias rehash='hash -r' 
    alias resume='kill -18' 
    alias rm='rm -i' 
    alias root='sudo su -' 
    alias ssh='ssh -X' 
}
    alias.save 


----
simple install (non-iso)
v1 - install using tohd, boot using fromhd, grub

## tohd
# a "/" at the end of /dev/hda/ -- doesn't work. ext2
knoppix dma noprompt noeject vga=0 tohd=/dev/hda1/ 1

# sans "/" -- works. ext2
knoppix dma noprompt noeject vga=0 tohd=/dev/hda1 1

# specifying knoppix_dir -- doesn't work
knoppix dma noprompt noeject vga=0 tohd=/dev/hda1 knoppix_dir=foo 1

# specifying a subdir -- doesn't work. ext2
knoppix dma noprompt noeject vga=0 tohd=/dev/hda1/foo 1

# specifying fromhd -- works. ext2
knoppix dma noprompt noeject vga=0 tohd=/dev/hda1 fromhd 1

## fromhd
# specify fromhd -- works
knoppix dma noprompt noeject vga=0 fromhd=/dev/hda1 1

# specifying knoppix_dir as foo -- doesn't work, yet
knoppix dma noprompt noeject vga=0 fromhd=/dev/hda1 knoppix_dir=foo -b 1

# specifying knoppix_dir as KNOPPIX -- works
knoppix dma noprompt noeject vga=0 fromhd=/dev/hda1 knoppix_dir=KNOPPIX -b 1

# rename /dev/hda1/KNOPPIX to /dev/hda1/foo and specifying knoppix_dir as foo -- works
knoppix dma noprompt noeject vga=0 fromhd=/dev/hda1 knoppix_dir=foo -b 1

# mv /dev/hda1/KNOPPIX to /dev/hda1/foo and specifying knoppix_dir as foo/KNOPPIX -- works
knoppix dma noprompt noeject vga=0 fromhd=/dev/hda1 knoppix_dir=foo/KNOPPIX -b 1

## grub
# copy kernel and initrd to /foo
cd  /cdrom/boot/isolinux/
cp -a minirt.gz linux memtest /mnt/hda1/foo/

# modify grub stanza
cd /mnt/hda1/boot/grub/
cat <<eof > menu.lst
timeout=5
default=0

title Knoppix 4.0.2 from ext3 hda1 ISO scan ramdisk=32MB
	kernel (hd0,0)/foo/linux ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=0 nomce quiet fromhd=/dev/hda1 knoppix_dir=foo/KNOPPIX config=scan home=scan ramdisk=32768 noprompt noeject -b 1
        initrd (hd0,0)/foo/minirt.gz
        boot


title Memory test
        kernel (hd0,0)/foo/memtest

eof

# boot using grub -- works


v2 - include a PDI
create a pdi on /dev/dha1.  So far, booting with this PDI hasn't worked.  Looks like theres a bug in /etc/init.d/knoppix-autoconfig.  The code has two RegExs for ext3 and none for ext2.  The solution is to boot using the -b cheatcode, modify /knoppix-autoconfig, and continue booting.  Then the PDI is recognized and mounted.

# misc boot lines and commands
knoppix dma noprompt noeject vga=0 -b 1


tune2fs -O ^has_journal /dev/hda1