Ellhniko Lilo mini-Howto

Cameron Spitzer (cls@truffula.sj.ca.us), Alessandro Rubini (rubini@linux.it). v2.1, 9 Ianoyarioy 1998

Ayto to arxeio deixnei merikous typikous tropoys egkatastashs toy LILO. Exei san stoxo na apotelesei symplhrwma toy egxeiridioy ”Odhgos twn xrhstwn toy LILO”. Pisteuw oti ta paradeigmata einai xrhsima akomh kai sthn periptwsh poy h egkatastash sas den tairiazei me th dikh moy. Elpizw oti ayto to keimeno 8a sas glitwsei apo mpelades. Mia kai h tekmhriwsh toy Lilo apo monh ths einai polu kalh, opoios endiaferetai gia leptomereies mporei na anatrejei sto /usr/doc/lilo*

Contents

1 Eisagwgh 1

2 Proapaitoumenes gnwseis kai typikh egkatastash 2

2.1 Poy 8a prepei na egkatasthsw to Lilo; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.2 Pws mporw na ry8misw toys IDE sklhrous diskoys moy; . . . . . . . . . . . . . . . . . . . . . 2

2.3 Pws mporw na epembw kata th diarkeia ths ekkinhshs; . . . . . . . . . . . . . . . . . . . . . . 3

2.4 Pws mporw na apegkatasthsw to Lilo; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 H aplh ru8mish 4

4 Egka8istwntas to hdc gia na jekinaei san hda 4

5 Xrhsimopoiwntas to Lilo otan to BIOS den mporei na dei to Root partition 5

6 Prosbash se terastias xwrhtikothtas diskoys otan den mporei to BIOS 6

7 Ekkinwntas apo mia disketa Diaswshs (Rescue Floppy) 7

8 Peri ths Ellhnikhs Metafrashs 8

1 Eisagwgh

Para to gegonos oti h tekmhriwsh poy bre8hke sta arxeia phgaioy kwdika toy Lilo (ayto poy egkatasta8hke sth /usr/doc/lilo ekdosh) einai polu katanohth, oi perissoteroi xrhstes Linux mporei na antimetwpisoyn dyskolies ean epixeirhsoyn na dhmioyrghsoyn to diko toys arxeio /etc/lilo.conf. Ayto to keimeno proorizetai sto na toys yposthrijei, dinontas tis aparaithtes plhrofories kai deixnontas pente paradeigmata egkatastashs:

• To prwto paradeigma einai apo thn klasikh egkatastash “To Linux kai oi Alloi”.

• To epomeno deixnei pws na egkatasthsete to Lilo se sklhro disko syndedemeno san /dev/hdc o opoios 8a arxizei san /dev/hda. Ayto xreiazetai synh8ws otan egkatasthsete ena neo disko Linux apo to diko sas diko sas trexwn susthma.

• To trito paradeigma deixnei pws na jekinhsete ena susthma Linux toy opoioy to root partition den einai prosbasimo apo to BIOS.

• To epomeno arxeio-deigma xrhsimopoieitai gia prosbash se diskoys megalhs xwrhtikothtas, stoys opoioys den exei prosbash oute to BIOS oute to DOS (ayto einai kata kapoio tropo aparxaiwmeno).

• To teleytaio paradeigma ejhgei pws na epidior8wsete ena xalasmeno disko (h katastrofh se ayth thn periptwsh dhmioyrgh8hke apo thn egkatastash enos allou leitoyrgikou systhmatos).

Ta teleytaia tria paradeigmata einai toy Cameron Spitzer, cls@truffula.sj.ca.us, o opoios egrace to arxiko keimeno. O trexwn synthrhths den trexei tipota allo ektos apo Linux, gi’ ayto to logo den mporw na ta elegjw oute na ta enhmerwsw.

2 Proapaitoumenes gnwseis kai typikh egkatastash

Otan to Lilo jekina to susthma, mporei na fortwsei mono data sectors poy mporoun na prospela8oun apo to bios. Opoiodhpote pathname balete sto /etc/lilo.conf ginetai resolved kata thn diarkeia ths egkatastashs (otan kaleitai to lilo). Ayto symbainei otan to programma xtizei kapoia lista pinakwn ths opoias ta sectors xrhsimopoiountai apo ta arxeia. San apotelesma, ta arxeia prepei na yparxoyn se ena partition poy na einai prosbasimo apo to BIOS. Epipleon, prepei na janaegkatasthsete to loader (p.x., prepei na janakaleite to lilo) ka8e fora poy tropopoieite ta arxeia. Opote janametaglwttisete ton pyrhna sas kai gracete panw apo to palio image, prepei na janaegkatasthsete to Lilo).

2.1 Poy 8a prepei na egkatasthsw to Lilo;

H ntirektiba boot = sto arxeio /etc/lilo.conf leei sto Lilo pou 8a prepei na topo8ethsei to primary boot loader. Genika, mporeite na epilejete eite to master boot sector (/dev/hda) eite to root partition ths Linux egkatastashs sas (synh8ws einai sto /dev/hda1 h sto /dev/hda2).

An exete allo leitoyrgiko susthma egkatesthmeno ston sklhro sas disko, 8a htan protimotero na egkatasthsete to Lilo sto root partition. Se ayth thn periptwsh, prepei na markarete to partition san ”bootable” (xrhsimopoihste thn entolh ”a” toy fdisk h thn entolh ”b” toy cfdisk. Ean den gracete panw apo to master boot sector, 8a einai pio eukolo na apegkatasthsete to Linux kai to Lilo an xreiastei.

2.2 Pws mporw na ry8misw toys IDE sklhrous diskoys moy;

Proswpika den xrhsimopoiw thn epilogh LBA h LARGE sto BIOS (alla egw trexw mono Linux). Ayta einai a8lioi periorismoi poy ofeilontai se sxediastika elattwmata toy kosmoy twn PC. Ayto apaitei oti o pyrhnas brisketai stoys prwtoys 1024 kylindroys, alla ayto den einai problhma oso kanete partition toys sklhrous sas kai kratate to root mikro (opws 8a eprepe na kanete etsi ki alliws).

An o sklhros sas diskos exei hdh ena allo leitoyrgiko susthma, den 8a mporesete na allajete tis ry8miseis toy BIOS, alliws to palio susthma den 8a doyleuei pia. Oles oi prosfates dianomes Lilo einai ikanes na xeiristoun LBA kai LARGE ry8miseis diskwn.

An exete perissoteroys apo enan sklhro disko kai merikoi apo aytous xrhsimopoiountai mono apo to Linux, alla oxi sthn ekkinhsh toy ypologisth, mporeite na dhlwsete sto BIOS sas oti den einai egkatasthmenoi. To susthma sas 8a jekinaei pio grhgora kai to Linux 8a anixneuei aytomata oloys toys diskoys se xrono mhden. Syxna syndew epipleon diskoys sto susthma moy, alla den allazw pote tis ry8miseis toy BIOS.

2.3 Pws mporw na epembw kata th diarkeia ths ekkinhshs;

Otan deite to Lilo prompt, mporeite na pathsete ta plhktra <Tab> gia na deite th lista me tis pi8anes epiloges. An to Lilo den einai ry8mismeno na einai interactive, krathste pathmeno to plhktro <Alt> h <Shift> prin emfanistei to mhnyma “LILO” .

An dialejete na ekkinhsete enan pyrhna Linux, mporeite na pros8esete parametroys sth grammh entolwn meta apo to onoma toy systhmatos poy epilejate. O pyrhnas dexetai polles parametroys sth grammh entolwn, alla den einai to katallhlo meros gia na tis para8esoyme edw. Kata thn gnwmh moy, merikes apo aytes einai idiaitera shmantikes:

• root=: mporeite na peite ston pyrhna toy Linux na kanei mount san root ena diaforetiko partition apo Ayto poy emfanizetai sto lilo.conf. Gia paradeigma, exw ena polu mikro partition poy filojenei mia epishs polu mikrh Linux egkatastash, kai etsi katafera na jekinhsw to susthma otan katestreca kata la8os to root partition moy.

• init=: h ekdosh 1.3.4 kai newteres toy pyrhna toy Linux dexontai ton ka8orismo apo th grammhentolwn enos programmatos poy ekteleitai anti gia to /sbin/init. An synanthsete dyskolies kata thn diarkeia ths diadikasias ekkinhshs, mporeite na exete prosbash sto susthma ka8orizontas to init=/bin/sh (otan eiste sto shell prompt pi8ana na xreiasteite na kanete mount toys diskoys sas: doki-

     maste to “/sbin/mount -w -n -o remount /; mount -a”, kai 8ymh8eite na kanete “/sbin/umount

-a” prin kleisete ton hlektroniko sas ypologisth).

• Enas ari8mos: dinontas enan ari8mo sthn grammh entolwn toy pyrhna dinetai entolh sto init na jekinhsei se ena sygkekrimeno run-level (to default einai synh8ws 3). Anafer8eite sthn tekmhriwsh toy init , sto /etc/inittab kai sto /etc/rc.d gia na synexisete peraiterw.

2.4 Pws mporw na apegkatasthsw to Lilo;

Otan to Lilo grafei panw apo to boot sector, krata ena antigrafo toy asfaleias sto /boot/boot.xxyy, opoy xxyy einai oi elaxistoi kai megistoi ari8moi ths syskeyhs, se dekaejadikh morfh. Mporeite na deite toys elaxistoys kai megistoys ari8mous toy diskoy h toy partition sas ektelwntas thn “ls -l /dev/device”. Gia paradeigma, to prwto sector toy /dev/hda (megisto 3, elaxisto 0) 8a sw8ei sto /boot/boot.0300, egka8istwntas to Lilo sto /dev/fd0 dhmioyrgei to /boot/boot.0200 kai egka8istwntas to sto /dev/sdb3 (megisto 8, elaxisto 19) dhmioyrgei to /boot/boot.0813. Shmeiwste oti to Lilo de 8a dhmioyrghsei to arxeio an yparxei hdh ena. De xreiazetai na anhsyxeite gia antigrafo asfaleias ka8e fora poy egkatasteite to Lilo (gia paradeigma, afou janametaglwttisete ton pyrhna sas).

An pote xreiastei na apegkatasthsete to Lilo (gia paradeigma, sthn atyxh periptwsh poy xreiazetai na apegkatasthsete to Linux), to mono poy xreiazetai einai na epanaferete to arxiko boot sector. An

to Lilo einai egkatasthmeno sto /dev/hda, aplws gracte “dd if=/boot/boot.0300 of=/dev/hda bs=446

count=1” (proswpika grafw “cat /boot/boot.0300 > /dev/hda”, alla den einai toso asfales, ka8ws Ayto 8a epanaferei kai to arxiko partition table , to opoio mporei na to exete tropopoihsei sto metaju). Ayth h entolh einai polu pio eukolo na ektelestei para na prospa8hsete to “fdisk /mbr” apo ena kelyfos DOS: sas epitrepei na afairesete to Linux apo ena disk xwris na xreiastei na ekkinhsete allo leitoyrgiko. Afou afairesete to Lilo, 8ymh8eite na trejete to fdisk toy Linux gia na diagracete o,ti Linux partition exete (to fdisk toy DOS den mporei na diagracei non-dos partitions).

An exete egkatasthsei to Lilo sto root partition sas (p.x., /dev/hda2), de xreiazetai na kanete tipota to idiaitero gia na apegkatasthsete to Lilo. Apla trejte to fdisk toy Linux gia na diagracete ta Linux partitions apo to partition table. Epishs, prepei na markarete to DOS partition san bootable.

3 H aplh ru8mish

Oi perissoteres egkatastaseis toy Lilo xrhsimopoioun ena arxeio ry8misewn san ton epomeno:

boot = /dev/hda   # or your root partition
delay = 0         # or specify a delay in tenth of a second
vga = 0           # optional. Use "vga=1" to get 80x50
image = /boot/vmlinux  # your zImage file
  root = /dev/hda1     # your root partition
  label = Linux        # or any fancy name
  read-only            # mount root read-only
other = /dev/hda4   # your dos partition, if any
  table = /dev/hda  # the current partition table
  label = dos       # or any non-fancy name

Mporeite na pollaplasiasete, an 8elete, ta tmhmata “image” kai “other”. Den einai asynh8isto na exete ry8misei arketa kernel images stolilo.conf , eidika an symbadizete me toys prosfatoys pyrhnes ypo anaptyjh.

4 Egka8istwntas to hdc gia na jekinaei san hda

To Lilo sas epitrepei na kanete map to image toy pyrhna apo ena disko kai na dwsete entolh sto BIOS na to anakta apo diaforetiko disko. Gia paradeigma, einai koinotopo gia mena na egkatasthsw to Linux se ena disko ston opoio syndeomai sto hdc (master diskos toy deuteroy controller) kai na to ekkinhsw san standalong susthma ston primary IDE controller enos alloy ypologisth. Antegraca thn disketa egkatastashs se ena mikroskopiko partition, wste na mporw na ektelw to chroot se mia virtual konsola gia na egkatasthsw to hdc enw xrhsimopoiw to susthma gia kati allo.

To arxeio lilo.conf poy xrhsimopoiw gia na egkatasthsw to Lilo moiazei me:

# This file must be used from a system running from /dev/hdc
boot = /dev/hdc   # overwrite MBR of hdc
disk = /dev/hdc   # tell how hdc will look like:
   bios = 0x80    #  the bios will see it as first drive
delay = 0
vga = 0
image = /boot/vmlinux  # root partition is /dev/hdc1
  root = /dev/hda1         # hdc1 at boot will be hda1
  label = Linux
  read-only

Ayto to arxeio ru8mishs prepei na diabastei apo ena Lilo poy brisketai sto /dev/hdc1. Oi apeikoniseis toy Lilo poy grafthkan sto boot sector (/dev/hdc) prepei na sebastei ta antigrafa toy vmlinux kai toy /boot/boot.b ta opoia 8a einai dia8esima kata th diarkeia ekkinhshs, p.x., ta antigrafa sto hdc.

Onomazw Ayto to arxeio ru8mishs /mnt/etc/lilo.conf.hdc kai egka8istw to Lilo kalwntas to “cd /mnt;

chroot .  sbin/lilo -C /etc/lilo.conf.hdc” ka8ws to /dev/hdc1 exei ginei mount katw apo to /mnt.

5 Xrhsimopoiwntas to Lilo otan to BIOS den mporei na dei to Root partition

Exw dyo diskoys IDE, kai enan disko SCSI. To BIOS den mporei na dei to SCSI disko moy. O Linux Loader, to Lilo, xrhsimopoiei klhseis toy BIOS kai mporei na dei diskoys poy mono to BIOS mporei na dei. To koyto AMI BIOS moy 8a jekinhsei mono apo to ”A:” h to ”C:”. To root susthma arxeiwn moy einai ena partition sto SCSI disko.

H lush egkeitai sthn apo8hkeysh toy pyrhna, toy arxeioy apeikonishs (map file), kai toy chain loader se ena Linux partition sto prwto IDE. Shmeiwste oti den einai aparaithto na kratate to pyrhna sas sto root parition sas.

To deutero parition toy prwtoy IDE diskoy moy (/dev/hda2, to Linux parition poy xrhsimeye gia thn ekkinhsh toy systhmatos) einai mounted sto /u2. Parakatw akoloy8ei to arxeio /etc/lilo.conf poy xrhsimopoiw.

#  Install LILO on the Master Boot Record
#  on the first IDE.
#
boot = /dev/hda
#  /sbin/lilo (the installer) copies the LILO boot record
#  from the following file to the MBR location.
install = /u2/etc/lilo/boot.b
#
#  I wrote a verbose boot menu.  LILO finds it here.
message = /u2/etc/lilo/message
#  The installer will build the following file. It tells
#  the boot-loader where the blocks of the kernels are.
map = /u2/etc/lilo/map
compact
prompt
#  Wait 10 seconds, then boot the 1.2.1 kernel by default.
timeout = 100
#  The kernel is stored where BIOS can see it by doing this:
#      cp -p /usr/src/linux/arch/i386/boot/zImage /u2/z1.2.1
image = /u2/z1.2.1
        label = 1.2.1
#  LILO tells the kernel to mount the first SCSI partition
#  as root.  BIOS does not have to be able to see it.
        root = /dev/sda1
#  This partition will be checked and remounted by /etc/rc.d/rc.S
        read-only
#  I kept an old Slackware kernel lying around in case I built a
#  kernel that doesn't work.  I actually needed this once.
image = /u2/z1.0.9
        label = 1.0.9
        root = /dev/sda1
        read-only
#  My DR-DOS 6 partition.
other = /dev/hda1
        loader=/u2/etc/lilo/chain.b

        label = dos
        alias = m

6 Prosbash se terastias xwrhtikothtas diskoys otan den mporei to BIOS

To susthma sto xwro ergasias moy exei IDE disko xwrhtikothtas 1GB. To BIOS mporei na ’dei’ mono ta prwta 504 MB toy IDE. (opoy MB shmainei 2**10 bytes, kai oxi 10**6 bytes). Etsi exw ena MS-DOS partition twn 350 MB /dev/hda1 kai to Linux root moy se ena partition 120 MB /dev/hda2.

To MS-DOS den mporouse na egkatasta8ei mono toy swsta otan o diskos htan kainourios. To Novell DOS 7 eixe to idio problhma. Eytyxws gia mena, h IBM jexase na balei thn disketa ”OnTrack” sto koyti mazi me to disko. O diskos ypoti8etai oti 8a erxotan mazi me ena proion me thn onomasia ”OnTrack Disk Manager.” An exete mono MSDOS, mallon 8a prepei na to xrhsimopoihsete.

Gi’ ayto to logo eftiaja ena partition table me to fdisk toy Linux. To MSDOS-6.2 arniotan na egkatasta8ei mono toy sto /dev/hda1. Elege kati san “ayth h ekdosh toy MS-DOS einai gia nees egkatastaseis. O ypologisths sas exei hdh to MS-DOS gia Ayto xreiazetai na promh8eyteite mia pio ananewmenh ekdosh apo ton promh8eyth sas.” Sthn pragmatikothta, o diskos htan olokainoyrgos.

Ti blakeia! Etsi etreja to fdisk toy Linux kai diegraca to partition 1 apo to table. Ayto ikanopoihse to MS-DOS 6.2 to opoio proxwrhse gia na dhmioyrghsei ena oloidio partition 1 san Ayto poy eixa molis diagracei kai to opoio to eixe egkatasthsei to idio. To MS-DOS 6.2 egrace to diko toy Master Boot Record sto disko, parolayta den mporouse na jekinhsei.

Eytyxws eixa ena pyrhna Slackware se mia disketa (dhmioyrghmeno apo to programma egkatastashs toy Slackware ”setup”) kai etsi jekinhsa to Linux kai egraca to LILO panw apo to katestrammeno MBR toy MS-DOS. Doulece. Ayto einai to arxeio /etc/lilo.conf poy xrhsimopoihsa:

boot = /dev/hda
map = /lilo-map
delay = 100
ramdisk = 0             # Turns off ramdisk in Slackware kernel
timeout = 100
prompt
disk = /dev/hda         # BIOS only sees first 500 MB.
   bios = 0x80          # specifies the first IDE.
   sectors = 63         # get the numbers from your drive's docs.
   heads = 16
   cylinders = 2100
image = /vmlinuz
  append = "hd=2100,16,63"
  root = /dev/hda2
  label = linux
  read-only
  vga = extended
other = /dev/hda1
  label = msdos
  table = /dev/hda
  loader = /boot/chain.b

Afotoy egkatesthsa ayta ta systhmata, epalh8eysa oti to partition poy periexei ta zImage, boot.b, map, chain.b kai arxeia mhnymatwn mporei na xrhsimopoihsei ena susthma arxeiwn msdos, me thn proupo8esh oti den exei sympiestei o diskos me kapoio programma ”stacker” h ”doublespace”. Etsi 8a mporousa na exw to DOS partition sto /dev/hda1 me 500 MB.

Epishs, ema8a oti to ”OnTrack” 8a mporouse na eixe gracei ena partition table poy na arxizei meta apo merikes dekades bytes apo thn arxh toy diskoy, anti gia thn arxh toy, kai pws einai dynaton na ”peirajeis” ton odhgo toy Linux gia IDE wste na jeperasei ayto to problhma. Alla h egkatastash 8a htan adunath xwris ton prometaglwttismeno pyrhna Slackware. Telika, h IBM moy esteile mia disketa ”OnTrack”. Kalesa thn texnikh yposthrijh ths OnTrack. Moy eipan pws to Linux xalase giati den xrhsimopoiei to BIOS. Telika petaja thn disketa toys!

7 Ekkinwntas apo mia disketa Diaswshs (Rescue Floppy)

Sth synexeia, egkatesthsa ta Windows-95 sto susthma toy grafeioy moy. Ejafanise to wraio LILO MBR moy, alla afhse ta Linux partitions moy apeiraxta. Oi pyrhnes pairnoyn polu wra na fortw8oun apo disketa, kai etsi ekana mia disketa me ena LILO panw ths, to opoio ekkinouse ton pyrhna moy apo ton IDE.

Eftiaja th LILO disketa moy ws ejhs:

  fdformat /dev/fd0H1440      #  lay tracks on virgin diskette
  mkfs -t minix /dev/fd0 1440 #  make file system of type minix
  mount /dev/fd0 /mnt         #  mount in the standard tmp mount point
  cp -p /boot/chain.b /mnt    #  copy the chain loader over
  lilo -C /etc/lilo.flop      #  install LILO and the map on the diskette.
  umount /mnt

Shmeiwste pws h disketa prepei na exei ginei mounted otan trexete ton installer etsi wste na mporei to Lilo na gracei to map arxeio toy kanonika.

To arxeio einai to /etc/lilo.flop. Einai peripoy san to teleytaio:

#  Makes a floppy that can boot kernels from HD.
boot = /dev/fd0
map = /mnt/lilo-map
delay = 100
ramdisk = 0
timeout = 100
prompt
disk = /dev/hda     # 1 GB IDE, BIOS only sees first 500 MB.
   bios=0x80
   sectors = 63
   heads = 16
   cylinders = 2100
image = /vmlinuz
  append = "hd=2100,16,63"
  root = /dev/hda2
  label = linux
  read-only
  vga = extended
other = /dev/hda1
  label = msdos
  table = /dev/hda

  loader = /mnt/chain.b

Telos, xreiasthka MS-DOS 6.2 sto susthma toy grafeioy moy, alla den h8ela na peirajw ton prwto disko moy. Pros8esa enan SCSI controller kai ena disko, eftiaja ena susthma arxeiwn msdos panw toy me thn entolh toy Linux mkdosfs, kai ta Windows-95 to blepoyn ws ”D:”. Alla fysika to MSDOS den mporei na jekinhsei apo to D:. Ayto den apotelei problhma otan exete LILO. Pros8esa ta akoloy8a sto lilo.conf toy Paradeigmatos 2.

other = /dev/sda1
  label = d6.2
  table = /dev/sda
  loader = /boot/any_d.b

Me aythn thn tropopoihsh, to MSDOS-6.2 trexei kai pisteuei pws einai sto C: kai pws ta Windows-95 briskontai sto D:.

8 Peri ths Ellhnikhs Metafrashs

Gia sxolia, parathrhseis, dior8wseis, enhmerwseis peri ths Ellhnikhs metafrashs aytou toy HOWTO, steilte email sthn Boula Sanida : voulariba@hellug.gr h ston Eyripidh Papakwsta : evris@hellug.gr kai enal-

laktika : ep@rocketmail.com