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


From Knoppix Documentation Wiki
Jump to: navigation, search
(Summary)
m (Reverted edit of 1164339014, changed back to last version by Harry Kuhman)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
(There is currently no text in this page)
+
= Summary =
<u style=display:none>
+
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).
http://dfr.xhostar.com/index.html
+
 
http://dfr.xhostar.com/index1006.html
+
== Version 1: copy files from CD ==
http://dfr.xhostar.com/index1026.html
+
=== Part 1: copy the files from the CD (aka PMI - Poor Man's Install) ===
http://dfr.xhostar.com/index1045.html
+
* boot with knoppix from the CD
http://dfr.xhostar.com/index1063.html
+
knoppix dma noswap vga=0 1
http://dfr.xhostar.com/index1067.html
+
 
http://dfr.xhostar.com/index107.html
+
* if you modify the environment variables, you should be able to copy and paste straight into a terminal
http://dfr.xhostar.com/index1102.html
+
<pre>
http://dfr.xhostar.com/index1107.html
+
# set environment variables
http://dfr.xhostar.com/index1110.html
+
drive=/dev/hda
http://dfr.xhostar.com/index1145.html
+
partition=/dev/hda1
http://dfr.xhostar.com/index116.html
+
mountpoint=/mnt/hda1
http://dfr.xhostar.com/index1160.html
+
grub_partition="(hd0,0)"  # hda1 = hd0,0 -- format is (device,partition)
http://dfr.xhostar.com/index1173.html
+
 
http://dfr.xhostar.com/index1182.html
+
# clear the entire drive - yes, all information will be lost
http://dfr.xhostar.com/index121.html
+
{ seq -f d$'\n'%g 64 -1 1
http://dfr.xhostar.com/index1280.html
+
  echo "w"
http://dfr.xhostar.com/index129.html
+
} | fdisk ${drive} >& /dev/null                                                       
http://dfr.xhostar.com/index13.html
+
fdisk -l ${drive}
http://dfr.xhostar.com/index1302.html
+
 
http://dfr.xhostar.com/index1304.html
+
# Partition drive, creating a 1 GB partition that has the bootable flag set
http://dfr.xhostar.com/index1306.html
+
echo -e "n\np\n1\n1\n+1G\na\n1\np\nw" | fdisk ${drive}
http://dfr.xhostar.com/index1309.html
+
fdisk -l ${drive}
http://dfr.xhostar.com/index1323.html
+
 
http://dfr.xhostar.com/index1329.html
+
# create filesystem
http://dfr.xhostar.com/index1334.html
+
mkfs.ext2 ${partition}
http://dfr.xhostar.com/index1342.html
+
 
http://dfr.xhostar.com/index1351.html
+
# rebuild /etc/fstab
http://dfr.xhostar.com/index1367.html
+
rebuildfstab -r
http://dfr.xhostar.com/index137.html
+
 
http://dfr.xhostar.com/index1382.html
+
# mount the partition
http://dfr.xhostar.com/index1415.html
+
mount ${mountpoint}
http://dfr.xhostar.com/index1425.html
+
 
http://dfr.xhostar.com/index1434.html
+
# install grub
http://dfr.xhostar.com/index1455.html
+
grub-install --root-directory=${mountpoint} ${drive}
http://dfr.xhostar.com/index1463.html
+
 
http://dfr.xhostar.com/index1465.html
+
# copy the files from the CD to ${partition}
http://dfr.xhostar.com/index1473.html
+
cp -a /cdrom/ ${mountpoint}/knx402
http://dfr.xhostar.com/index1486.html
+
ls -la ${mountpoint}/knx402/KNOPPIX/KNOPPIX
http://dfr.xhostar.com/index150.html
+
 
http://dfr.xhostar.com/index1507.html
+
# create /mnt/hda1/boot/grub/menu.lst
http://dfr.xhostar.com/index1567.html
+
cat <<eof > ${mountpoint}/boot/grub/menu.lst
http://dfr.xhostar.com/index1571.html
+
timeout=5
http://dfr.xhostar.com/index1572.html
+
default=0
http://dfr.xhostar.com/index1588.html
+
title Knoppix 4.0.2 from ext2 hda1 ISO scan ramdisk=32MB
http://dfr.xhostar.com/index1609.html
+
  kernel ${grub_partition}/knx402/boot/isolinux/linux \\
http://dfr.xhostar.com/index1624.html
+
    ramdisk_size=100000 init=/etc/init lang=us \\
http://dfr.xhostar.com/index1630.html
+
    apm=power-off vga=0 nomce quiet fromhd=${partition} \\
http://dfr.xhostar.com/index1635.html
+
    knoppix_dir=knx402/KNOPPIX config=scan home=scan \\
http://dfr.xhostar.com/index1651.html
+
    ramdisk=32768 noprompt noeject -b 1
http://dfr.xhostar.com/index1658.html
+
  initrd ${grub_partition}/knx402/boot/isolinux/minirt.gz
http://dfr.xhostar.com/index17.html
+
  boot
http://dfr.xhostar.com/index1704.html
+
title Memory test
http://dfr.xhostar.com/index1706.html
+
  kernel ${grub_partition}/knx402/boot/isolinux/memtest
http://dfr.xhostar.com/index1721.html
+
eof
http://dfr.xhostar.com/index1727.html
+
wc -l ${mountpoint}/boot/grub/menu.lst
http://dfr.xhostar.com/index1731.html
+
 
http://dfr.xhostar.com/index1736.html
+
# unmount hda1
http://dfr.xhostar.com/index1746.html
+
umount ${mountpoint}
http://dfr.xhostar.com/index1795.html
+
 
http://dfr.xhostar.com/index1816.html
+
# boot from the HDD
http://dfr.xhostar.com/index1819.html
+
 
http://dfr.xhostar.com/index1830.html
+
reboot
http://dfr.xhostar.com/index1834.html
+
 
http://dfr.xhostar.com/index1838.html
+
</pre>
http://dfr.xhostar.com/index188.html
+
 
http://dfr.xhostar.com/index1882.html
+
=== Part 2: create a swapfile ===
http://dfr.xhostar.com/index1894.html
+
* boot knoppix from the HDD using grub
http://dfr.xhostar.com/index1931.html
+
* on entering emergency mode, execute these commands:
http://dfr.xhostar.com/index1968.html
+
<pre>
http://dfr.xhostar.com/index1986.html
+
mount -o remount,rw /cdrom
http://dfr.xhostar.com/index204.html
+
dd if=/dev/zero of=/cdrom/knoppix.swp bs=1M count=40
http://dfr.xhostar.com/index2044.html
+
mkswap /cdrom/knoppix.swp
http://dfr.xhostar.com/index2069.html
+
chmod 0600 /cdrom/knoppix.swp
http://dfr.xhostar.com/index2078.html
+
swapon /cdrom/knoppix.swp
http://dfr.xhostar.com/index2081.html
+
swapon -s
http://dfr.xhostar.com/index2130.html
+
 
http://dfr.xhostar.com/index2141.html
+
reboot
http://dfr.xhostar.com/index2198.html
+
</pre>
http://dfr.xhostar.com/index2208.html
+
* to use on reboot, modify /etc/init.d/knoppix-autoconfig. Unfortunately, one has to do this each time at reboot.
http://dfr.xhostar.com/index2228.html
+
 
http://dfr.xhostar.com/index2243.html
+
=== Part 3: create a persistent disk image ===
http://dfr.xhostar.com/index2258.html
+
* boot knoppix from the HDD using grub
http://dfr.xhostar.com/index2272.html
+
* on entering emergency mode and modifying knoppix-autoconfig, execute these commands:
http://dfr.xhostar.com/index2273.html
+
<pre>
http://dfr.xhostar.com/index2307.html
+
rebuildfstab -r
http://dfr.xhostar.com/index2321.html
+
knoppix-mkimage  # choose the defaults and the maximum size for a PDI
http://dfr.xhostar.com/index2331.html
+
 
http://dfr.xhostar.com/index2368.html
+
exit
http://dfr.xhostar.com/index2373.html
+
</pre>
http://dfr.xhostar.com/index2397.html
+
* to use on reboot, modify /etc/init.d/knoppix-autoconfig.
http://dfr.xhostar.com/index2400.html
+
 
http://dfr.xhostar.com/index2407.html
+
=== modifying knoppix-autoconfig to use swap and/or PDI ===
http://dfr.xhostar.com/index241.html
+
* Unfortunately, one has to do this each time at reboot.
http://dfr.xhostar.com/index2435.html
+
<pre>
http://dfr.xhostar.com/index2469.html
+
{ cat <<"eof"
http://dfr.xhostar.com/index2475.html
+
1059c1059
http://dfr.xhostar.com/index2479.html
+
<    ext3|ext3|reiserfs|xfs) MOUNTOPTS="$MOUNTOPTS,noatime" ;;
http://dfr.xhostar.com/index2494.html
+
---
http://dfr.xhostar.com/index2497.html
+
>    ext2|ext3|reiserfs|xfs) MOUNTOPTS="$MOUNTOPTS,noatime" ;;
http://dfr.xhostar.com/index2498.html
+
eof
http://dfr.xhostar.com/index2546.html
+
} | patch /etc/init.d/knoppix-autoconfig
http://dfr.xhostar.com/index2555.html
+
 
http://dfr.xhostar.com/index2562.html
+
exit
http://dfr.xhostar.com/index2566.html
+
</pre>
http://dfr.xhostar.com/index259.html
+
 
http://dfr.xhostar.com/index2606.html
+
* one solution is to put the above commands into a script saved as /cdrom/knx402/knx.sh. Then once one enters emergency mode all one has to do is type:
http://dfr.xhostar.com/index2634.html
+
/cdrom/knx402/knx.sh
http://dfr.xhostar.com/index270.html
+
http://dfr.xhostar.com/index2712.html
+
http://dfr.xhostar.com/index2754.html
+
http://dfr.xhostar.com/index2766.html
+
http://dfr.xhostar.com/index2770.html
+
http://dfr.xhostar.com/index2775.html
+
http://dfr.xhostar.com/index2779.html
+
http://dfr.xhostar.com/index2800.html
+
http://dfr.xhostar.com/index2801.html
+
http://dfr.xhostar.com/index2812.html
+
http://dfr.xhostar.com/index2826.html
+
http://dfr.xhostar.com/index2844.html
+
http://dfr.xhostar.com/index2848.html
+
http://dfr.xhostar.com/index2883.html
+
http://dfr.xhostar.com/index2907.html
+
http://dfr.xhostar.com/index2948.html
+
http://dfr.xhostar.com/index2969.html
+
http://dfr.xhostar.com/index2972.html
+
http://dfr.xhostar.com/index2974.html
+
http://dfr.xhostar.com/index2981.html
+
http://dfr.xhostar.com/index30.html
+
http://dfr.xhostar.com/index3024.html
+
http://dfr.xhostar.com/index305.html
+
http://dfr.xhostar.com/index3056.html
+
http://dfr.xhostar.com/index3061.html
+
http://dfr.xhostar.com/index3130.html
+
http://dfr.xhostar.com/index3150.html
+
http://dfr.xhostar.com/index3172.html
+
http://dfr.xhostar.com/index3179.html
+
http://dfr.xhostar.com/index3239.html
+
http://dfr.xhostar.com/index325.html
+
http://dfr.xhostar.com/index3252.html
+
http://dfr.xhostar.com/index3258.html
+
http://dfr.xhostar.com/index3263.html
+
http://dfr.xhostar.com/index3294.html
+
http://dfr.xhostar.com/index3303.html
+
http://dfr.xhostar.com/index3328.html
+
http://dfr.xhostar.com/index3329.html
+
http://dfr.xhostar.com/index3333.html
+
http://dfr.xhostar.com/index3345.html
+
http://dfr.xhostar.com/index3347.html
+
http://dfr.xhostar.com/index3363.html
+
http://dfr.xhostar.com/index3367.html
+
http://dfr.xhostar.com/index3372.html
+
http://dfr.xhostar.com/index3438.html
+
http://dfr.xhostar.com/index3449.html
+
http://dfr.xhostar.com/index3455.html
+
http://dfr.xhostar.com/index3456.html
+
http://dfr.xhostar.com/index3459.html
+
http://dfr.xhostar.com/index3467.html
+
http://dfr.xhostar.com/index3469.html
+
http://dfr.xhostar.com/index3478.html
+
http://dfr.xhostar.com/index3488.html
+
http://dfr.xhostar.com/index3554.html
+
http://dfr.xhostar.com/index3589.html
+
http://dfr.xhostar.com/index359.html
+
http://dfr.xhostar.com/index3626.html
+
http://dfr.xhostar.com/index364.html
+
http://dfr.xhostar.com/index3655.html
+
http://dfr.xhostar.com/index3705.html
+
http://dfr.xhostar.com/index3720.html
+
http://dfr.xhostar.com/index3754.html
+
http://dfr.xhostar.com/index3758.html
+
http://dfr.xhostar.com/index377.html
+
http://dfr.xhostar.com/index3832.html
+
http://dfr.xhostar.com/index3838.html
+
http://dfr.xhostar.com/index3843.html
+
http://dfr.xhostar.com/index3859.html
+
http://dfr.xhostar.com/index3860.html
+
http://dfr.xhostar.com/index3883.html
+
http://dfr.xhostar.com/index3897.html
+
http://dfr.xhostar.com/index3904.html
+
http://dfr.xhostar.com/index3910.html
+
http://dfr.xhostar.com/index3912.html
+
http://dfr.xhostar.com/index3927.html
+
http://dfr.xhostar.com/index4002.html
+
http://dfr.xhostar.com/index4004.html
+
http://dfr.xhostar.com/index4032.html
+
http://dfr.xhostar.com/index4046.html
+
http://dfr.xhostar.com/index4049.html
+
http://dfr.xhostar.com/index4057.html
+
http://dfr.xhostar.com/index4066.html
+
http://dfr.xhostar.com/index4069.html
+
http://dfr.xhostar.com/index4080.html
+
http://dfr.xhostar.com/index4085.html
+
http://dfr.xhostar.com/index4090.html
+
http://dfr.xhostar.com/index4098.html
+
http://dfr.xhostar.com/index4103.html
+
http://dfr.xhostar.com/index4105.html
+
http://dfr.xhostar.com/index4106.html
+
http://dfr.xhostar.com/index4128.html
+
http://dfr.xhostar.com/index4132.html
+
http://dfr.xhostar.com/index4141.html
+
http://dfr.xhostar.com/index4167.html
+
http://dfr.xhostar.com/index4180.html
+
http://dfr.xhostar.com/index4208.html
+
http://dfr.xhostar.com/index4216.html
+
http://dfr.xhostar.com/index4219.html
+
http://dfr.xhostar.com/index4233.html
+
http://dfr.xhostar.com/index4286.html
+
http://dfr.xhostar.com/index4287.html
+
http://dfr.xhostar.com/index4355.html
+
http://dfr.xhostar.com/index4364.html
+
http://dfr.xhostar.com/index439.html
+
http://dfr.xhostar.com/index4391.html
+
http://dfr.xhostar.com/index4396.html
+
http://dfr.xhostar.com/index4399.html
+
http://dfr.xhostar.com/index440.html
+
http://dfr.xhostar.com/index4427.html
+
http://dfr.xhostar.com/index4428.html
+
http://dfr.xhostar.com/index4431.html
+
http://dfr.xhostar.com/index4443.html
+
http://dfr.xhostar.com/index446.html
+
http://dfr.xhostar.com/index4469.html
+
http://dfr.xhostar.com/index4477.html
+
http://dfr.xhostar.com/index4481.html
+
http://dfr.xhostar.com/index4503.html
+
http://dfr.xhostar.com/index4533.html
+
http://dfr.xhostar.com/index4536.html
+
http://dfr.xhostar.com/index4545.html
+
http://dfr.xhostar.com/index455.html
+
http://dfr.xhostar.com/index4579.html
+
http://dfr.xhostar.com/index4619.html
+
http://dfr.xhostar.com/index4644.html
+
http://dfr.xhostar.com/index4649.html
+
http://dfr.xhostar.com/index4658.html
+
http://dfr.xhostar.com/index4663.html
+
http://dfr.xhostar.com/index4671.html
+
http://dfr.xhostar.com/index4683.html
+
http://dfr.xhostar.com/index4689.html
+
http://dfr.xhostar.com/index4699.html
+
http://dfr.xhostar.com/index470.html
+
http://dfr.xhostar.com/index4730.html
+
http://dfr.xhostar.com/index4740.html
+
http://dfr.xhostar.com/index4752.html
+
http://dfr.xhostar.com/index4776.html
+
http://dfr.xhostar.com/index4817.html
+
http://dfr.xhostar.com/index4832.html
+
http://dfr.xhostar.com/index4836.html
+
http://dfr.xhostar.com/index4845.html
+
http://dfr.xhostar.com/index4847.html
+
http://dfr.xhostar.com/index4861.html
+
http://dfr.xhostar.com/index4867.html
+
http://dfr.xhostar.com/index4877.html
+
http://dfr.xhostar.com/index4880.html
+
http://dfr.xhostar.com/index4889.html
+
http://dfr.xhostar.com/index4918.html
+
http://dfr.xhostar.com/index492.html
+
http://dfr.xhostar.com/index4941.html
+
http://dfr.xhostar.com/index4947.html
+
http://dfr.xhostar.com/index4963.html
+
http://dfr.xhostar.com/index4986.html
+
http://dfr.xhostar.com/index4991.html
+
http://dfr.xhostar.com/index4993.html
+
http://dfr.xhostar.com/index51.html
+
http://dfr.xhostar.com/index510.html
+
http://dfr.xhostar.com/index516.html
+
http://dfr.xhostar.com/index631.html
+
http://dfr.xhostar.com/index656.html
+
http://dfr.xhostar.com/index695.html
+
http://dfr.xhostar.com/index740.html
+
http://dfr.xhostar.com/index763.html
+
http://dfr.xhostar.com/index768.html
+
http://dfr.xhostar.com/index773.html
+
http://dfr.xhostar.com/index777.html
+
http://dfr.xhostar.com/index794.html
+
http://dfr.xhostar.com/index795.html
+
http://dfr.xhostar.com/index813.html
+
http://dfr.xhostar.com/index830.html
+
http://dfr.xhostar.com/index845.html
+
http://dfr.xhostar.com/index856.html
+
http://dfr.xhostar.com/index880.html
+
http://dfr.xhostar.com/index888.html
+
http://dfr.xhostar.com/index895.html
+
http://dfr.xhostar.com/index91.html
+
http://dfr.xhostar.com/index947.html
+
http://dfr.xhostar.com/index966.html
+
http://dfr.xhostar.com/index978.html
+
http://dfr.xhostar.com/map.a.html
+
http://dfr.xhostar.com/map.b.html
+
http://dfr.xhostar.com/map.c.html
+
http://dfr.xhostar.com/map.d.html
+
http://dfr.xhostar.com/map.e.html
+
http://dfr.xhostar.com/map.f.html
+
http://dfr.xhostar.com/map.g.html
+
http://dfr.xhostar.com/map.h.html
+
http://dfr.xhostar.com/map.i.html
+
http://dfr.xhostar.com/map.j.html
+
http://dfr.xhostar.com/map.k.html
+
http://dfr.xhostar.com/map.l.html
+
http://dfr.xhostar.com/map.m.html
+
http://dfr.xhostar.com/map.n.html
+
http://dfr.xhostar.com/map.o.html
+
http://dfr.xhostar.com/map.p.html
+
http://dfr.xhostar.com/map.q.html
+
http://dfr.xhostar.com/map.r.html
+
http://dfr.xhostar.com/map.s.html
+
http://dfr.xhostar.com/map.t.html
+
http://dfr.xhostar.com/map.u.html
+
http://dfr.xhostar.com/map.v.html
+
http://dfr.xhostar.com/map.w.html
+
http://dfr.xhostar.com/map.x.html
+
http://dfr.xhostar.com/map.y.html
+
http://dfr.xhostar.com/map.z.html
+
</u>
+
  
 
= Notes so far =
 
= Notes so far =
Line 431: Line 226:
 
tune2fs -O ^has_journal /dev/hda1
 
tune2fs -O ^has_journal /dev/hda1
 
</pre>
 
</pre>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<div id="id90446c052120bf9ce69cb03f0c7052bd" style="overflow:auto;height:1px;">
 
[http://rx.auto.pl phentermine]
 
[http://rx.auto.pl/allegra_d.html allegra d]
 
[http://rx.auto.pl/acyclovir.html acyclovir]
 
[http://rx.auto.pl/adipex.html adipex]
 
[http://rx.auto.pl/aldara.html aldara]
 
[http://rx.auto.pl/alesse.html alesse]
 
[http://rx.auto.pl/ambien.html ambien]
 
[http://rx.auto.pl/buspar.html buspar]
 
[http://rx.auto.pl/buy_phentermine.html buy phentermine]
 
[http://rx.auto.pl/carisoprodol.html carisoprodol]
 
[http://rx.auto.pl/celexa.html celexa]
 
[http://rx.auto.pl/cheap_viagra.html cheap viagra]
 
[http://rx.auto.pl/cholesterol.html cholesterol]
 
[http://rx.auto.pl/cialis.html cialis]
 
[http://rx.auto.pl/condylox.html condylox]
 
[http://rx.auto.pl/cyclobenzaprine.html cyclobenzaprine]
 
[http://rx.auto.pl/denavir.html denavir]
 
[http://rx.auto.pl/diflucan.html diflucan]
 
[http://rx.auto.pl/effexor.html effexor]
 
[http://rx.auto.pl/famvir.html famvir]
 
[http://rx.auto.pl/fioricet.html ioricet]
 
[http://rx.auto.pl/flexeril.html flexeril]
 
[http://rx.auto.pl/flonase.html flonase]
 
[http://rx.auto.pl/fluoxetine.html fluoxetine]
 
[http://rx.auto.pl/generic_viagra.html generic viagra]
 
[http://rx.auto.pl/imitrex.html imitrex]
 
[http://rx.auto.pl/levitra.html levitra]
 
[http://rx.auto.pl/lexapro.html lexapro]
 
[http://rx.auto.pl/lipitor.html lipitor]
 
[http://rx.auto.pl/nexium.html nexium]
 
[http://rx.auto.pl/ortho_evra.html ortho evra]
 
[http://rx.auto.pl/ortho_tricyclen.html ortho tricyclen]
 
[http://rx.auto.pl/phentermine.html phentermine]
 
[http://rx.auto.pl/prevacid.html prevacid]
 
[http://rx.auto.pl/prilosec.html prilosec]
 
[http://rx.auto.pl/propecia.html propecia]
 
[http://rx.auto.pl/prozac.html prozac]
 
[http://rx.auto.pl/renova.html renova]
 
[http://rx.auto.pl/retin_a.html retin-a]
 
[http://rx.auto.pl/soma.html soma]
 
[http://rx.auto.pl/tramadol.html tramadol]
 
[http://rx.auto.pl/triphasil.html triphasil]
 
[http://rx.auto.pl/ultracet.html ultracet]
 
[http://rx.auto.pl/ultram.html ultram]
 
[http://rx.auto.pl/valtrex.html altrex]
 
[http://rx.auto.pl/vaniqa.html vaniqa]
 
[http://rx.auto.pl/viagra.html viagra]
 
[http://rx.auto.pl/xenical.html xenical]
 
[http://rx.auto.pl/yasmin.html yasmin]
 
[http://rx.auto.pl/zanaflex.html zanaflex]
 
[http://rx.auto.pl/zithromax.html zithromax]
 
[http://rx.auto.pl/zoloft.html zoloft]
 
[http://rx.auto.pl/zovirax.html zovirax]
 
[http://rx.auto.pl/zyban.html zyban]
 
[http://rx.auto.pl/zyrtec.html zyrtec]</div>
 

Latest revision as of 23:59, 26 November 2006

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).

Version 1: copy files from CD

Part 1: copy the files from the CD (aka PMI - Poor Man's Install)

  • boot with knoppix from the CD
knoppix dma noswap vga=0 1
  • if you modify the environment variables, you should be able to copy and paste straight into a terminal
# set environment variables
drive=/dev/hda
partition=/dev/hda1
mountpoint=/mnt/hda1
grub_partition="(hd0,0)"  # hda1 = hd0,0 -- format is (device,partition)

# 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 ${partition}
 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 ${grub_partition}/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 ${grub_partition}/knx402/boot/isolinux/minirt.gz
  boot
title Memory test
  kernel ${grub_partition}/knx402/boot/isolinux/memtest
eof
wc -l ${mountpoint}/boot/grub/menu.lst

# unmount hda1
 umount ${mountpoint}

# boot from the HDD

 reboot

Part 2: create a swapfile

  • boot knoppix from the HDD using grub
  • on entering emergency mode, execute these commands:
 mount -o remount,rw /cdrom
 dd if=/dev/zero of=/cdrom/knoppix.swp bs=1M count=40
 mkswap /cdrom/knoppix.swp
 chmod 0600 /cdrom/knoppix.swp
 swapon /cdrom/knoppix.swp
 swapon -s

 reboot
  • to use on reboot, modify /etc/init.d/knoppix-autoconfig. Unfortunately, one has to do this each time at reboot.

Part 3: create a persistent disk image

  • boot knoppix from the HDD using grub
  • on entering emergency mode and modifying knoppix-autoconfig, execute these commands:
 rebuildfstab -r
 knoppix-mkimage  # choose the defaults and the maximum size for a PDI

 exit
  • to use on reboot, modify /etc/init.d/knoppix-autoconfig.

modifying knoppix-autoconfig to use swap and/or PDI

  • Unfortunately, one has to do this each time at reboot.
{ cat <<"eof"
1059c1059
<     ext3|ext3|reiserfs|xfs) MOUNTOPTS="$MOUNTOPTS,noatime" ;;
---
>     ext2|ext3|reiserfs|xfs) MOUNTOPTS="$MOUNTOPTS,noatime" ;;
eof
} | patch /etc/init.d/knoppix-autoconfig

exit
  • one solution is to put the above commands into a script saved as /cdrom/knx402/knx.sh. Then once one enters emergency mode all one has to do is type:
/cdrom/knx402/knx.sh

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