john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

small linux lilo fdisk

02feb05 after 2 weeks of work.

DISCLAIMER
This worked for me (after many tries and much frustration) but 
I don't know what it will do for you.  Moreoever, I'll try to
give exact commands and then hopefully you'll be able to 
replace my specific parameters (e.g. hda2) with whatever yours
might be (hdb3, hdb4, fd0, etc.)
Options for commands can often be learned by just typing in the
command with no paramaters:
fdisk
mke2fs
mkswap
e2fsck
Or, if someone is really on the ball, you might have luck with
man fdisk
or man e2fsck
where you'd get to read a "manual" of sorts.
Try to get the basic vi text editor commands written down because
it's not very intuitive and is necessary to edit configuration
files.
------------------------------------------------------------------
EXCERPT FROM LEVI WALDRON
http://www.superant.com/cgi-bin/smalllinux.pl?Small_Linux_Notes_By_Levi_Waldron
"8)Edit lilo.conf. NOTE!!! If you type vi lilo.conf, SL actually runs 
a tiny editor called e3. It doesn't actually identify itself as such, 
so I could not figure out why standard vi commands like :wq would not 
exit me, and I couldn't figure out how to get help. I ended up 
shutting off the computer to get out which was a pain because SL 
doesn't have fsck to fix up the hard drive after doing this. Upon 
rebooting, I check the symbolic links and found that vi actually 
started e3, then found an instruction manual for e3. e3 is easy to use, 
if you just type e3 without a filename the first time and write down a few of 
its key commands, for example ctrl-k-x to save and exit or ctrl-k-q 
to abort and exit."


Download "Small Linux"
Install rawwrite (for windows to write onto floppies as linux)
Write the two images: boot.img and root.img

At first when prompted what to type in with special boot options
and stuff, just ignore it and hit enter (or hit F1, I dare you).

The Boot disk will load a kernel and prepare the RAM disk virtual
space where you can store files and such.  Then you'll be prompted
to put in...
The Root disk actually contains the settings files (lilo.conf etc.)
and the binaries (/bin) and special devices (/dev) that you will
need to have a "normal" linux installation.

Once you are at the login prompt just type "root" and press enter.
Now, if you have a hard drive (with at least 40 megabytes) or a
partition that you want to migrate to (install linux on) then 
you've got to prepare it with the following steps.

Use fdisk to create a linux partition(s).
    fdisk /dev/hda      (or wherever your HD space is)
in fdisk you'll want to press 'm' at least once to get help and
read the command list.  
'm' = help / print command list
'p' = print current partition table information
'd' = prompts you to delete a partition - use very carefully
'n' = allows you to create a new partition - you will be prompted
    for exactly how much space to use - if you just hit enter
    it will use the defaults (as much as possible).
't' = alters a partition once it's been created - you'll be given
    an option to 'L'ist all the possible types (yes, there are
    quite a few ways to format empty space) - you'll probably
    be creating a Linux Native Partition (#83 I think) and a
    Linux Swap Partition (#82).  

'w' = write and save the changes (when you're sure)
'q' = quit without saving the changes (better safe than sorry)

NOTE:   Swap is basically a garuanteed free space where the computer
    can store things while it's working (when registers are full
    stuff is put in cache, when cache is full stuff is put in
    RAM, when RAM is full 'virtual ram' or swapfiles or swap
    partitions are used.

    Linux generally uses a swap partition, or a specifically 
    created area with it's own uncrossable borders, because 
    it's safer than having a swapfile in the same partition 
    with your data (where the cpu could have them accidentally
    collide aka crash) and of course you have less to clean up 
    or keep track of it on boot up or shutdown.

    Windows uses a swapfile (virtual memory).  
    The recommended size is about twice your RAM (or ~128 MB)
    but you can make it any size you want or even do without.

    After you're done you'll probably want to restart (and yes
    boot up from the two floppies) so that the Master Boot 
    Record and whatever other Hard Drive gods there are make
    good on all your fdisk-ing.

    Now, you will have to run mkfs.ext2 or mke2fs or something
    like that to format your new Linux Partition into a usable
    Linux Partition.  (Similar to formatting it as a FAT, FAT16,
    FAT32 or any other Dos or Windows partition before use.)

    mke2fs /dev/hda2

    Then you'll use mkswap on the swap partition to format it.

    mkswap /dev/hda3

    Now's a good time to run your filesystem checking program:
    e2fsck /dev/hda2
    And hopefully everybody's happy.  (You may have to try 
    e2fsck -f /dev/hda2 to force the program to check it.)

    Now, for moving in.  You'll start with:
    mount /dev/hda2 /mnt    
    or mount /dev/hda2 /hd
    or mount /dev/hda2 /fl
    (Basically saying get ready to use the device harddrive
    partition 2 and when I want to access it I'll use the 
    special folder /mnt or /hd or /fl.)  Yes, /fl looks like
    it should be used for floppies but whatever.

    You could also try 
    swapon /dev/hda3
    If it works you'll have working swap (necesssary?).

    (for moving around you can use cd directoryname and
    cd .. to back up the file tree).

    Go to the root (the starting point of all directories):
    cd /

    Now try copying all the goodies to your hd:
    cp -a /* /mnt
    (Which says copy, all options included, from the root
    which was created on our Ramdisk by these wonderful
    floppies, all the files into our newly mounted/formatted
    linux partition.)   

    You'll probably not get through everything because 
    some file/folder will be unhappy (hopefully your floppy
    disk or hard disk don't have bad sectors).  You can
    then proceed to finish up manually.
    mkdir /mnt/var
    cp -a /var/* /mnt/var
    (Makes the var directory on the mounted hd and copies,
    again with recursion and other good options, everything
    from /var onto your hard drive folder.)
    Things that ought to be on the hard drive:
    /bin    /etc    /dev    /sbin   /lib    /boot?
    /usr    /tmp    /proc   

    Once you are done copying and you've hopped back and
    forth and made sure lots of files (all?) were copied
    we test it by typing in
    reboot
    (which reboots the machine, with the boot disk still in!)
    When you're at the 
    boot:   
    prompt you should type in: linux root=/dev/hda2
    (the additional load_ramdisk = 0 is only if you have 
    less than 4MB RAM)

    Hopefully you will not be prompted for anymore floppies,
    your HD will buzz and you'll be using your HD for the root.
    (1/2 way there!)
    If not, well maybe try checking that enough files were
    copied over from the "root" floppy (which may mean booting
    like we did at the very beginning).

    Now,
    mount /dev/fd0 /fl
    gets us access to our boot floppy.
    cp /fl/* /boot
    Should copy everything from the boot floppy into the /boot
    directory on your hard drive.
    cd /etc
    vi lilo.conf
    These commands take you to your linuxloader configuration
    file so that you can edit it.  Vi is a text editor that can
    be tricky at first - you'll hopefully have read some about it.

    My extra simple lilo.conf looked like this:

    boot = /dev/hda
    map = /boot/system.map      
    install = boot/boot.b
    timeout = 1
    vga = normal

    image = /boot/linux
        root = /dev/hda2
        label = linux
        read-write

    NOTE: I've probably lost access to my Windows partition
    (/dev/hda1) until I figure out the tortuous dual booting
    dilemma BUT I can now boot linux completely from my HD.

2/2/05  NEXT: ADDING MORE FILES TO THE SYSTEM VIA THE FLOPPY DRIVE
    SO THAT I CAN ACCESS THE NET (AND SKIP THE RAWWRITE STEPS).



  • « random integer distribution
  • Debian 5 install on windows xp machine dualboot cross browse »

Published

Feb 2, 2005

Category

linux

~1305 words

Tags

  • fdisk 2
  • installs 41
  • lilo 2
  • linux 249
  • small 1