Discos de Arranque Linux COMO Tom Fawcett (fawcett@croftj.net) Traducido: Álvaro Alea (aleasoft@geocites.com) v3.3, Noviembre 1998,Traducido:v0.1alpha ,26 de Diciembre de 1998 Este documento describe como diseñar y construir su propio disco de arranque/root para Linux. Estos discos pueden ser usados como discos de rescate o para comprobar nuevos componentes del sistema. Si no ha leído el FAQ Linux y los documentos relacionados, como Instalación de Linux COMO y la Guia de Instalación de Linux, no debería de intentar construir discos de arranque. Si solo desea un disco de rescate para emergencias, consulte el Apéndice ``Discos de arranque precreados''. ______________________________________________________________________ Índice general 1. Prefacio. 1.1 Notas sobre versiones. 1.2 Realimentación y créditos. 1.3 Política de distribución. 2. Introducción. 3. Discos de Arranque y el proceso de arranque. 3.1 El proceso de arranque. 3.2 Tipos de discos. 4. Construcion de un sistema de ficheros raiz. 4.1 Prologo. 4.2 Crear un sistema de ficheros. 4.3 Rellenar el sistema de ficheros. 4.3.1 /dev 4.3.2 /etc 4.3.3 /bin y /sbin 4.3.4 /lib 4.4 Particularidades para PAM y NSS. 4.4.1 PAM (Pluggable Authentication Modules). 4.4.2 NSS (Name Service Switch). 4.5 Modulos. 4.6 Algunos detalles finales. 4.7 Wrapping it up.(Juntadolo todo) 5. Elegir un kernel. 6. Poniendolo todo junto: Creacion del disco(s). 6.1 Transferir el kernel con LILO 6.2 Transferring the kernel without LILO. 6.3 Setting the ramdisk word. 6.4 Transferring the root filesystem. 7. Troubleshooting, or The Agony of Defeat. 8. Miscellaneous topics. 8.1 Reducing root filesystem size. 8.2 Non-ramdisk root filesystems. 8.3 Building a utility disk. 9. How the pros do it. 10. Frequently asked question (FAQ) list. 11. Resources and pointers 11.1 Pre-made bootdisks. 11.2 Rescue packages. 11.3 Graham Chapman's shell scripts 11.4 LILO -- the Linux loader. 11.5 Linux FAQ and HOWTOs. 11.6 Ramdisk usage. 11.7 The Linux boot process. 12. LILO boot error codes. 13. Listado de ejemplo de directorios del disco root. 14. Listado de ejemplo de directorios del disco utilidades. ______________________________________________________________________ 11.. PPrreeffaacciioo.. NNoottaa:: eessttee ddooccuummeennttoo ppuueeddee eessttaarr aannttiiccuuaaddoo.. Si la fecha de la pagina de titulo tiene mas de seis meses, por favor consulte la pagina del Proyecto de Documentación de Linux para comprobar si existe una versión mas reciente. Aunque este documento debería ser legible en modo texto, se vera _m_u_c_h_o mejor en Postscript (.ps) o HTML debido a la notación tipográfica utilizada . Recomendamos elegir uno de estos formatos. La versión Info, cuando esto se escribió, resultaba defectuosa e ilegible. 11..11.. NNoottaass ssoobbrree vveerrssiioonneess.. Graham Chapman (grahamc@zeta.org.au) escribi'o el Disco de Arranque COMO original y lo mantuvo hasta la versión 3.1. Tom Fawcett (fawcett@croftj.net) añadio un montón de material para el kernel 2.0, y es el mantenedor del documento hasta la versi'on 3.2, Una gran parte del material original de CHapman permanece en el documento. Este documento esta indicado para KKeerrnneell ddee LLiinnuuxx 22..00 yy ppoosstteerriioorreess. Si tiene un Kernel antiguo (1.2.xx o anterior), por favor, consulte versiones anteriores del Disco de Arranque COMO almacenadas en Graham Chapman's homepage . Esta información esta dirigida a Linux en plataformas IInntteell. Una gran parte de esta información puede ser aplicable a Linux en otros procesadores, pero no tenemos experiencia de primera mano o información sobre esto. SI alguien tiene experiencia con discos de arranque para otras plataformas, por favor que contacte con nosotros. 11..22.. RReeaalliimmeennttaacciióónn yy ccrrééddiittooss.. Agradecemos cualquier realimentación, buena o mala, sobre el contenido de este documento. Ponemos todo nuestro empeño en que las instrucciones e información de este documento sean precisas y fiables. Por favor, hagon conocer si encuentra errores u omisiones. Agradecemos a mucha gente que nos asistió con correcciones y sugerencias. Han contribuido a crear un documento mucho mejor de lo que pudiera haber echo solo. Envié comentarios, correcciones y cuestiones al autor a la direcion de correo electrónico superior. No tengo pensado responder cuestiones, pero por favor lea antes la seccion ``Problemas''. 11..33.. PPoollííttiiccaa ddee ddiissttrriibbuucciióónn.. Copyright © 1995,1996,1997,1998 por Tom Fawcett y Graham Chapman. Este documento puede ser distribuido bajo los terrinos indicados en la licencia de Proyecto de documentación de Linux en . Por favor, contacte con los autores si no puede obtener una copia de la licencia. Esto es docuementacion libre. Puede ser con la esperanza de que sea útil, pero sin nniinngguunnaa ggaarraannttííaa; sin garantías derivadas de mmeerrcchhaannttaabbiilliittyy o ffiittnneessss ppaarraa uunn pprrooppóóssiittoo ppaarrttiiccuullaarr. 22.. IInnttrroodduucccciióónn.. Los discos de arranque de Linux son útiles en un gran numero de ocasiones, como: · Comprobar un nuevo Kernel. · Recuperaciones de un fallo de disco, cualquier cosa desde una perdida del sector de arranque hasta un fallo de las cabezas del disco. · Arreglar un sistema inutilizado. Un pequeño error como root puede llevar a que su sistema sea inutilizarle, y puede arrancar desde disco para solucionarlo. · Actualizaciones criticas de sistemas de ficheros, como es libc.so. Hay varias maneras de obtener un disco de arranque: · Usar uno de una distribución como slackware. Esto le permitir'a por lo menos arrancar. · Usar un paquete de rescate para crear discos diseñados para ser usados como discos de rescate. · Aprender que es necesario para cada uno de los tipos de disco a utilizar, y crear uno propio. Alguna gente elige la ultima opci'on y lo crean ellos mismos. Esta manera, puede traer complicaciones, y deben conseguir solucionarlas. Adem'as es una gran manera de aprender sobre como trabaja un sistema Linux. Este documento asume cierta familiaridad b'asica con los conceptos de administraci'on de sistemas Linux. Por ejemplo, deber'ia saber que son directorios, sistemas de ficheros y discos. Deber'ia adem'as saber usar mount y df. Que son los ficheros /etc/passwd y fstab para que sirven y porque son as'i. Adem'as deber'ia tener conciencia de que la mayor'ia de los comandos de este COMO deben ser ejecutados como root. Construir su propio disco de arranque desde cero puede ser complicado. SI no ha le'ido el FAQ de Linux y los documentos asociados, como el Linux Instalaci'on COMO y la Guia de Instalaci'on de Linux, no deber'ia de tratar de construir discos de ararque. Si solo necesita un disco de arranque que funcione para emergencias, es _m_a_s f'acil descargar uno prefabricado, consulte el Ap'endice id="distbootdisks" name="Discos de Arranque Pre-creados"> mas adelante para saber donde encontrar estos. 33.. DDiissccooss ddee AArrrraannqquuee yy eell pprroocceessoo ddee aarrrraannqquuee.. UN disco de arranque es b'asicamente un sistema Linux en miniatura contenido en el disco . Puede realizar la mayor'ia de las funciones de un sistema Linux completo. Antes de tratar de construir uno debeira comprender el proceso b'asico de arranque de Linux. Le mostraremos lo b'asico aqu'i, que sera suficiente para comprender el resto del documento. Muchos detalles y opciones alternativas han sido omitidos. 33..11.. EEll pprroocceessoo ddee aarrrraannqquuee.. Todos los sistemas PC comienzan el arranque ejecutando c'odigo en la ROM, (espec'ificamente , la BIOS) para cargar el sector del sector 0, cilindro 0 de la primera unidad de disco. la unidad de arranque es normalmente la primera unidad de disco flexible ( nombrada A: en DOS y /dev/fd0 en Linux). La BIOS intenta ejecutar en ese momento el sector. En muchos discos Arrancables el sector 0, cylinder 0 contiene: · c'odigo del cargador de arranque como LILO, que sit'ua el kernel, lo carga, y ejecuta el comienzo adecuado. · El comienzo de un kernel de sistema operativo, como es Linux. Si un kernel de Linux ha sido copiado "a pelo" a un disco, el primer sector del disco contendr'a el primer sector del kernel de Linux en si. Este primer sector continuara el proceso de arranke cargando el resto del kernel desde el dispositivo de arranque. Una vez el kernel este completamente cargado, este ira a trav'es de una serie de inicializaciones b'asicas de dispositivos. Tratara de cargar y montar un ssiisstteemmaa ddee ffiicchheerrooss rraa''iizz de alg'un dispositivo. UN sistema de ficheros ra'iz es simplemente un sistema de ficheros que es montado como ``/''. El kernel tiene que saber donde buscar el sistema de ficheros ra'iz; si no puede encontrarlo, se detendr'a. En algunas situaciones de arranque -- normalmente cuando arrancamos desde disco -- el sistema de ficheros ra'iz sera cargado en un ddiissccoo-- rraamm, que es RAM a la que el sistema accede como si fuese un disco. Hay dos razones por las que el sistema carga un disco-ram. Primera, la RAM es varios ordenes de magnitud mas r'apida que un disco de arranque, por lo que el sistema funciona mas r'apido; y segundo, el kernel puede cargar un ssiisstteemmaa ddee ffiicchheerrooss ccoommpprriimmiiddoo desde el disco y descomprimirlo en el disco-ram, permitiendo que entren mas ficheros en el disco. Una vez que el sistema de ficheros ha sido cargado y montado, deber'ia ver un mensaje como este: VFS: Mounted root (ext2 filesystem) readonly. En este momento en sistema busca el programa init en el sistema raiz (en /bin o /sbin) y lo ejecuta. init lee el fichero de configuracion /etc/inittab, mira la linea que define sysinit, y ejecuta el script nombrado. El script sysinit es normalmente algo como /etc/rc o /etc/init.d/boot. Este script es un conjunto de comandos que configurarn los servicios basicos del sistema, como: · Ejecutar fsck en todos los discos, · Cargar los modulosdel kernel necesarios, · Activar la memoria de intercambio, · Iniciar la red, · Montar los discos mencionados en fstab. Este script normalmente invoca varios otros scripts para realizar una inicializacion modular. Por ejemplo, es comun en la estructura SysVinit, el directorio /etc/rc.d/ conteniendo una compleja estructura de subdirectorios. NO obstante en un disco de aranque el script sysinit es a menudo muy simple. Cuando el script sysinit termina, devuelve el control a init, que entonces entra en el _n_i_v_e_l _d_e _e_j_e_c_u_c_i_o_n _p_o_r _d_e_f_e_c_t_o, especificado en inittab con la palabra clave initdefault. La linea del nivel utilizado espeficica un programa como getty, que es responsable de manejar la comunicacion con la consola y los terminales. Es el programa getty> el que imprime el familiar ``login:''. EL programa getty invoca a su vez el programa login para encargarse de la comprobacion de login y configurar la sesion del usuario. 33..22.. TTiippooss ddee ddiissccooss.. Una vez revisado lo basico del proceso de arranque, definiremos varios tipos de discos relacionados. Los hemos dividido en cuatro tipos. La discusion siguiente y a lo largo del documento usara el termino ``disco'' para referirse a un disco flexible, a menos se se especifique otra cosa, parte de los siguiente podria referirse de manera similar a los discos duros. N.T. a lo largo de este COMO se mantendra sin traducir los terminos root y boot cuando se refieran a discos, creo que a la mayoria de la gente ( en especial los que vienen de slackware) le resultara mas familiar y comodo los terminos ``disco root'' y ``disco boot'', que, disco raiz y disco de arranque. bboooott ((aarrrraannqquuee)) Un disco conteniendo un kernel que puede ser arrancado. El disco puede ser usado para arrancar el kernel, puede cargar el sistema de ficheros raiz desde otro disco. El kernel en un disco de arranque normalmente debe conocer donde encontrar el sistema de ficheros raiz. A menudo el disco boot carga el kernel de otro disco, pero es posible configurar un disco de arranque para que carge el sistema de ficheros raiz desde un disco duro. Esto se hace normalmente para comprobar un nuevo kernel. ( de echo, ``make zdisk'' crea este disco de arranque automaticamente desde el codigo fuente del kernel). rroooott ((rraaiizz)) Un disco conteniendo el sistema de fichero necesario para ejecutar un sistema Linux. Este disco no contiene necesariamente ni un kernel ni un cargador de arranque. Un disco root puede ser usado para ejecutar un sistema independientemente de cualquier otro disco, una vez el kernel ha sido ejecutado. Normalmente el disco raiz es copiado automaticamente a disco ram. Esto hace los acesos al disco root mucho mas rapidos, y librea la unidad de disco para un disco de utilidades. bboooott root (arranque y raiz) Un disco que contiene ambos el kernel y el sis­ tema de fichero raiz. En otras palabras un disco que contiene todo lo necesario para arrancar y ejecutar un sistema Linux sin disco duro. La ventaja de este tipo de disco es que es compacto -- todo lo necesario esta en un simple disco. No obstante, el gradual incremento de tamaño de todo significa que aumenta la dificultad de incluir todo en un simple disco, aun con compresion. uuttiilliittyy ((uuttiilliiddaaddeess)) Un disco que contiene un sistema de fichero, pero que no esta pensado para ser montado como sistema raiz. Es un disco de datos adicional. Podria usar este tipo de discos para llevar utilidades adicionales que no tienen sitio en el disco root. diskette En general, cuando hablamos sobre ``crear un disco de arranque'' nos referimos a crear tanto la parte de boot (kernel) como la de root (ficheros). esto puede ser junto ( un simple disco boot/root) o por separado (disco boot + disco root). La mas flexible aproximacion a los discos de rescate es probablemente utilizar discos root y boot separados, y uno o mas discos de utilidades para manejar el esceso de programas a incluir. 44.. CCoonnssttrruucciioonn ddee uunn ssiisstteemmaa ddee ffiicchheerrooss rraaiizz.. Crear un sistema de ficheros raiz involucra selecionar los ficheros necesarios para que el sistema fucione. En esta secion describiremos como construir un _s_i_s_t_e_m_a _d_e _f_i_c_h_e_r_o_s _r_a_i_z _c_o_m_p_r_i_m_i_d_o. Una opcion menos comun es construir un sistema de ficheros dsin comprimir en un disquete que puede ser directamente montado como raiz; esta alternativa es descrita en la seccion ``Sistema de ficheros Raiz sin disco Ram''. 44..11.. PPrroollooggoo.. Un sistema de ficheros raiz debe contener todo lo necesario para soportar un completo sistema Linux. Para permitir esto, el disco debe incluir lo minimo requerido por un sistema Linux. · La estructura basica del sistema de ficheros, · Un conjunto minimo de directorios: /dev, /proc, /bin, /etc, /lib, /usr, /tmp, · Un conjunto basico de utilidades: sh, ls, cp, mv, etc., · Un conjunto minimo de ficheros de configuracion: rc, inittab, fstab, etc., · Dispositivos: /dev/hd*, /dev/tty*, /dev/fd0, etc., · Librerias de enlace dinamico para proporcionar las funciones basicas usadas por las utilidades. Por supuesto, un sistema solo llega a ser util cuando puedes ejecutar algo en el, y un disco root, normalmente solo es util cuando puedes hacer algo de esto: · Comprobar un sistema de ficheros de otra unidad, por ejemplo para comprobar su sistema de ficheros raiz en el disco duro, necesita ser capaz de arrancar Linux desde otra unidad, tal como puede hacer con un disco root. Entonces puede ejecutar fsck sobre su sistema de ficheros raiz original, mientras este no esta montado. · Recuperar todo o parte de su unidad raiz original desde una copia de seguirdad utilizando utilidades de archivos u compresion, como cpio, tar, gzip y ftape. Describiremos como construir un sistema de ficheros _c_o_m_p_r_i_m_i_d_o, llamado asi por que esta comprimido en el disco, y cuando arranca, es descomprimido en un disco-ram. Con un sistema de ficheros comprimido puede meter muchos ficheros ( aproximadamente seis megabytes) en un disco standard 1440K. Debido a que el sistema de ficheros es mucho mas grande que el disco, no puede ser construido sobre el disco. Tenemos que construirlo en otro sitio, comprimirlo y copiarlo despues al disco. 44..22.. CCrreeaarr uunn ssiisstteemmaa ddee ffiicchheerrooss.. Para construir dicho sistema de ficheros raiz, necesita un dispositivo de almacenamiento con sitio suficiente para tener todos los ficheros antes de comprimirlos. Deberia necesitar un dispositivo con capacidad para al menos cuatro megabytes. Hay algunas eleciones: · Usar un ddiissccoo--rraamm (DEVICE = /dev/ram0). En este caso, la memoria es usada para simular una unidad de disco. el disco ram debe ser suficientemente grande como para soportar el sistema de ficheros del tamaño apropiado. Si utiliza LILO, compruebe su fichero de configuracion (/etc/lilo.conf) por una linea como: RAMDISK_SIZE = nnn Que determinara cuanta cantidad de RAM debe ser utilizada. Por defecto son 4096K, que deberia ser suficiente. Probablemente no debe­ ria tratar de usar discos-ram en una maquina con menos de 8Mb de RAM. Compruebe que dispone de un dispositivo como /dev/ram0, /dev/ram o /dev/ramdisk. Si no, cree /dev/ram0 con mknod (major number 1, minor 0). · Si dispone de una particion de disco duro de un tamaño suficiente (varios megabytes) , esta es una buena solucion. · use un ddiissppoossiittiivvoo llooooppbbaacckk, que permite a un fichero de disco ser tratado como un dispositivo. Usando un dispositivo loopback puede crar un fichero de tres megabytes en su disco duro y crear un sistema de ficheros en el. Para poder usar dispositivos de loopback necesita los programas mount y umount especialmente modificados. Puede encontrarlos en el siguiente directorio: N.T.: Juraria que en las distribuciones actuales de linux ya viene modificado. Si no tiene el dispositivo loop (/dev/loop0, /dev/loop1, etc.) en su sistema, puede crear uno con ``mknod /dev/loop0 b 7 0''. Una vez instalados los binarios especiales de mount and umount, cree un fichero temporal en el disco duro con suficiente capacidad (ej, /tmp/fsfile). Puede usar un comando como: dd if=/dev/zero of=/tmp/fsfile bs=1k count=_n_n_n Para crera un fichero de _n_n_n bloques. Use el nombre del fichero en lugar de DEVICE mas abajo. Cuando utilize el comando mount, debe incluir la opcion ``-o loop'' para indicar a mount que utilice el dispositivo loopback. Por ejemplo: mount -o loop -t ext2 /tmp/fsfile /mnt Montara /tmp/fsfile (a traves del dispositivo loopback) en el punto de montaje /mnt. Un df lo confirmara. Una vez ha elegido una de estas opciones, prepare el DISPOSITIVO con: dd if=/dev/zero of=DEVICE bs=1k count=3000 Este comando rellena de ceros el dispositivo. Este paso es importante porque el sistema de ficheros en el dispositivo sera comprimido despues, por lo que toda la parte no utilizada deberia ser rellenada con zeros para asegurar la maxima compresion. Siguiente, creee el sistema de ficheros. El kernel de liux reconoce dos tipos de sistemas de ficheros pra discos raiz que son automaticamente copiados a disco-ram. esto son minix y ext2, aunque es preferible usar ext2 como sistema de ficheros. si usa ext2, podria encontrar util usar la opcion -i para especificar mas inodos que los dados por defecto; -i 2000 es una sugerencia para no acabar sin inodos. Alternativamente, puede salvar una gran cantidad de inodos eliminando un monton de ficheros /dev innecesarios. mke2fs crear por defecto 360 inodos en un disco 1.44Mb. Yo encuentro que 120 inodos es suficiente para mi actual disco root de rescate, pero si incluye todos los dispositivos del directorio /dev entonces facilmente escedera de 360. Usando un disco raiz comprimido le permite sistemas de ficheros mayores, y mas inodos por defecto, pero puede serguir necesitando reducir el numero de ficheros para incrementar el numero de inodos. Entonces el comando que usara deberia ser similar a: mke2fs -m 0 -i 2000 DEVICE (Si va a utilizar el dispositivo loopback, debera utilizar el fichero de disco en lugar de DEVICE. en este caso, mke2fs le preguntara si realmente desea hacer esto; diga que si.) The mke2fscommand will automatically detect the space available and configure itself accordingly. The -m 0 parameter prevents it from reserving space for root, and hence provides more usable space on the disk. el comando mke2fs detectara automaticamente el espacio disponible y se configurara en funcioin de esto. el parametro -m 0 le previene de reservar espacio para el root, y asi proporciona mas espacio utilizable en el disco. Despues, monte el dispositivo. mount -t ext2 DEVICE /mnt (debe crear el punto de montaje /mnt si este no existe todabia.) En las siguiente secciones, en todos los nombre de directorios de destino se asume que son relativos a /mnt. 44..33.. RReelllleennaarr eell ssiisstteemmaa ddee ffiicchheerrooss.. He aqui el minimo conjunto razonable de directorios de un sistema de ficheros raiz: · /dev -- Dispositivos, necesarios para realizar operaciones de I/O · /proc -- Directorio necesario para el sistema de ficheros especial proc · /etc -- Ficheros de configuracion del sistema · /sbin -- Binarios criticos del sistema · /bin -- Binarios basicos considerados parte del sistema · /lib -- Librerias compartidas de enlace dinamico necesarias · /mnt -- Un punto de montaje para otros discos · /usr -- Utilidades y aplicaciones adicionales (La estructura de directorios presente aqui es solo para discos root. Los sistemas Linux reales tiene una estructura mas compleja y rigida sugeta a una politica, llamada Sistema de Ficheros Standar (File System Standard) que determina donde debe de ir cada directorio.) Hay tres directorios que estaran vacios en el sistema de ficheros raiz, por lo que solo necesita crearlos con mkdir. el directorio /proc es basicamente el lugar donde el sistema de ficheros proc es oclocado. los directorios /mnt y /usr son solo puntos de montaje para utilizar despues de que el sistema boot/root este funcionando. Una vez mas estos directorios solo necesitan ser creados. Los siguientes cuatro directorios seran descritos en las siguentes seciones. 44..33..11.. //ddeevv El directorio /dev contiene ficheros especiales para todos los dispositivos que son usados por el sistema y son necesarios en todos los sistemas linux. El directorio en si mismo en un directorio normal, y puede ser creado con mkdir del modo normal. Los ficheros especiales de dispositivos, no obstante, deben ser creados de una manera especia, utilizando el comando mknod. Hay un metodo abreviado, -- copie el contenido de su directorio /dev esistente, y borre lo que no necesita. El unico requisito es que copie los dispositivos especiales utilizando la opcion -R. Esto copara el directorio si preocuparse de copiar el contenido de los ficheros. _A_s_e_g_u_r_e_s_e _d_e _u_s_a_r _l_a _l_e_t_r_a _m_a_y_u_s_c_u_l_a _R. si usase la minuscula -r, probablemente acabaria copiando el contenido completo de todos sus discos duros -- ¡ o al menos lo que entrase en el disco! no obstante, tenga cuidado, y use el comando: cp -dpR /dev /mnt suponiendo que el disco este montado en mnt. el parametro dp se asegura que los enlaces simbolicos sean copiados como enlaces, en lugar de copiar el fichero objetivo, y que los atributos originales son preservados, asi como la informacion del posedor. Alternativamente, puede usar el programa cpio con el parametro -p porque cpio maneja los dispositivos especiales correctamente, y no trata de copiar su contenido. Por ejemplo los comandos: cd /dev find . -print | cpio -pmd /mnt/dev Copiara todos los fichero especiales de dispositivo de dev a /mnt/dev. De echo esto copiara todos los dicheros en el arbol de directorios comenzando por /dev, y creara los subdirectorios necesarios en el arbol de directorios destino. Si quiere hacerlo de la manera dificil, use ls -l para ver los numeros mayor y menor de los dispositivos que desee, y creelos en el disco usando mknod. Una vez los dispositivos son copiadodos, no es mala idea comprobar que cualquier dispositivo especial que necesite ha sido colocado en el disco rescate. Por ejemplo, ftape usa dispositivos de cinta, por lo que es necesario copiar todos esos su intenta aceder a su unidad de cintas ddesde el disco de arranque. Note que es necesita un inodo para cada fichero especial de dispositivo, y con el tiempo los inodes pueden ser un recurso escaso, especialmente en systemas de fichero en disco. Hay que hacer especial incapie en borrar cualquier dispositivo especial que no necesite del directorio /dev del disco. Muchos dispositivos son obiamente inecesarios para un sistema especifico. Por ejemplo si no tiene discos SCSI puede eliminar sin problemas todo slos dispositivos que comienzen con sd. De manera similar, si no tiene intencion de utilizar el puerto serie entonces todos los dispositivos que comienzan con cua pueden borrarse. _A_s_e_g_u_r_e_s_e _d_e _i_n_c_l_u_i_r _l_o_s _s_i_g_u_i_e_n_t_e_s _f_i_c_h_e_r_o_s _e_n _e_s_t_e _d_i_r_e_c_t_o_r_i_o_: console, kmem, mem, null, ram, tty1. 44..33..22.. //eettcc Este directorio contiene varios ficheros de configuracion. En muchos sitemas , pueden ser divididos en tres grupos: 1. Requeridos todo el tiempo, _e_._g_. rc, fstab, passwd. 2. Se pueden necesitar, pero no siempre. 3. No se necesitan (Junk that crept in, en el original cuernos lo que significa :-( ). Los ficheros que no son esenciales pueden ser identificados con el comando: ls -ltru Esto muestra en orden inverso segun la ultima fecha de acesso, los ficheros, por lo que si algun fichero no ha sido acedido, este puede omitirse del disco root. En mi disco root, El numero de ficheros de configuracion que tengo baja hasta 15. Esto reduce mi trabajo de manejar los tres tipos de ficheros: 1. Los que he configurado para el disco boot/root: a. rc.d/* -- arranque del sistema, y scripts de cambio de nivel de ejecucion(run-level). b. fstab -- lista de sistema de ficheros montados por el sistema. c. inittab -- parametros para el proceso init, el primer proceso ejecutado al arrancar el sistema. 2. Los que modifique para el disco boot/root: a. passwd -- Lista de usuarios, directorios home,, etc. b. group -- grupos de usuarios. c. shadow -- passwords de los usuarios. Puede no necesitarlo. Si la seguiridad es importante, passwd y shadow deberian ser reducidos para evitar la copia de password fuera del sistema, y para que cuando arranque desde disco, sean rechazados los login no deseados. No obstante, hay una razon para _n_o reducir passed y group. tar ( y problablemente otras utilidades de archivo) almace­ nan los nombre de usuario y grupo con los ficheros. Si restaura ficheros al disco duro desde cinta, los ficheros seran recuperados con sus nombre originales. Si estos nombre no existen en passwd/group cuando son recuperados, los UIDs/GIDs no seran correc­ tos. Asegurese que passwd contiene al menos root. Si quiere que otros usuarios hagan login, asegurese que sus directorios home y shells existen. 3. El resto deberia funcinar por el momento, asi que lo dejaremos por ahora. Aparte de esto, Solo necesito configurar dos ficheros, y estos contiene poca cosa. · rc deberia contener: #!/bin/sh /bin/mount -av /bin/hostname Kangaroo Asegurese de que los directorios son correctos. La linea de hostname no es necesario que se ejecute -- pero vera las cosas mejor. · fstab deberia contener al menos: /dev/ram0 / ext2 defaults /dev/fd0 / ext2 defaults /proc /proc proc defaults Puede copiar las entradas desde su fstab existente, pero no deberia montar automaticamente ninguna particion de disco duro; use la palabra clave noauto para ello. Su disco duro podria esta dañado o muerto cuando utilizase el disco de arranque. Su inittab deberia ser cambiado para que la linea sysinit ejecutase rc o cualquier otro script basico de configuracion que utilice. Ademas, si desea aseguirarse que los usuarios por puerto serie no puedan hacer login, comente todas las entradas para getty que incluyan dispositivos ttys o ttyS al final de la linea. Deje las que ponen tty para que pueda hacer loguin en la consola. Un fichero inittab minimo se pareceria a este: id:2:initdefault: si::sysinit:/etc/rc 1:2345:respawn:/sbin/getty 9600 tty1 2:23:respawn:/sbin/getty 9600 tty2 The fichero inittab define que ejecutara el sistema en los estados diferentes por los que para al arrancar, moverse a modo multi-usuario , etc. Un punto a tener en cuenta es comprobar que los comandos introducidos en inittab se refieren a programas que estan presentes y en el directorio correcto . Si situa sus ficheros de commandos en el isco utilizando la seccion ``Ejemplo de Listado de directorios del disco root'' como guia, y despues copia su inittab al disco de rescate sin comprobarlo , la probabilidad de fallo es bastante alta debido a que la mitad de las entradas de inittab se refieren a programas omitidos o en el directorio equivocado. Note que algunos programas no puede moverse a otro sitio porque otros programas tiene su situacion grabada. Por ejemplo en mi sistema, /etc/shutdown esta fijado desde /etc/reboot/. Si yo muevo reboot a /bin/reboot, he intento ejecutar el comando shutdown, este fallara porque no podra encontrar el fichero reboot. Para el resto, solo copie todos los ficheros de texto de su directorio /etc, mas todos los ejecutables en su directorio etc que no pueda asegurar que no va ha necesitar. Como guia, consulte el ejemplo de listados en la secion ``Ejemplos de listados de direcotorios del disco root''. Probablemente sea suficiente con copiar solo estos ficheros, pero los sistemas difieren entre si en gran medida, por lo que no puedo asegurarle que el mismo conjunto de ficheros en su sistema se equivalente a los de la lista. El unico metodo seguro es empezar con ztt/inittab/ y solucionar lo que pida. Muchos sistemas ahora usan un direcotorio /etc/rc.d/A conteniendo los shellscripst para los diferentes niveles de ejecucion. lo minimo es un simple script rc, pero puede ser tan sencillo como copiar inittab y el directorio /etc/rc.d de sus sistema existente, y recortarr el shellscript en el directorio rc.d para eliminar todos los procesos no relevantes al ambiente del disco del sistema. 44..33..33.. //bbiinn yy //ssbbiinn El directorio /bin es un lugar conveniente para colocar las utilidades extra que necesite para realizar las operaciones basicas, coo son ls, mv, cat y dd. mire el apendice ``Ejemplo de listado de directorios del disco root'' para un ejemplo de la lista de ficheros que pueden ir en los directorios /bin /sbin. Esto no incluye ninguna de las utilidades necesarias para recuperar un backup, como son cpio, tar y gzip. Esto es asi porque al colocar estas utilidades en un disco por separado, se salva espacio en el disco boot/root. Una vez el disco boot/root haya sido arrancado, es copiado al disco ram dejando la unidad de disco libre para montar otros discos, como el de utilidade, Normalmente lo monto bajo usr. La creacion de un disco de utilidades se describe mas abajo en la secion ``Construcion de un disco de utilidades''. Es probablemente una buena idea mantener una copia de la misma version de las utilidades utilizadas para guardar la copia de seguiridad para no gastar tiempo intentando instalar version que no pueden leer sus cintas de copias de seguiridad. _A_s_e_g_u_r_e_s_e _d_e _i_n_c_l_u_i_r _l_o_s _s_i_g_u_i_e_n_t_e_s _p_r_o_g_r_a_m_a_s_: init, getty o equivalente, login, mount, y algun shell capaz de ejecutar los rc scrips, muchos shells son capaces de ejecutarlos si tiene un link de sh al shell. 44..33..44.. //lliibb En /lib colocara los cargadores y librerias de enlace dinamico necesarias. Si las librerias necesarias no se encuentran en su directorio /lib el sistema sera incapaz de arrancar. Si tiene suerte, podra ver un mensaje de error indicandole por que. Practicamente todos los programas necesitan al menos la libreria libc, libc.so._N, donde_N es el numero de version actual. Compruebe su directorio /lib. libc.so.5 es normalmente un enlace simbolico a un fichero con el nombre de version completo: % ls -l /lib/libc.so* lrwxrwxrwx 1 root root 14 Nov 1 20:34 /lib/libc.so.5 -> libc.so.5.4.33* -rwxr-xr-x 1 root root 573176 Jun 12 02:05 /lib/libc.so.5.4.33* En este caso, necesita libc.so.5.4.33. Para encontrar otras librerias que debera ir por todos los binarios que desee incluir y comprobar sus dependencias con el comando ldd. Por ejemplo: % ldd /sbin/mke2fs libext2fs.so.2 => /lib/libext2fs.so.2 libcom_err.so.2 => /lib/libcom_err.so.2 libuuid.so.1 => /lib/libuuid.so.1 libc.so.5 => /lib/libc.so.5 Se necesita cada fichero de la parte derecha. Tenga en cuenta que las librerias mostradas pueden ser enlaces simbolicos. In /lib/ debe ademas incluir el cargados de las librerias. El cargador puede ser ld.so (para librerias a.out) o ld-linux.so ( para librerias ELF). Si no esta seguro de cual necesita, ejecute el comando file sobre la libreria. Por ejemplo: % file /lib/libc.so.5.4.33 /lib/libc.so.4.7.2 /lib/libc.so.4.7.2: Linux/i386 demand-paged executable (QMAGIC), stripped /lib/libc.so.5.4.33: ELF 32-bit LSB shared object, Intel 386, version 1, stripped QMAGIC indicaca que 4.7.2 es una libreria a.out, y ELF indica que 5.4.33 es ELF. Copie los cargadores que necesite al sistema de ficheros raiz que esta construyendo. Las librerias y cargadores deberian comprobarse _c_o_n_c_i_e_n_z_u_d_a_m_e_n_t_e contra los binarios incluidos. Si el kernel no puede cargar la libreria necesario, normalmente se colgara si nigun mensaje de error. 44..44.. PPaarrttiiccuullaarriiddaaddeess ppaarraa PPAAMM yy NNSSSS.. Su sistema puede requerir cargar librerias de enlace dinamico que no son visible para ldd. 44..44..11.. PPAAMM ((PPlluuggggaabbllee AAuutthheennttiiccaattiioonn MMoodduulleess)).. Si su sistema usa PAM ( (Pluggable Authentication Modules)(Modulos de Autentificacion Encajables) debe realizar algunas previsiones en el disco de arranque para poder hacer login. PAM, brevemente, es un sofisticado y modular metodo de autentificar a los ususario y controlar su acesso a servicios. Una manera facil de determinar si su sistema tiliza PAM es comprobar en su disco duro el directorio /etc la existencia de del fichero pam.conf o el direcotorio pam.d ; si cualquiera existe, debe proporcionar un soporte PAM minimo. (alternativamente, ejecute ldd en su ejecutable login; si la salida incluye libpam.so, necesita PAM.) Afortunadamente, la seguridad no es algo muy importante cuando hablamos de discos de arranque, ya que cualquiera que tenga acceso fisico a la maquina puede normalmente hacer lo que quiera con ella. No obstante es importante anular PAM creando un simple /etc/pam.conf en su sistema de ficheros raiz que se parezca al siguiente: ______________________________________________________________________ OTHER auth optional /lib/security/pam_permit.so OTHER account optional /lib/security/pam_permit.so OTHER password optional /lib/security/pam_permit.so OTHER session optional /lib/security/pam_permit.so ______________________________________________________________________ Tambien copie el fichero /lib/security/pam_permit.so a su sistema de ficherso, esta libreria es de solo 8K por lo que impone una sobrecarga minima. Note que esta configuracion permite a cualquiera acceso completo a sus ficheros y servicios en la maquina. Si desea una mayor seguridad en su disco de arranque por alguna razon, deberia copiar parte o toda la configuracion PAM de su disco duro al sistema de ficheros raiz. Asegurese de leer la documentacion PAM con precaucion, y copie cualquier libreria necesaria en /lib/securyty en su sistema de ficheros raiz. You must also include /lib/libpam.so on your bootdisk. But you already know this since you ran ldd on /bin/login, which showed this dependency. Necesita ademas incluir /lib/libpam.so en su disco de arranque. Pero ya deberia seber esto desde que ejecuto ldd en /bin/login, que le muestra las dependencias. 44..44..22.. NNSSSS ((NNaammee SSeerrvviiccee SSwwiittcchh)).. Si usa glibc (aka libc6), probablemente tenga que hacer previsiones para ellos servicios de nombre, o no sera capaz de hacer login. el fichero /etc/msswitch.conf controla la base de datos de bloqueos de varios servicios. Si no tiene planeado aceder a servicios de una red (ej, busquedas de DNS o NIS), solo necesitara preparar un simple fichero nsswitch.conf que sea como esto: ______________________________________________________________________ passwd: files shadow: files group: files hosts: files services: files networks: files protocols: files rpc: files ethers: files netmasks: files bootparams: files automount: files aliases: files netgroup: files publickey: files ______________________________________________________________________ Esto espeficica que todos los servicios son proporcionados por ficheros locales. Probablemente necesite incluir /lib/libnss_files.so.1, que se cargara dinamicamente para manejar la busqueda de ficheros. Si tiene pensado aceder a una red desde el disco de arranque, necesitara crera un fichero nsswitch.conf mas elaborado. Mire la pagina man de nsswitch para mas detalles. Tenga presente que debe uncluir un fichero /lib/libnss__s_e_r_v_i_c_i_o.so.1 por cada _s_e_r_v_i_c_i_o que espeficique. 44..55.. MMoodduullooss.. Si tien un kernel modular, debe evaluar que modulos necesita cargar desde el disco de arranque tras el arranque. Si va a realizar copias de seguirdad desde una unidad de cinta, deberia incuir los modulos ftape y zftape, modulos para los dispositivos SCSI que tenga, y posiblemente los modulos del soporte PPP o SLIP si quiere tener aceso a la red en una emergencia. Estos modulos pueden ser colocados en /lib/modules. Deberia ademas añadir insmod, rmmod y lsmod. Si ademas desea que los modulos se cargen automaticamente, debira incluir modprobe, depmod y swapout. Si usa kerneld, incluya con el el /etc/conf.modules. No obstante, la principal ventaja de utilizar modulos es que puede mover partes no criticas al disco de utilidades y cargarlas cuando sean necesarias, utilizando menos espacio en el disco root. Si tiene que aceder a muchos dispositivos, esta aproximacion es preferible a contruir un kernel inmenso con todos los drivers en el. _N_o_t_e _q_u_e _p_a_r_a _p_o_d_e_r _a_r_r_a_n_c_a_r _d_e_s_d_e _u_n _s_i_s_t_e_m_a _d_e _f_i_c_h_e_r_o_s _e_x_t_2 _c_o_m_p_r_i_m_i_d_o_, _e_l _s_o_p_o_r_t_e _d_e _d_i_s_c_o_s_-_r_a_m _y _e_x_t_2 _d_e_b_e _e_s_t_a_r _i_n_c_l_u_i_d_o _e_n _e_l _k_e_r_n_e_l. No se pueden suministrar como modulos. 44..66.. AAllgguunnooss ddeettaalllleess ffiinnaalleess.. Algunos programas, como es login, fallan si el fichero /var/run/utmp y el directorio /var/log no existen. utmp Por lo que: mkdir -p /mnt/var/{log,run} touch /mnt/var/run/utmp Finalmente, despues de haber preparado todas las librerias que necesite, ejecute ldconfig para rehacer /etc/ld.so.cache en el sistemad de ficheros raiz. El cache indica al cargador donde encontrar la librerias. Para rehacer ld.so.cache, haga los siguiente comandos: chdir /mnt; chroot /mnt /sbin/ldconfig El chroot es necesario por que ldconfig siempre rehace el cache desde el sistema de ficheros raiz. 44..77.. WWrraappppiinngg iitt uupp..((JJuunnttaaddoolloo ttooddoo)) Una vez ha finalizado la construcion del sistema de ficheros, desmontelo, copielo a un fichero y comprimalo: umount /mnt dd if=DEVICE bs=1k | gzip -v9 > rootfs.gz Cuando acabe tendra un fichero rootfs.gz que es su sistema de ficheros comprimido. Deberia comprobar el tamaño para asegurarse de que entra en el disco; si no entra, vuelva atras y elimine algunos ficheros. La seccion ``Reducir el tamaño del sistema de ficheros raiz'' tiene algunas ideas para hacer esto. 55.. EElleeggiirr uunn kkeerrnneell.. En este punto tiene un completo sistema de ficheros raiz comprimido. El siguiente paso es construir o eleguir un kernel. En muchos casos esto posible copiar sukernel acutal y arrancar desde el disco con eso, no obstante, hay varias razonespara construir uno a parte. Una razon es el tamaño. Si esta construyendo un simple disco boot/root, el kernel es uno de los mayores ficheros del disco, por lo que tiene que intentar reducir su tamaño todo lo posible. Para reducir el tamaño del kernel, construya uno con el minimo conjunto de facilities necesarias para soportar el sistema deseado. Esto significa sacar fuera todo aquello que no necesite. Los servicios de Red son una buena cosa para eliminar, asi como el soporte para todas la unidades de disco y otros dispositivos que no necesite para ejecutar su sistema root/boot. Como momentamos antes, sy kernel _d_e_b_e tener soporte para disco-ram y ext2 en el. Una vez que ha conseguido un conjunto minimo de utilidades a incluir en el kernel, debe comprobar que no tiene que añadir mas. Probablemente el uso mas comun para los discos de boot/root sea el examinar o recuperar sistemas de ficheros raiz coruptos, y para eso necesita soporte del kernel. Por ejemplo, si sus copias de seguridad estan todas en cintas utilizando Ftape para aceder a la unidad de cinta, entonces, si pierte su unidad raiz actual y los drivers de Ftape, entonces no podra restaurar las copias de seguridad en cinta, Tendra que reinstalar linux, bajarse y reinstalar ftape, y intentar leer las copias de seguridad. La idea aqui es que, cualquier soporte de Entradas/salidas que tenga tiene que ser añadido al kernel para soportar las copias de seguridad, y deberian ser añadidas al kernel de boot/root. El procedimiento actual para la construcion de un kernel es descrito en la documentacion que lo acompaña. Es bastante facil de seguir, por lo que comienze echando un vistazo a /usr/src/linux. Si tiene problemas construyendo el kernel, problablemente no deberia intentar construir un sistema boot/root por ahora. Recuerde comprimir el kernel con ``make zImage''. 66.. PPoonniieennddoolloo ttooddoo jjuunnttoo:: CCrreeaacciioonn ddeell ddiissccoo((ss)).. En este momento tiene un kenel y un sistema de ficheros raiz comprimido. Si estan creando un disco boot/root, compruebe su tamaño para asegurarse de que entran juntos en un disco. Si esta creando el conjunto de dos discos boot+root compruebe que el sistema de ficheros raiz entra un un simple disco. Deberia decidir ahora si va ha utilizar LILO para arrancar el kernel del disco boot. La alternativa es copiar el kernel directamente al disco y arrancarlo sin LILO. La ventaja de usar LILO es que permite suministrar algunos parametros al kernel que puedenser necesarios para iniciar su hardware (Compruebe el fichero /etc/lilo.conf de su sistema. Si existe y tiene una linea como ``append=...'', probablemente necesite esta caracteristica). La desventaja de usar LILO es que la construcion del disco de arranque es mas complicada, y toma un poco mas de espacio. Tiene que preparar un pequeño sistema de ficheros a parte, que llamaremos el ssiisstteemmaa ddee ffiicchheerrooss kkeerrnneell, donde pondremos el kernel y otros pocos ficheros que necesita LILO. Si va ha utilizar lilo, siga leyendo; si va a transferir el kernel directamente, saltese esta seccion y pase a la seccion ``Sin usar LILO''. 66..11.. .. TTrraannssffeerriirr eell kkeerrnneell ccoonn LLIILLOO Primero debe crear un pequeño fichero de configuracion para LILO. Deberia ser como este: ______________________________________________________________________ boot =/dev/fd0 install =/boot/boot.b map =/boot/map read-write backup =/dev/null compact image = KERNEL label = Bootdisk root =/dev/fd0 ______________________________________________________________________ Para una explicacion d esto parametros, consulte la documentacion del usuario de LILO. Probablemente quiera añadir una linea con append=... a este fichero del fichero /etc/lilo.conf de su disco duro. Guarde este fichero como bdlilo.conf. You now have to create a small filesystem, which we shall call a kkeerrnneell ffiilleessyysstteemm, to distinguish it from the root filesystem. First, figure out how large the filesystem should be. Take the size of your kernel in blocks (the size shown by ``ls -l KERNEL'' divided by 1024 and rounded up) and add 50. Fifty blocks is approximately the space needed for inodes plus other files. You can calculate this number exactly if you want to, or just use 50. If you're creating a two-disk set, you may as well overestimate the space since the first disk is only used for the kernel anyway. Call this number KERNEL_BLOCKS. Put a floppy diskette in the drive (for simplicity we'll assume /dev/fd0) and create an ext2 kernel filesystem on it: mke2fs -i 8192 -m 0 /dev/fd0 KERNEL_BLOCKS The ``-i 8192'' specifies that we want one inode per 8192 bytes. Next, mount the filesystem, remove the lost+found directory, and create dev and boot directories for LILO: mount /dev/fd0 /mnt rm -rf /mnt/lost+found mkdir /mnt/{boot,dev} Next, create devices /dev/null and /dev/fd0. Instead of looking up the device numbers, you can just copy them from your hard disk using -R: cp -R /dev/{null,fd0} /mnt/dev LILO needs a copy of its boot loader, boot.b, which you can take from your hard disk. It is usually kept in the /boot directory. cp /boot/boot.b /mnt/boot Finally, copy in the LILO configuration file you created in the last section, along with your kernel. Both can be put in the root directory: cp bdlilo.conf KERNEL /mnt Everything LILO needs is now on the kernel filesystem, so you are ready to run it. LILO's -r flag is used for installing the boot loader on some other root: lilo -v -C bdlilo.conf -r /mnt LILO should run without error, after which the kernel filesystem should look something like this: ______________________________________________________________________ total 361 1 -rw-r--r-- 1 root root 176 Jan 10 07:22 bdlilo.conf 1 drwxr-xr-x 2 root root 1024 Jan 10 07:23 boot/ 1 drwxr-xr-x 2 root root 1024 Jan 10 07:22 dev/ 358 -rw-r--r-- 1 root root 362707 Jan 10 07:23 vmlinuz boot: total 8 4 -rw-r--r-- 1 root root 3708 Jan 10 07:22 boot.b 4 -rw------- 1 root root 3584 Jan 10 07:23 map dev: total 0 0 brw-r----- 1 root root 2, 0 Jan 10 07:22 fd0 0 crw-r--r-- 1 root root 1, 3 Jan 10 07:22 null ______________________________________________________________________ Do not worry if the file sizes are slightly different from yours. Now leave the disk in the drive and go to section ``Setting the ramdisk word''. 66..22.. TTrraannssffeerrrriinngg tthhee kkeerrnneell wwiitthhoouutt LLIILLOO.. If you are _n_o_t using LILO, transfer the kernel to the bootdisk with the dd command: % dd if=KERNEL of=/dev/fd0 bs=1k 353+1 records in 353+1 records out In this example, dd wrote 353 complete records + 1 partial record, so the kernel occupies the first 354 blocks of the diskette. Call this number KERNEL_BLOCKS and remember it for use in the next section. Finally, set the root device to be the diskette itself, then set the root to be loaded read/write: rdev /dev/fd0 /dev/fd0 rdev -R /dev/fd0 0 Be careful to use a capital -R in the second rdev command. 66..33.. SSeettttiinngg tthhee rraammddiisskk wwoorrdd.. Inside the kernel image is the rraammddiisskk wwoorrdd that specifies where the root filesystem is to be found, along with other options. The word is defined in /usr/src/linux/arch/i386/kernel/setup.c and is interpreted as follows: bits 0-10: Offset to start of ramdisk, in 1024 byte blocks bits 11-13: unused bit 14: Flag indicating that ramdisk is to be loaded bit 15: Flag indicating to prompt before loading rootfs If bit 15 is set, on boot-up you will be prompted to place a new floppy diskette in the drive. This is necessary for a two-disk boot set. There are two cases, depending on whether you are building a single boot/root diskette or a double ``boot+root'' diskette set. 1. If you are building a single disk, the compressed root filesystem will be placed right after the kernel, so the offset will be the first free block (which should be the same as KERNEL_BLOCKS). Bit 14 will be set to 1, and bit 15 will be zero. 2. If you are building a two-disk set, the root filesystem will begin at block zero of the second disk, so the offset will be zero. Bit 14 will be set to 1, and bit 15 will be 1. After carefully calculating the value for the ramdisk word, set it with rdev -r. Be sure to use the _d_e_c_i_m_a_l value. If you used LILO, the argument to rdev here should be the _m_o_u_n_t_e_d _k_e_r_n_e_l _p_a_t_h, e.g. /mnt/vmlinuz; if you copied the kernel with dd, instead use the floppy device name (_e_._g_._, /dev/fd0). rdev -r KERNEL_OR_FLOPPY_DRIVE VALUE If you used LILO, unmount the diskette now. 66..44.. TTrraannssffeerrrriinngg tthhee rroooott ffiilleessyysstteemm.. The last step is to transfer the root filesystem. · If the root filesystem will be placed on the _s_a_m_e disk as the kernel, transfer it using dd with the seek option, which specifies how many blocks to skip: dd if=rootfs.gz of=/dev/fd0 bs=1k seek=KERNEL_BLOCKS · If the root filesystem will be placed on a _s_e_c_o_n_d disk, remove the first diskette, put the second diskette in the drive, then transfer the root filesystem to it: dd if=rootfs.gz of=/dev/fd0 bs=1k Congratulations, you are done! _Y_o_u _s_h_o_u_l_d _a_l_w_a_y_s _t_e_s_t _a _b_o_o_t_d_i_s_k _b_e_f_o_r_e _p_u_t_t_i_n_g _i_t _a_s_i_d_e _f_o_r _a_n _e_m_e_r_g_e_n_c_y_! If it fails to boot, read on. 77.. TTrroouubblleesshhoooottiinngg,, oorr TThhee AAggoonnyy ooff DDeeffeeaatt.. When building bootdisks, the first few tries often will not boot. The general approach to building a root disk is to assemble components from your existing system, and try and get the diskette-based system to the point where it displays messages on the console. Once it starts talking to you, the battle is half over because you can see what it is complaining about, and you can fix individual problems until the system works smoothly. If the system just hangs with no explanation, finding the cause can be difficult. To get a system to boot to the stage where it will talk to you requires several components to be present and correctly configured. The recommended procedure for investigating the problem where the system will not talk to you is as follows: · Check that the root disk actually contains the directories you think it does. It is easy to copy at the wrong level so that you end up with something like /rootdisk/bin instead of /bin on your root diskette. · Check that there is a /lib/libc.so with the same link that appears in your /lib directory on your hard disk. · Check that any symbolic links in your /dev directory in your existing system also exist on your root diskette filesystem, where those links are to devices which you have included in your root diskette. In particular, /dev/console links are essential in many cases. · Check that you have included /dev/tty1, /dev/null, /dev/zero, /dev/mem, /dev/ram and /dev/kmem files. · Check your kernel configuration -- support for all resources required up to login point must be built in, not modules. So _r_a_m_d_i_s_k _a_n_d _e_x_t_2 _s_u_p_p_o_r_t _m_u_s_t _b_e _b_u_i_l_t_-_i_n. · Check that your kernel root device and ramdisk settings are correct. Once these general aspects have been covered, here are some more specific files to check: 1. Make sure init is included as /sbin/init or /bin/init. Make sure it is executable. 2. Run ldd init to check init's libraries. Usually this is just libc.so, but check anyway. Make sure you included the necessary libraries and loaders. 3. Make sure you have the right loader for your libraries -- ld.so for a.out or ld-linux.so for ELF. 4. Check the /etc/inittab on your bootdisk filesystem for the calls to getty (or some getty-like program, such as agetty, mgetty or getty_ps). Double-check these against your hard disk inittab. Check the man pages of the program you use to make sure these make sense. inittab is possibly the trickiest part because its syntax and content depend on the init program used and the nature of the system. The only way to tackle it is to read the man pages for init and inittab and work out exactly what your existing system is doing when it boots. Check to make sure /etc/inittab has a system initialisation entry. This should contain a command to execute the system initialization script, which must exist. 5. As with init, run ldd on your getty to see what it needs, and make sure the necessary library files and loaders were included in your root filesystem. 6. Be sure you have included a shell program (e.g., bash or ash) capable of running all of your rc scripts. 7. If you have a /etc/ld.so.cache file on your rescue disk, remake it. If init starts, but you get a message like: Id xxx respawning too fast: disabled for 5 minutes it is coming from init, usually indicating that getty or login is dying as soon as it starts up. Check the getty and login executables and the libraries they depend upon. Make sure the invocations in /etc/inittab are correct. If you get strange messages from getty, it may mean the calling form in /etc/inittab is wrong. The options of the _g_e_t_t_y programs are variable; even different versions of agetty are reported to have different incompatible calling forms. If you get a login prompt, and you enter a valid login name but the system prompts you for another login name immediately, the problem may be with PAM or NSS. See Section ``PAM and NSS''. The problem may also be that you use shadow passwords and didn't copy /etc/shadow to your bootdisk. If you try to run some executable, such as df, which is on your rescue disk but you yields a message like: df: not found, check two things: (1) Make sure the directory containing the binary is in your PATH, and (2) make sure you have libraries (and loaders) the program needs. 88.. MMiisscceellllaanneeoouuss ttooppiiccss.. 88..11.. RReedduucciinngg rroooott ffiilleessyysstteemm ssiizzee.. Sometimes a root filesystem is too large to fit on a diskette even after compression. Here are some ways to reduce the filesystem size, listed in decreasing order of effectiveness: IInnccrreeaassee tthhee ddiisskk ddeennssiittyy By default, floppy diskettes are formatted at 1440K, but higher density formats are available. fdformat will format disks for the following sizes: 1600, 1680, 1722, 1743, 1760, 1840, and 1920. Most 1440K drives will support 1722K, and this is what I always use for bootdisks. See the fdformat man page and /usr/src/linux/Documentation/devices.txt. RReeppllaaccee yyoouurr sshheellll Some of the popular shells for Linux, such as bash and tcsh, are large and require many libraries. Light-weight alternatives exist, such as ash, lsh, kiss and smash, which are much smaller and require few (or no) libraries. Most of these replacement shells are available from . Make sure any shell you use is capable of running commands in all the rc files you include on your bootdisk. SSttrriipp lliibbrraarriieess aanndd bbiinnaarriieess Many libraries and binaries are typically unstripped (include debugging symbols). Running 'file' on these files will tell you 'not stripped' if so. When copying binaries to your root filesystem, it is good practice to use: objcopy --strip-all FROM TO When copying libraries, use: objcopy --strip-debug FROM TO MMoovvee nnoonn--ccrriittiiccaall ffiilleess ttoo aa uuttiilliittyy ddiisskk If some of your binaries are not needed immediately to boot or login, you can move them to a utility disk. See section ``Building a utility disk'' for details. You may also consider moving modules to a utility disk as well. 88..22.. NNoonn--rraammddiisskk rroooott ffiilleessyysstteemmss.. Section ``Building a root filesystem'' gave instructions for building a compressed root filesystem which is loaded to ramdisk when the system boots. This method has many advantages so it is commonly used. However, some systems with little memory cannot afford the RAM needed for this, and they must use root filesystems mounted directly from the diskette. Such filesystems are actually easier to build than compressed root filesystems because they can be built on a diskette rather than on some other device, and they do not have to be compressed. We will outline the procedure as it differs from the instructions above. If you choose to do this, keep in mind that you will have _m_u_c_h _l_e_s_s _s_p_a_c_e available. 1. Calculate how much space you will have available for root files. If you are building a single boot/root disk, you must fit all blocks for the kernel plus all blocks for the root filesystem on the one disk. 2. Using mke2fs, create a root filesystem on a diskette of the appropriate size. 3. Populate the filesystem as described above. 4. When done, unmount the filesystem and transfer it to a disk file but _d_o _n_o_t _c_o_m_p_r_e_s_s _i_t. 5. Transfer the kernel to a floppy diskette, as described above. When calculating the ramdisk word, sseett bbiitt 1144 ttoo zzeerroo, to indicate that the root filesystem is not to be loaded to ramdisk. Run the rdev's as described. 6. Transfer the root filesystem as before. There are several shortcuts you can take. If you are building a two- disk set, you can build the complete root filesystem directly on the second disk and you need not transfer it to a hard disk file and then back. Also, if you are building a single boot/root disk and using LILO, you can build a _s_i_n_g_l_e filesystem on the entire disk, containing the kernel, LILO files and root files, and simply run LILO as the last step. 88..33.. BBuuiillddiinngg aa uuttiilliittyy ddiisskk.. Building a utility disk is relatively easy -- simply create a filesystem on a formatted disk and copy files to it. To use it with a bootdisk, mount it manually after the system is booted. In the instructions above, we mentioned that the utility disk could be mounted as /usr. In this case, binaries could be placed into a /bin directory on your utility disk, so that placing /usr/bin in your path will access them. Additional libraries needed by the binaries are placed in /lib on the utility disk. There are several important points to keep in mind when designing a utility disk: 1. Do not place critical system binaries or libraries onto the utility disk, since it will not be mountable until after the system has booted. 2. You cannot access a floppy diskette and a floppy tape drive simultaneously. This means that if you have a floppy tape drive, you will not be able to access it while your utility disk is mounted. 3. Access to files on the utility disk will be slow. Appendix ``Sample utility disk directory listing'' shows a sample of files on a utility disk. Here are some ideas for files you may find useful: programs for examining and manipulating disks (format, fdisk) and filesystems (mke2fs, fsck, debugfs, isofs.o), a lightweight text editor (elvis, jove), compression and archive utilities (gzip, tar, cpio, afio), tape utilities (mt, tob, taper), communications utilities (ppp.o, slip.o, minicom) and utilities for devices (setserial, mknod). 99.. HHooww tthhee pprrooss ddoo iitt.. You may notice that the bootdisks used by major distributions such as Slackware, RedHat or Debian, seem more sophisticated than what is described in this document. Professional distribution bootdisks are based on the same principles outlined here, but employ various tricks because their bootdisks have additional requirements. First, they must be able to work with a wide variety of hardware, so they must be able to interact with the user and load various device drivers. Second, they must be prepared to work with many different installation options, with varying degrees of automation. Finally, distribution bootdisks usually combine installation and rescue capabilities. Some bootdisks use a feature called iinniittrrdd (iinniittiiaall rraammddiisskk). This feature was introduced around 2.0.x and allows a kernel to boot in two phases. When the kernel first boots, it loads an initial ramdisk image from the boot disk. This initial ramdisk is a root filesystem containing a program that runs before the real root fs is loaded. This program usually inspects the environment and/or asks the user to select various boot options, such as the device from which to load the real rootdisk. It typically loads additional modules not built in to the kernel. When this initial program exits, the kernel loads the real root image and booting continues normally. For further information on initrd, see /usr/src/linux/Documentation/initrd.txt and The following are summaries of how each distribution's installation disks seem to work, based on inspecting their filesystems and/or source code. We do not guarantee that this information is completely accurate, or that they have not changed since the versions noted. Slackware (v.3.1) uses a straightforward LILO boot similar to what is described in section ``Transferring the kernel with LILO''. The Slackware bootdisk prints a bootup message (``Welcome to the Slackware Linux bootkernel disk!'') using LILO's message parameter. This instructs the user to enter a boot parameter line if necessary. After booting, a root filesystem is loaded from a second disk. The user invokes a setup script which starts the installation. Instead of using a modular kernel, Slackware provides many different kernels and depends upon the user to select the one matching his or her hardware requirements. RedHat (v.4.0) also uses a LILO boot. It loads a compressed ramdisk on the first disk, which runs a custom init program. This program queries for drivers, and loads additional files from a supplemental disk if necessary. Debian (v.1.3) is probably the most sophisticated of the installation disk sets. It uses the SYSLINUX loader to arrange various load options, then uses an initrd image to guide the user through installation. It appears to use both a customized init and a customized shell. 1100.. FFrreeqquueennttllyy aasskkeedd qquueessttiioonn ((FFAAQQ)) lliisstt.. QQ.. II bboooott ffrroomm mmyy bboooott//rroooott ddiisskkss aanndd nnootthhiinngg hhaappppeennss.. WWhhaatt ddoo II ddoo?? See section ``Troubleshooting'', above. QQ.. HHooww ddooeess tthhee SSllaacckkwwaarree//DDeebbiiaann//RReeddHHaatt bboooottddiisskk wwoorrkk?? See section ``What the pros do'', above. QQ.. HHooww ccaann II mmaakkee aa bboooott ddiisskk wwiitthh aa XXYYZZ ddrriivveerr?? The easiest way is to obtain a Slackware kernel from your nearest Slackware mirror site. Slackware kernels are generic kernels which atttempt to include drivers for as many devices as possible, so if you have a SCSI or IDE controller, chances are that a driver for it is included in the Slackware kernel. Go to the a1 directory and select either IDE or SCSI kernel depending on the type of controller you have. Check the xxxxkern.cfg file for the selected kernel to see the drivers which have been included in that kernel. If the device you want is in that list, then the corresponding kernel should boot your computer. Download the xxxxkern.tgz file and copy it to your boot diskette as described above in the section on making boot disks. You must then check the root device in the kernel, using the rdev command: rdev zImage rdev will then display the current root device in the kernel. If this is not the same as the root device you want, then use rdev to change it. For example, the kernel I tried was set to /dev/sda2, but my root SCSI partition is /dev/sda8. To use a root diskette, you would have to use the command: rdev zImage /dev/fd0 If you want to know how to set up a Slackware root disk as well, that's outside the scope of this HOWTO, so I suggest you check the Linux Install Guide or get the Slackware distribution. See the section in this HOWTO titled ``References''. QQ.. HHooww ddoo II uuppddaattee mmyy bboooott ddiisskkeettttee wwiitthh aa nneeww kkeerrnneell?? Just copy the kernel to your boot diskette using the dd command for a boot diskette without a filesystem, or the cp command for a boot/root disk. Refer to the section in this HOWTO titled ``Boot'' for details on creating a boot disk. The description applies equally to updating a kernel on a boot disk. QQ.. HHooww ddoo II uuppddaattee mmyy rroooott ddiisskkeettttee wwiitthh nneeww ffiilleess?? The easiest way is to copy the filesystem from the rootdisk back to the DEVICE you used (from section ``Creating the filesystem'', above). Then mount the filesystem and make the changes. You have to remember where your root filesystem started and how many blocks it occupied: dd if=/dev/fd0 bs=1k skip=ROOTBEGIN count=BLOCKS | gunzip > DEVICE mount -t ext2 DEVICE /mnt After making the changes, proceed as before (in Section ``Wrapping it up'') and transfer the root filesystem back to the disk. You should not have to re-transfer the kernel or re-compute the ramdisk word if you do not change the starting position of the new root filesystem. QQ.. HHooww ddoo II rreemmoovvee LLIILLOO ssoo tthhaatt II ccaann uussee DDOOSS ttoo bboooott aaggaaiinn?? This is not really a Bootdisk topic, but it is asked often. Within Linux, you can run: /sbin/lilo -u You can also use the dd command to copy the backup saved by LILO to the boot sector. Refer to the LILO documentation if you wish to do this. Within DOS and Windows you can use the DOS command: FDISK /MBR MBR stands for Master Boot Record, and it replaces the boot sector with a clean DOS one, without affecting the partition table. Some purists disagree with this, but even the author of LILO, Werner Almesberger, suggests it. It is easy, and it works. QQ.. HHooww ccaann II bboooott iiff II''vvee lloosstt mmyy kkeerrnneell _a_n_d mmyy bboooott ddiisskk?? If you don't have a boot disk standing by, probably the easiest method is to obtain a Slackware kernel for your disk controller type (IDE or SCSI) as described above for ``How do I make a boot disk with a XXX driver?''. You can then boot your computer using this kernel, then repair whatever damage there is. The kernel you get may not have the root device set to the disk type and partition you want. For example, Slackware's generic SCSI kernel has the root device set to /dev/sda2, whereas my root Linux partition happens to be /dev/sda8. In this case the root device in the kernel will have to be changed. You can still change the root device and ramdisk settings in the kernel even if all you have is a kernel, and some other operating system, such as DOS. rdev changes kernel settings by changing the values at fixed offsets in the kernel file, so you can do the same if you have a hex editor available on whatever systems you do still have running -- for example, Norton Utilities Disk Editor under DOS. You then need to check and if necessary change the values in the kernel at the following offsets: HEX DEC DESCRIPTION 0x01F8 504 Low byte of RAMDISK word 0x01F9 505 High byte of RAMDISK word 0x01FC 508 Root minor device number - see below 0X01FD 509 Root major device number - see below The interpretation of the ramdisk word was described in Section ``Setting the ramdisk word'', above. The major and minor device numbers must be set to the device you want to mount your root filesystem on. Some useful values to select from are: DEVICE MAJOR MINOR /dev/fd0 2 0 1st floppy drive /dev/hda1 3 1 partition 1 on 1st IDE drive /dev/sda1 8 1 partition 1 on 1st SCSI drive /dev/sda8 8 8 partition 8 on 1st SCSI drive Once you have set these values then you can write the file to a diskette using either Norton Utilities Disk Editor, or a program called rawrite.exe. This program is included in all distributions. It is a DOS program which writes a file to the ``raw'' disk, starting at the boot sector, instead of writing it to the file system. If you use Norton Utilities you must write the file to a physical disk starting at the beginning of the disk. QQ.. HHooww ccaann II mmaakkee eexxttrraa ccooppiieess ooff bboooott//rroooott ddiisskkeetttteess?? Because magnetic media may deteriorate over time, you should keep several copies of your rescue disk, in case the original is unreadable. The easiest way of making copies of any diskettes, including bootable and utility diskettes, is to use the dd command to copy the contents of the original diskette to a file on your hard drive, and then use the same command to copy the file back to a new diskette. Note that you do not need to, and should not, mount the diskettes, because dd uses the raw device interface. To copy the original, enter the command: dd if=DEVICENAME of=FILENAME where DEVICENAME is the device name of the diskette drive and FILENAME is the name of the (hard-disk) output file Omitting the count parameter causes dd to copy the whole diskette (2880 blocks if high-density). To copy the resulting file back to a new diskette, insert the new diskette and enter the reverse command: dd if=FILENAME of=DEVICENAME Note that the above discussion assumes that you have only one diskette drive. If you have two of the same type, you can copy diskettes using a command like: dd if=/dev/fd0 of=/dev/fd1 QQ.. HHooww ccaann II bboooott wwiitthhoouutt ttyyppiinngg iinn ""aahhaaxxxxxxxx==nnnn,,nnnn,,nnnn"" eevveerryy ttiimmee?? Where a disk device cannot be autodetected it is necessary to supply the kernel with a command device parameter string, such as: aha152x=0x340,11,3,1 This parameter string can be supplied in several ways using LILO: · By entering it on the command line every time the system is booted via LILO. This is boring, though. · By using the LILO ``lock'' keyword to make it store the command line as the default command line, so that LILO will use the same options every time it boots. · By using the append= statement in the LILO config file. Note that the parameter string must be enclosed in quotes. For example, a sample command line using the above parameter string would be: zImage aha152x=0x340,11,3,1 root=/dev/sda1 lock This would pass the device parameter string through, and also ask the kernel to set the root device to /dev/sda1 and save the whole command line and reuse it for all future boots. A sample APPEND statement is: APPEND = "aha152x=0x340,11,3,1" Note that the parameter string must NOT be enclosed in quotes on the command line, but it MUST be enclosed in quotes in the APPEND statement. Note also that for the parameter string to be acted on, the kernel must contain the driver for that disk type. If it does not, then there is nothing listening for the parameter string, and you will have to rebuild the kernel to include the required driver. For details on rebuilding the kernel, cd to /usr/src/linux and read the README, and read the Linux FAQ and Installation HOWTO. Alternatively you could obtain a generic kernel for the disk type and install that. Readers are strongly urged to read the LILO documentation before experimenting with LILO installation. Incautious use of the BOOT statement can damage partitions. QQ.. AAtt bboooott ttiimmee,, II ggeett eerrrroorr ""A: cannot execute B". Why? There are several cases of program names being hardcoded in various utilities. These cases do not occur everywhere, but they may explain why an executable apparently cannot be found on your system even though you can see that it is there. You can find out if a given program has the name of another hardcoded by using the strings command and piping the output through grep. Known examples of hardcoding are: · Shutdown in some versions has /etc/reboot hardcoded, so reboot must be placed in the /etc directory. · init has caused problems for at least one person, with the kernel being unable to find init. To fix these problems, either move the programs to the correct directory, or change configuration files (e.g. inittab) to point to the correct directory. If in doubt, put programs in the same directories as they are on your hard disk, and use the same inittab and /etc/rc.d files as they appear on your hard disk. QQ.. MMyy kkeerrnneell hhaass rraammddiisskk ssuuppppoorrtt,, bbuutt iinniittiiaalliizzeess rraammddiisskkss ooff 00KK Where this occurs, a kernel message like this will appear as the kernel is booting: Ramdisk driver initialized : 16 ramdisks of 0K size This is probably because the size has been set to 0 by kernel parameters at boot time. This could possibly be because of an overlooked LILO configuration file parameter: ramdisk= 0 This was included in sample LILO configuration files in some older distributions, and was put there to override any previous kernel setting. If you have such a line, remove it. Note that if you attempt to use a ramdisk which has been set to 0K the behaviour can be unpredictable, and can result in kernel panics. KK.. RReessoouurrcceess aanndd ppooiinntteerrss.. When retrieving a package, always get the latest version unless you have good reasons for not doing so. KK..11.. PPrree--mmaaddee bboooottddiisskkss.. These are sources for distribution bootdisks. _P_l_e_a_s_e _u_s_e _o_n_e _o_f _t_h_e _m_i_r_r_o_r _s_i_t_e_s _t_o _r_e_d_u_c_e _t_h_e _l_o_a_d _o_n _t_h_e_s_e _m_a_c_h_i_n_e_s_. · Slackware bootdisks and Slackware mirror sites · RedHat bootdisks and Red Hat mirror sites · Debian bootdisks and Debian mirror sites In addition to the distribution bootdisks, the following rescue disk images are available. Unless otherwise specified, these are available in the directory · tomsrtbt, by Tom Oehser, is a single-disk boot/root disk based on kernel 2.0.33, with a large list of features and support programs. It supports IDE, SCSI, tape, network adaptors, PCMCIA and more. About 100 utility programs and tools are included for fixing and restoring disks. The package also includes scripts for disassembling and reconstructing the images so that new material can be added if necessary. · rescue02, by John Comyns, is a rescue disk based on kernel 1.3.84, with support for IDE and Adaptec 1542 and NCR53C7,8xx. It uses ELF binaries but it has enough commands so that it can be used on any system. There are modules that can be loaded after booting for all other SCSI cards. It probably won't work on systems with 4 mb of ram since it uses a 3 mb ram disk. · resque_disk-2.0.22, by Sergei Viznyuk, is a full-featured boot/root disk based on kernel 2.0.22 with built-in support for IDE, many difference SCSI controllers, and ELF/AOUT. Also includes many modules and useful utilities for repairing and restoring a hard disk. · cramdisk images, based on the 2.0.23 kernel, available for 4 meg and 8 meg machines. They include math emulation and networking (PPP and dialin script, NE2000, 3C509), or support for the parallel port ZIP drive. These diskette images will boot on a 386 with 4MB RAM. MSDOS support is included so you can download from the net to a DOS partition. KK..22.. RReessccuuee ppaacckkaaggeess.. Several packages for creating rescue disks are available on sunsite.unc.edu. With these packages you generally specify a set of files for inclusion and the software automates (to varying degrees) the creation of a bootdisk. See for more information. CChheecckk tthhee ffiillee ddaatteess ccaarreeffuullllyy -- some of these packages have not been updated in several years and will not support the creation of a compressed root filesystem loaded into ramdisk. To the best of our knowledge, Yard is the only package that will. KK..33.. GGrraahhaamm CChhaappmmaann''ss sshheellll ssccrriippttss Graham Chapman has written a set of scripts that may be useful as examples of how to create bootdisks. In previous versions of this HOWTO the scripts appeared in an appendix, but they have been deleted from the documented and placed on a web page: You may find it convenient to use these scripts, but if so, read the instructions carefully -- for example, if you specify the wrong swap device, you will find your root filesystem has been throroughly and permanently erased. Be sure you have it correctly configured before you use it! KK..44.. LLIILLOO ---- tthhee LLiinnuuxx llooaaddeerr.. Written by Werner Almesberger. Excellent boot loader, and the documentation includes information on the boot sector contents and the early stages of the boot process. Ftp from . It is also available on Sunsite and mirrors. KK..55.. LLiinnuuxx FFAAQQ aanndd HHOOWWTTOOss.. These are available from many sources. Look at the usenet newsgroups news.answers and comp.os.linux.announce. The FAQ is available from and the HOWTOs from . Most documentation for Linux may be found at The Linux Documentation Project homepage . If desperate, send mail to mail-server@rtfm.mit.edu with the word ``help'' in the message, then follow the mailed instructions. KK..66.. RRaammddiisskk uussaaggee.. An excellent description of the how the new ramdisk code works may be found with the documentation supplied with the Linux kernel. See /usr/src/linux/Documentation/ramdisk.txt. It is written by Paul Gortmaker and includes a section on creating a compressed ramdisk. KK..77.. TThhee LLiinnuuxx bboooott pprroocceessss.. For more detail on the Linux boot process, here are some pointers: · The Linux System Administrators' Guide has a section on booting, See · The LILO ``Technical overview'' has the definitive technical, low-level description of the boot process, up to where the kernel is started. · The source code is the ultimate guide. Below are some kernel files related to the boot process. If you have the Linux kernel source code, you can find these under /usr/src/linux on your machine; alternatively, Shigio Yamaguchi (shigio@wafu.netgate.net) has a very nice hypertext kernel browser at . Here are some relevant files: aarrcchh//ii338866//bboooott//bboooottsseecctt..SS,,sseettuupp..SS Contain assembly code for the bootsector. aarrcchh//ii338866//bboooott//ccoommpprreesssseedd//mmiisscc..cc Contains code for uncompressing the kernel. aarrcchh//ii338866//kkeerrnneell// Directory containing kernel initialization code. setup.c contains the ramdisk word. ddrriivveerrss//bblloocckk//rrdd..cc Contains the ramdisk driver. The procedures rd_load and rd_load_image load blocks from a device into a ramdisk. The procedure identify_ramdisk_image determines what kind of filesystem is found and whether it is compressed. LL.. LLIILLOO bboooott eerrrroorr ccooddeess.. Questions about these errors are asked so often on Usenet that we include them here as a public service. This summary is excerpted from Werner Almsberger's LILO User Documentation, available at . When LILO loads itself, it displays the word ``LILO''. Each letter is printed before or after performing some specific action. If LILO fails at some point, the letters printed so far can be used to identify the problem. ((nnootthhiinngg)) No part of LILO has been loaded. LILO either isn't installed or the partition on which its boot sector is located isn't active. LL The first stage boot loader has been loaded and started, but it can't load the second stage boot loader. The two-digit error codes indicate the type of problem. (See also section ``Disk error codes''.) This condition usually indicates a media failure or a geometry mismatch (e.g. bad disk parameters) LLII The first stage boot loader was able to load the second stage boot loader, but has failed to execute it. This can either be caused by a geometry mismatch or by moving /boot/boot.b without running the map installer. LLIILL The second stage boot loader has been started, but it can't load the descriptor table from the map file. This is typically caused by a media failure or by a geometry mismatch. LLIILL?? The second stage boot loader has been loaded at an incorrect address. This is typically caused by a subtle geometry mismatch or by moving /boot/boot.b without running the map installer. LLIILL-- The descriptor table is corrupt. This can either be caused by a geometry mismatch or by moving /boot/map without running the map installer. LLIILLOO All parts of LILO have been successfully loaded. If the BIOS signals an error when LILO is trying to load a boot image, the respective error code is displayed. These codes range from 0x00 through 0xbb. See the LILO User Guide for an explanation of these. MM.. LLiissttaaddoo ddee eejjeemmpplloo ddee ddiirreeccttoorriiooss ddeell ddiissccoo rroooott.. He aqui el contenido de un sistema de ficheros raiz y disco de utilidadeas de ejemplo. Root directory: drwx--x--x 2 root root 1024 Nov 1 15:39 bin drwx--x--x 2 root root 4096 Nov 1 15:39 dev drwx--x--x 3 root root 1024 Nov 1 15:39 etc drwx--x--x 4 root root 1024 Nov 1 15:39 lib drwx--x--x 5 root root 1024 Nov 1 15:39 mnt drwx--x--x 2 root root 1024 Nov 1 15:39 proc drwx--x--x 2 root root 1024 Nov 1 15:39 root drwx--x--x 2 root root 1024 Nov 1 15:39 sbin drwx--x--x 2 root root 1024 Nov 1 15:39 tmp drwx--x--x 7 root root 1024 Nov 1 15:39 usr drwx--x--x 5 root root 1024 Nov 1 15:39 var /bin: -rwx--x--x 1 root root 62660 Nov 1 15:39 ash -rwx--x--x 1 root root 9032 Nov 1 15:39 cat -rwx--x--x 1 root root 10276 Nov 1 15:39 chmod -rwx--x--x 1 root root 9592 Nov 1 15:39 chown -rwx--x--x 1 root root 23124 Nov 1 15:39 cp -rwx--x--x 1 root root 23028 Nov 1 15:39 date -rwx--x--x 1 root root 14052 Nov 1 15:39 dd -rwx--x--x 1 root root 14144 Nov 1 15:39 df -rwx--x--x 1 root root 69444 Nov 1 15:39 egrep -rwx--x--x 1 root root 395 Nov 1 15:39 false -rwx--x--x 1 root root 69444 Nov 1 15:39 fgrep -rwx--x--x 1 root root 69444 Nov 1 15:39 grep -rwx--x--x 3 root root 45436 Nov 1 15:39 gunzip -rwx--x--x 3 root root 45436 Nov 1 15:39 gzip -rwx--x--x 1 root root 8008 Nov 1 15:39 hostname -rwx--x--x 1 root root 12736 Nov 1 15:39 ln -rws--x--x 1 root root 15284 Nov 1 15:39 login -rwx--x--x 1 root root 29308 Nov 1 15:39 ls -rwx--x--x 1 root root 8268 Nov 1 15:39 mkdir -rwx--x--x 1 root root 8920 Nov 1 15:39 mknod -rwx--x--x 1 root root 24836 Nov 1 15:39 more -rws--x--x 1 root root 37640 Nov 1 15:39 mount -rwx--x--x 1 root root 12240 Nov 1 15:39 mt -rwx--x--x 1 root root 12932 Nov 1 15:39 mv -r-x--x--x 1 root root 12324 Nov 1 15:39 ps -rwx--x--x 1 root root 5388 Nov 1 15:39 pwd -rwx--x--x 1 root root 10092 Nov 1 15:39 rm lrwxrwxrwx 1 root root 3 Nov 1 15:39 sh -> ash -rwx--x--x 1 root root 25296 Nov 1 15:39 stty -rws--x--x 1 root root 12648 Nov 1 15:39 su -rwx--x--x 1 root root 4444 Nov 1 15:39 sync -rwx--x--x 1 root root 110668 Nov 1 15:39 tar -rwx--x--x 1 root root 19712 Nov 1 15:39 touch -rwx--x--x 1 root root 395 Nov 1 15:39 true -rws--x--x 1 root root 19084 Nov 1 15:39 umount -rwx--x--x 1 root root 5368 Nov 1 15:39 uname -rwx--x--x 3 root root 45436 Nov 1 15:39 zcat /dev: lrwxrwxrwx 1 root root 6 Nov 1 15:39 cdrom -> cdu31a brw-rw-r-- 1 root root 15, 0 May 5 1998 cdu31a crw------- 1 root root 4, 0 Nov 1 15:29 console crw-rw-rw- 1 root uucp 5, 64 Sep 9 19:46 cua0 crw-rw-rw- 1 root uucp 5, 65 May 5 1998 cua1 crw-rw-rw- 1 root uucp 5, 66 May 5 1998 cua2 crw-rw-rw- 1 root uucp 5, 67 May 5 1998 cua3 brw-rw---- 1 root floppy 2, 0 Aug 8 13:54 fd0 brw-rw---- 1 root floppy 2, 36 Aug 8 13:54 fd0CompaQ brw-rw---- 1 root floppy 2, 84 Aug 8 13:55 fd0D1040 brw-rw---- 1 root floppy 2, 88 Aug 8 13:55 fd0D1120 brw-rw---- 1 root floppy 2, 12 Aug 8 13:54 fd0D360 brw-rw---- 1 root floppy 2, 16 Aug 8 13:54 fd0D720 brw-rw---- 1 root floppy 2, 120 Aug 8 13:55 fd0D800 brw-rw---- 1 root floppy 2, 32 Aug 8 13:54 fd0E2880 brw-rw---- 1 root floppy 2, 104 Aug 8 13:55 fd0E3200 brw-rw---- 1 root floppy 2, 108 Aug 8 13:55 fd0E3520 brw-rw---- 1 root floppy 2, 112 Aug 8 13:55 fd0E3840 brw-rw---- 1 root floppy 2, 28 Aug 8 13:54 fd0H1440 brw-rw---- 1 root floppy 2, 124 Aug 8 13:55 fd0H1600 brw-rw---- 1 root floppy 2, 44 Aug 8 13:55 fd0H1680 brw-rw---- 1 root floppy 2, 60 Aug 8 13:55 fd0H1722 brw-rw---- 1 root floppy 2, 76 Aug 8 13:55 fd0H1743 brw-rw---- 1 root floppy 2, 96 Aug 8 13:55 fd0H1760 brw-rw---- 1 root floppy 2, 116 Aug 8 13:55 fd0H1840 brw-rw---- 1 root floppy 2, 100 Aug 8 13:55 fd0H1920 lrwxrwxrwx 1 root root 7 Nov 1 15:39 fd0H360 -> fd0D360 lrwxrwxrwx 1 root root 7 Nov 1 15:39 fd0H720 -> fd0D720 brw-rw---- 1 root floppy 2, 52 Aug 8 13:55 fd0H820 brw-rw---- 1 root floppy 2, 68 Aug 8 13:55 fd0H830 brw-rw---- 1 root floppy 2, 4 Aug 8 13:54 fd0d360 brw-rw---- 1 root floppy 2, 8 Aug 8 13:54 fd0h1200 brw-rw---- 1 root floppy 2, 40 Aug 8 13:54 fd0h1440 brw-rw---- 1 root floppy 2, 56 Aug 8 13:55 fd0h1476 brw-rw---- 1 root floppy 2, 72 Aug 8 13:55 fd0h1494 brw-rw---- 1 root floppy 2, 92 Aug 8 13:55 fd0h1600 brw-rw---- 1 root floppy 2, 20 Aug 8 13:54 fd0h360 brw-rw---- 1 root floppy 2, 48 Aug 8 13:55 fd0h410 brw-rw---- 1 root floppy 2, 64 Aug 8 13:55 fd0h420 brw-rw---- 1 root floppy 2, 24 Aug 8 13:54 fd0h720 brw-rw---- 1 root floppy 2, 80 Aug 8 13:55 fd0h880 brw-rw---- 1 root disk 3, 0 May 5 1998 hda brw-rw---- 1 root disk 3, 1 May 5 1998 hda1 brw-rw---- 1 root disk 3, 2 May 5 1998 hda2 brw-rw---- 1 root disk 3, 3 May 5 1998 hda3 brw-rw---- 1 root disk 3, 4 May 5 1998 hda4 brw-rw---- 1 root disk 3, 5 May 5 1998 hda5 brw-rw---- 1 root disk 3, 6 May 5 1998 hda6 brw-rw---- 1 root disk 3, 64 May 5 1998 hdb brw-rw---- 1 root disk 3, 65 May 5 1998 hdb1 brw-rw---- 1 root disk 3, 66 May 5 1998 hdb2 brw-rw---- 1 root disk 3, 67 May 5 1998 hdb3 brw-rw---- 1 root disk 3, 68 May 5 1998 hdb4 brw-rw---- 1 root disk 3, 69 May 5 1998 hdb5 brw-rw---- 1 root disk 3, 70 May 5 1998 hdb6 crw-r----- 1 root kmem 1, 2 May 5 1998 kmem crw-r----- 1 root kmem 1, 1 May 5 1998 mem lrwxrwxrwx 1 root root 12 Nov 1 15:39 modem -> ../dev/ttyS1 lrwxrwxrwx 1 root root 12 Nov 1 15:39 mouse -> ../dev/psaux crw-rw-rw- 1 root root 1, 3 May 5 1998 null crwxrwxrwx 1 root root 10, 1 Oct 5 20:22 psaux brw-r----- 1 root disk 1, 1 May 5 1998 ram brw-rw---- 1 root disk 1, 0 May 5 1998 ram0 brw-rw---- 1 root disk 1, 1 May 5 1998 ram1 brw-rw---- 1 root disk 1, 2 May 5 1998 ram2 brw-rw---- 1 root disk 1, 3 May 5 1998 ram3 brw-rw---- 1 root disk 1, 4 May 5 1998 ram4 brw-rw---- 1 root disk 1, 5 May 5 1998 ram5 brw-rw---- 1 root disk 1, 6 May 5 1998 ram6 brw-rw---- 1 root disk 1, 7 May 5 1998 ram7 brw-rw---- 1 root disk 1, 8 May 5 1998 ram8 brw-rw---- 1 root disk 1, 9 May 5 1998 ram9 lrwxrwxrwx 1 root root 4 Nov 1 15:39 ramdisk -> ram0 *** Solo inclui dispositivos para las particiones IDE que utilizo. *** Si tiene SCSI, entonces utilize los dispositivos /dev/sdXX en su lugar. crw------- 1 root root 4, 0 May 5 1998 tty0 crw--w---- 1 root tty 4, 1 Nov 1 15:39 tty1 crw------- 1 root root 4, 2 Nov 1 15:29 tty2 crw------- 1 root root 4, 3 Nov 1 15:29 tty3 crw------- 1 root root 4, 4 Nov 1 15:29 tty4 crw------- 1 root root 4, 5 Nov 1 15:29 tty5 crw------- 1 root root 4, 6 Nov 1 15:29 tty6 crw------- 1 root root 4, 7 May 5 1998 tty7 crw------- 1 root tty 4, 8 May 5 1998 tty8 crw------- 1 root tty 4, 9 May 8 12:57 tty9 crw-rw-rw- 1 root root 4, 65 Nov 1 12:17 ttyS1 crw-rw-rw- 1 root root 1, 5 May 5 1998 zero /etc: -rw------- 1 root root 164 Nov 1 15:39 conf.modules -rw------- 1 root root 668 Nov 1 15:39 fstab -rw------- 1 root root 71 Nov 1 15:39 gettydefs -rw------- 1 root root 389 Nov 1 15:39 group -rw------- 1 root root 413 Nov 1 15:39 inittab -rw------- 1 root root 65 Nov 1 15:39 issue -rw-r--r-- 1 root root 746 Nov 1 15:39 ld.so.cache *** ld.so.cache es creado por ldconfig almacena la situacion de las *** librerias de enlace dinamico. *** Pueden fallar muchas cosas al arrancar si falta ld.so.cache . *** Puede rehacerlo despues de crear el disco boot, or *** incluir ldconfig en el disco boot y ejecutarlo desde unscript rc.x *** para actualizar la situacion de ficheros. -rw------- 1 root root 32 Nov 1 15:39 motd -rw------- 1 root root 949 Nov 1 15:39 nsswitch.conf drwx--x--x 2 root root 1024 Nov 1 15:39 pam.d -rw------- 1 root root 139 Nov 1 15:39 passwd -rw------- 1 root root 516 Nov 1 15:39 profile -rwx--x--x 1 root root 387 Nov 1 15:39 rc -rw------- 1 root root 55 Nov 1 15:39 shells -rw------- 1 root root 774 Nov 1 15:39 termcap -rw------- 1 root root 78 Nov 1 15:39 ttytype lrwxrwxrwx 1 root root 15 Nov 1 15:39 utmp -> ../var/run/utmp lrwxrwxrwx 1 root root 15 Nov 1 15:39 wtmp -> ../var/log/wtmp /etc/pam.d: -rw------- 1 root root 356 Nov 1 15:39 other /lib: *** Tengo un sistema ELF con glibc, por lo que necesito el cargador ld-2.so. -rwxr-xr-x 1 root root 45415 Nov 1 15:39 ld-2.0.7.so lrwxrwxrwx 1 root root 11 Nov 1 15:39 ld-linux.so.2 -> ld-2.0.7.so -rwxr-xr-x 1 root root 731548 Nov 1 15:39 libc-2.0.7.so lrwxrwxrwx 1 root root 13 Nov 1 15:39 libc.so.6 -> libc-2.0.7.so lrwxrwxrwx 1 root root 17 Nov 1 15:39 libcom_err.so.2 -> libcom_err.so.2.0 -rwxr-xr-x 1 root root 6209 Nov 1 15:39 libcom_err.so.2.0 -rwxr-xr-x 1 root root 153881 Nov 1 15:39 libcrypt-2.0.7.so lrwxrwxrwx 1 root root 17 Nov 1 15:39 libcrypt.so.1 -> libcrypt-2.0.7.so -rwxr-xr-x 1 root root 12962 Nov 1 15:39 libdl-2.0.7.so lrwxrwxrwx 1 root root 14 Nov 1 15:39 libdl.so.2 -> libdl-2.0.7.so lrwxrwxrwx 1 root root 16 Nov 1 15:39 libext2fs.so.2 -> libext2fs.so.2.4 -rwxr-xr-x 1 root root 81382 Nov 1 15:39 libext2fs.so.2.4 -rwxr-xr-x 1 root root 25222 Nov 1 15:39 libnsl-2.0.7.so lrwxrwxrwx 1 root root 15 Nov 1 15:39 libnsl.so.1 -> libnsl-2.0.7.so -rwx--x--x 1 root root 178336 Nov 1 15:39 libnss_files-2.0.7.so lrwxrwxrwx 1 root root 21 Nov 1 15:39 libnss_files.so.1 -> libnss_files-2.0.7.so lrwxrwxrwx 1 root root 14 Nov 1 15:39 libpam.so.0 -> libpam.so.0.64 -rwxr-xr-x 1 root root 26906 Nov 1 15:39 libpam.so.0.64 lrwxrwxrwx 1 root root 19 Nov 1 15:39 libpam_misc.so.0 -> libpam_misc.so.0.64 -rwxr-xr-x 1 root root 7086 Nov 1 15:39 libpam_misc.so.0.64 -r-xr-xr-x 1 root root 35615 Nov 1 15:39 libproc.so.1.2.6 lrwxrwxrwx 1 root root 15 Nov 1 15:39 libpwdb.so.0 -> libpwdb.so.0.54 -rw-r--r-- 1 root root 121899 Nov 1 15:39 libpwdb.so.0.54 lrwxrwxrwx 1 root root 19 Nov 1 15:39 libtermcap.so.2 -> libtermcap.so.2.0.8 -rwxr-xr-x 1 root root 12041 Nov 1 15:39 libtermcap.so.2.0.8 -rwxr-xr-x 1 root root 12874 Nov 1 15:39 libutil-2.0.7.so lrwxrwxrwx 1 root root 16 Nov 1 15:39 libutil.so.1 -> libutil-2.0.7.so lrwxrwxrwx 1 root root 14 Nov 1 15:39 libuuid.so.1 -> libuuid.so.1.1 -rwxr-xr-x 1 root root 8039 Nov 1 15:39 libuuid.so.1.1 drwx--x--x 3 root root 1024 Nov 1 15:39 modules drwx--x--x 2 root root 1024 Nov 1 15:39 security /lib/modules: drwx--x--x 4 root root 1024 Nov 1 15:39 2.0.35 /lib/modules/2.0.35: drwx--x--x 2 root root 1024 Nov 1 15:39 block drwx--x--x 2 root root 1024 Nov 1 15:39 cdrom /lib/modules/2.0.35/block: -rw------- 1 root root 7156 Nov 1 15:39 loop.o /lib/modules/2.0.35/cdrom: -rw------- 1 root root 24108 Nov 1 15:39 cdu31a.o /lib/security: -rwx--x--x 1 root root 8771 Nov 1 15:39 pam_permit.so *** Directorios a usar como puntos de montaje /mnt: drwx--x--x 2 root root 1024 Nov 1 15:39 SparQ drwx--x--x 2 root root 1024 Nov 1 15:39 cdrom drwx--x--x 2 root root 1024 Nov 1 15:39 floppy /proc: /root: -rw------- 1 root root 176 Nov 1 15:39 .bashrc -rw------- 1 root root 182 Nov 1 15:39 .cshrc -rw------- 1 root root 47 Nov 1 15:39 .glintrc -rwx--x--x 1 root root 455 Nov 1 15:39 .profile -rw------- 1 root root 4014 Nov 1 15:39 .tcshrc /sbin: -rwx--x--x 1 root root 23976 Nov 1 15:39 depmod -rwx--x--x 2 root root 274600 Nov 1 15:39 e2fsck -rwx--x--x 1 root root 41268 Nov 1 15:39 fdisk -rwx--x--x 1 root root 9396 Nov 1 15:39 fsck -rwx--x--x 2 root root 274600 Nov 1 15:39 fsck.ext2 -rwx--x--x 1 root root 29556 Nov 1 15:39 getty -rwx--x--x 1 root root 6620 Nov 1 15:39 halt -rwx--x--x 1 root root 23116 Nov 1 15:39 init -rwx--x--x 1 root root 25612 Nov 1 15:39 insmod -rwx--x--x 1 root root 10368 Nov 1 15:39 kerneld -rwx--x--x 1 root root 110400 Nov 1 15:39 ldconfig -rwx--x--x 1 root root 6108 Nov 1 15:39 lsmod -rwx--x--x 2 root root 17400 Nov 1 15:39 mke2fs -rwx--x--x 1 root root 4072 Nov 1 15:39 mkfs -rwx--x--x 2 root root 17400 Nov 1 15:39 mkfs.ext2 -rwx--x--x 1 root root 5664 Nov 1 15:39 mkswap -rwx--x--x 1 root root 22032 Nov 1 15:39 modprobe lrwxrwxrwx 1 root root 4 Nov 1 15:39 reboot -> halt -rwx--x--x 1 root root 7492 Nov 1 15:39 rmmod -rwx--x--x 1 root root 12932 Nov 1 15:39 shutdown lrwxrwxrwx 1 root root 6 Nov 1 15:39 swapoff -> swapon -rwx--x--x 1 root root 5124 Nov 1 15:39 swapon lrwxrwxrwx 1 root root 4 Nov 1 15:39 telinit -> init -rwx--x--x 1 root root 6944 Nov 1 15:39 update /tmp: /usr: drwx--x--x 2 root root 1024 Nov 1 15:39 bin drwx--x--x 2 root root 1024 Nov 1 15:39 lib drwx--x--x 3 root root 1024 Nov 1 15:39 man drwx--x--x 2 root root 1024 Nov 1 15:39 sbin drwx--x--x 3 root root 1024 Nov 1 15:39 share lrwxrwxrwx 1 root root 10 Nov 1 15:39 tmp -> ../var/tmp /usr/bin: -rwx--x--x 1 root root 37164 Nov 1 15:39 afio -rwx--x--x 1 root root 5044 Nov 1 15:39 chroot -rwx--x--x 1 root root 10656 Nov 1 15:39 cut -rwx--x--x 1 root root 63652 Nov 1 15:39 diff -rwx--x--x 1 root root 12972 Nov 1 15:39 du -rwx--x--x 1 root root 56552 Nov 1 15:39 find -r-x--x--x 1 root root 6280 Nov 1 15:39 free -rwx--x--x 1 root root 7680 Nov 1 15:39 head -rwx--x--x 1 root root 8504 Nov 1 15:39 id -r-sr-xr-x 1 root bin 4200 Nov 1 15:39 passwd -rwx--x--x 1 root root 14856 Nov 1 15:39 tail -rwx--x--x 1 root root 19008 Nov 1 15:39 tr -rwx--x--x 1 root root 7160 Nov 1 15:39 wc -rwx--x--x 1 root root 4412 Nov 1 15:39 whoami /usr/lib: lrwxrwxrwx 1 root root 17 Nov 1 15:39 libncurses.so.4 -> libncurses.so.4.2 -rw-r--r-- 1 root root 260474 Nov 1 15:39 libncurses.so.4.2 /usr/sbin: -r-x--x--x 1 root root 13684 Nov 1 15:39 fuser -rwx--x--x 1 root root 3876 Nov 1 15:39 mklost+found /usr/share: drwx--x--x 4 root root 1024 Nov 1 15:39 terminfo /usr/share/terminfo: drwx--x--x 2 root root 1024 Nov 1 15:39 l drwx--x--x 2 root root 1024 Nov 1 15:39 v /usr/share/terminfo/l: -rw------- 1 root root 1552 Nov 1 15:39 linux -rw------- 1 root root 1516 Nov 1 15:39 linux-m -rw------- 1 root root 1583 Nov 1 15:39 linux-nic /usr/share/terminfo/v: -rw------- 2 root root 1143 Nov 1 15:39 vt100 -rw------- 2 root root 1143 Nov 1 15:39 vt100-am /var: drwx--x--x 2 root root 1024 Nov 1 15:39 log drwx--x--x 2 root root 1024 Nov 1 15:39 run drwx--x--x 2 root root 1024 Nov 1 15:39 tmp /var/log: -rw------- 1 root root 0 Nov 1 15:39 wtmp /var/run: -rw------- 1 root root 0 Nov 1 15:39 utmp /var/tmp: NN.. LLiissttaaddoo ddee eejjeemmpplloo ddee ddiirreeccttoorriiooss ddeell ddiissccoo uuttiilliiddaaddeess.. total 579 -rwxr-xr-x 1 root root 42333 Jul 28 19:05 cpio* -rwxr-xr-x 1 root root 32844 Aug 28 19:50 debugfs* -rwxr-xr-x 1 root root 103560 Jul 29 21:31 elvis* -rwxr-xr-x 1 root root 29536 Jul 28 19:04 fdisk* -rw-r--r-- 1 root root 128254 Jul 28 19:03 ftape.o -rwxr-xr-x 1 root root 17564 Jul 25 03:21 ftmt* -rwxr-xr-x 1 root root 64161 Jul 29 20:47 grep* -rwxr-xr-x 1 root root 45309 Jul 29 20:48 gzip* -rwxr-xr-x 1 root root 23560 Jul 28 19:04 insmod* -rwxr-xr-x 1 root root 118 Jul 28 19:04 lsmod* lrwxrwxrwx 1 root root 5 Jul 28 19:04 mt -> mt-st* -rwxr-xr-x 1 root root 9573 Jul 28 19:03 mt-st* lrwxrwxrwx 1 root root 6 Jul 28 19:05 rmmod -> insmod* -rwxr-xr-x 1 root root 104085 Jul 28 19:05 tar* lrwxrwxrwx 1 root root 5 Jul 29 21:35 vi -> elvis*