Differences between revisions 2 and 3
Revision 2 as of 2005-02-20 02:35:02
Size: 3212
Editor: anonymous
Comment:
Revision 3 as of 2005-02-20 02:44:45
Size: 3339
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
*Sarge netinstall CD (ISO from here: http://cdimage.debian.org/pub/cdimage-testing/daily/i386/current/sarge-i386-netinst.iso )

Installing Debian on a laptop with only ["32MB"] of RAM and a usb drive.

I have just successfully got the Debian installer to run on an old Compaq Armada with only ["32MB"] of RAM... this is how:

What you need: *Sarge netinstall CD (ISO from here: http://cdimage.debian.org/pub/cdimage-testing/daily/i386/current/sarge-i386-netinst.iso ) *Usb port *Some kind of USB memory stick (I tried my worst case scenario - I used a ["16MB"] Sony Memory Stick in a USB card reader - it was a little slow, but it worked fine.

Boot off the CD, do linux26, then when it comes up it will warn you that you have a critically low amount of RAM and advise you to mount some swap ASAP.

As soon as you have chosen your language etc you can switch over to tty2 (with <Alt-F2>) and set up the USB swap...

If you left it a little while and went over to tty4 (<Alt-F4>) you would find that the syslog tail would show that the installer process was running out of memory, being killed and endlessly looping:

 Feb 20 01:48:57 anna["3278"]: DEBUG: resolver (lowmem): mark
 Feb 20 01:48:57 anna["3278"]: DEBUG: resolver (bugreporter-udeb): mark
 Feb 20 01:48:57 anna["3278"]: DEBUG: resolver (mkreiserfs-udeb): mark
 Feb 20 01:48:57 anna["3278"]: DEBUG: resolver (wireless-tools-udeb): mark
 Feb 20 01:49:29 init: ^["MProcess"] '/sbin/debian-installer' (pid 537) exited.  Scheduling it for restart.
 Feb 20 01:49:29 init: ^["MStarting"] pid 4653, console /dev/vc/1: '/sbin/debian-installer'

OK... the process... firstly... the Sarge netinstall doesn't create device files for your USB devices, so you have to make them yourself:

 mknod /dev/sda b 8 0
 mknod /dev/sda1 b 8 1

 modprobe usb-storage

I skipped the next step because I had fdisked the card, and done mkfs.ext3 on it first... but if you don't want to wipe your card:

 modprobe vfat
 mkdir /mnt
 mount /dev/sda1 /mnt

Then I made a shell script on the card using nano, and ran it:

 #
 echo "Calculating free disk space on /dev/sda1 ..."
 FREE=$(df /dev/sda1 || grep /dev/sda1 || cut -c 41-50)
 let COUNT=FREE-1
 #
 echo "Creating $COUNT block swapfile /mnt/swapfile ..."
 dd if=/dev/zero of=/mnt/swapfile bs=1024 count=$COUNT
 #
 echo "Making swap ..."
 mkswap /mnt/swapfile
 #
 echo "Mounting swap ..."
 swapon /mnt/swapfile

Then you will find you should have enough free memory that the installer will work :o)

You will notice here that I made the swapfile 1 block smaller than the available free space. That was so I had somewhere to save my shell script as I was writing it. You may just want to use the whole free space, or even the raw device.

Another box claimed back for Debian!

 #
 # To do it without using fdisk (slightly slower)
 #
 dd if=/dev/zero of=/mnt/swapfile bs=1024
 # -rw-r--r--    1 root     root     14561280 Feb 20 01:19 /mnt/swapfile
 SIZE=$(ls -l /mnt/swapfile||cut -c 30-43)
 let FULL=SIZE/1024
 let COUNT=FULL-1
 dd if=/dev/zero of=/mnt/swapfile bs=1024 count=$COUNT
 #

 # fdisk -l /dev/sda
  •  Disk /dev/sda: 16 MB, 16220160 bytes
     4 heads, 16 sectors/track, 495 cylinders
     Units = cylinders of 64 * 512 = 32768 bytes
        Device Boot      Start         End      Blocks   Id  System
     /dev/sda1   *           1         495       15832   83  Linux