Thursday, October 11, 2012

Starting the Linux from network

debootstrap –arch i386 wheezy /mnt/hdd5/32/wheezy http://ftp.bg.debian.org/debian
debootstrap –arch i386 oneiric /mnt/hdd5/32/oneiric http://archive.ubuntu.com/ubuntu/
chroot /wheezy
apt-get install linux-image-3.0.0-1-486
edit: initramfs.conf
BOOT=nfs
mkinitramfs -o initrd.img.netboot 3.0.0-1-486
edit: /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
iface eth0 inet manual
Adding a swap file
In case you do need or want to set up a swapfile, here’s what I did to get one working:
sudo apt-get install dphys-swapfile
this package sets up a swap file at /var/swap that is 2x your current ram. however, it still doesn’t setup the swapfile on its own, though it does try. to get the swap file working the rest of the way, do:
sudo losetup /dev/loop0 /var/swap
sudo swapon /dev/loop0
then, run top and you will see you have a swap file. however, put in as much ram as you need for what you are going to run, and just look at your swap file as “in case of emergency”, because it is not efficient as a ram or a regular swap file, but should keep something from crashing. I’m running mythtv on top of a full feisty desktop, and tried it with 256mb ram, and myth-frontend would crash when i would try to bring it up. with the swap file, it would launch, but would take a while. i added an additional 256mb to bring the total to 512mb and it runs flawless, and i add the swap file just in case. i just make a script for it to set up the swap file at boot.