STLLUG - St. Louis Linux User Group
09/21/1995 : Creating a Linux Boot/Root Diskette
Presenter: Matthew Feldt

Preparing the Boot/Root Diskette

bluenote:~# fdformat -n /dev/fd0H1440 
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.
Formatting ... done
bluenote:~# /sbin/mke2fs -c /dev/fd0
mke2fs 0.5b, 14-Feb-95 for EXT2 FS 0.5a, 94/10/23
360 inodes, 1440 blocks
72 blocks (5.00%) reserved for the super user
First data block=1
Block size=1024 (log=0)
Fragment size=1024 (log=0)
1 block group
8192 blocks per group, 8192 fragments per group
360 inodes per group

Checking for bad blocks (read-only test): done           
Writing inode tables: done     
Writing superblocks and filesystem accounting information: done
bluenote:~# mount -t ext2 /dev/fd0 /mnt
bluenote:~# cp /vmlinuz /mnt/
bluenote:~# /sbin/rdev /mnt/vmlinuz /dev/fd0
bluenote:~# /sbin/rdev -r /mnt/vmlinuz 1440    
bluenote:~# /sbin/rdev -v /mnt/vmlinuz -1
bluenote:~# /sbin/rdev -R /mnt/vmlinuz 0  # make sure root isnt read only
bluenote:~# mkdir /mnt/{mnt,proc,tmp,usr}
bluenote:~# mkdir /mnt/dev
bluenote:~# cp -dpR /dev/{fd*,hd*,sbpcd,tty?,console,kmem,mem,ram,null,zero} /mnt/dev
bluenote:~# mkdir /mnt/{bin,boot,lib,dev,sbin}
bluenote:~# mkdir -p /mnt/etc/rc.d
bluenote:~# mkdir -p /mnt/var/adm

One Possible Set of Minimum Required Directories

/binUser binaries
/bootLILO boot files
/devDevice files
/etcSystem configuration files
/etc/rc.dBoot configuration files
/libShared libraries
/mntMount point for other file systems
/procProcess pseudo filesystem
/sbinSystem administration binaries
/tmpTemporary files
/usrUser files
/varVariable files
/var/admVariable administration files

Contents of the Various Configuration Files

/etc/fstab

/dev/fd0        /               ext2    defaults
/proc           /proc           proc    defaults

/etc/inittab

#
# inittab	This file describes how the INIT process should set up
#		the system in a certain run-level.
#
# Version:	@(#)inittab		2.04	17/05/93	MvS
#
# Author:	Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#
# Default runlevel.
id:5:initdefault:

# System initialization (runs when system boots).
si:S:sysinit:/etc/rc.d/rc.S

# Script to run when going single user.
su:S:wait:/etc/rc.d/rc.K

# Script to run when going multi user.
rc:123456:wait:/etc/rc.d/rc.M

# What to do at the "Three Finger Salute".
ca::ctrlaltdel:/sbin/shutdown -t3 -rf now

# What to do when power fails (shutdown to single user).
pf::powerfail:/sbin/shutdown -f +5 "THE POWER IS FAILING"

# If power is back before shutdown, cancel the running shutdown.
pg:0123456:powerokwait:/sbin/shutdown -c "THE POWER IS BACK"

# If power comes back in single user mode, return to multi user mode.
ps:S:powerokwait:/sbin/init 5

# The getties in multi user mode on consoles an serial lines.
#
# NOTE NOTE NOTE adjust this to your getty or you will not be
#                able to login !!
#
# Note: for 'agetty' you use linespeed, line.
# for 'getty_ps' you use line, linespeed and also use 'gettydefs'
c1:12345:respawn:/sbin/agetty 38400 tty1
c2:12345:respawn:/sbin/agetty 38400 tty2
c3:45:respawn:/sbin/agetty 38400 tty3
c4:45:respawn:/sbin/agetty 38400 tty4
c5:45:respawn:/sbin/agetty 38400 tty5
c6:456:respawn:/sbin/agetty 38400 tty6

# Serial lines
#s1:45:respawn:/sbin/agetty 19200 ttyS0
#s2:45:respawn:/sbin/agetty 19200 ttyS1

# Dialup lines
#d1:45:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS0
#d2:45:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS1

# Runlevel 6 used to be for an X-window only system, until we discovered
# that it throws init into a loop that keeps your load avg at least 1 all 
# the time. Thus, there is now one getty opened on tty6. Hopefully no one
# will notice. ;^)
# It might not be bad to have one text console anyway, in case something 
# happens to X.
x1:6:wait:/etc/rc.d/rc.6

# End of /etc/inittab

/etc/lilo.conf

boot = /dev/fd0
#  compact
  install = ./boot/boot.b
  map = ./boot/map
  image = ./vmlinuz

/etc/rc.d/rc.M

#!/bin/sh
/bin/hostname boot_root

/etc/rc.d/rc.S

#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
/sbin/swapon -a
/sbin/update &
/bin/rm -f /etc/mtab* /etc/nologin /var/adm/utmp
/sbin/mount -av
/bin/cat /dev/null > /var/adm/utmp

A Recursive File Listing of the Boot/Root Disk

total 354
drwxr-xr-x   2 root     root         1024 Sep 17 08:51 bin/
drwxr-xr-x   2 root     root         1024 Sep 16 11:17 boot/
drwxr-xr-x   2 root     root         5120 Sep 17 07:26 dev/
drwxr-xr-x   3 root     root         1024 Sep 18 07:41 etc/
drwxr-xr-x   2 root     root         1024 Sep 17 08:52 lib/
drwxr-xr-x   2 root     root         1024 Sep 16 02:35 mnt/
drwxr-xr-x   2 root     root         1024 Sep 16 02:35 proc/
drwxr-xr-x   2 root     root         1024 Sep 18 07:16 sbin/
drwxr-xr-x   2 root     root         1024 Sep 16 09:35 tmp/
drwxr-xr-x   2 root     root         1024 Sep 16 02:35 usr/
drwxr-xr-x   3 root     root         1024 Sep 17 06:53 var/
-rw-r--r--   1 root     root       343044 Sep 17 08:01 vmlinuz

/mnt/bin:
total 410
-rwxr-xr-x   1 root     root       295940 Sep 17 06:36 bash*
-rwxr-xr-x   1 root     root        13312 Sep 17 07:47 cat*
-rwxr-xr-x   1 root     root        12288 Sep 17 07:47 df*
-rwxr-xr-x   1 root     root         3516 Sep 17 07:47 hostname*
-rwxr-xr-x   1 root     root         7260 Sep 17 07:47 login*
-rwxr-xr-x   1 root     root        28672 Sep 17 07:47 ls*
-rwxr-xr-x   1 root     root        16800 Sep 17 07:47 more*
-rwxr-xr-x   1 root     root        16384 Sep 17 07:47 mv*
-rwxr-xr-x   1 root     root        12292 Sep 17 07:54 rm*
lrwxrwxrwx   1 root     root            4 Sep 17 07:17 sh -> bash*
-rwxr-xr-x   1 root     root           64 Sep 17 08:51 sync*

/mnt/boot:
total 11
-rw-r--r--   1 root     root         3336 Sep 16 09:01 boot.b
-rw-------   1 root     root         6144 Sep 16 11:17 map

/mnt/dev:
total 0
crw--w--w-   1 root     tty        4,   0 Sep 16 08:23 console
brw-rw-rw-   1 root     floppy     2,   0 Jul 17  1994 fd0
brw-rw----   1 root     floppy     2,  12 Jul 17  1994 fd0D360
brw-rw----   1 root     floppy     2,  16 Jul 17  1994 fd0D720
brw-rw----   1 root     floppy     2,  28 Jul 17  1994 fd0H1440
brw-rw----   1 root     floppy     2,  32 Jul 17  1994 fd0H2880
brw-rw----   1 root     floppy     2,  12 Jul 17  1994 fd0H360
brw-rw----   1 root     floppy     2,  16 Jul 17  1994 fd0H720
brw-rw----   1 root     floppy     2,   4 Jul 17  1994 fd0d360
brw-rw----   1 root     floppy     2,   8 Jul 17  1994 fd0h1200
brw-rw----   1 root     floppy     2,  20 Jul 17  1994 fd0h360
brw-rw----   1 root     floppy     2,  24 Jul 17  1994 fd0h720
brw-rw----   1 root     floppy     2,   1 Jul 17  1994 fd1
brw-rw----   1 root     floppy     2,  13 Jul 17  1994 fd1D360
brw-rw----   1 root     floppy     2,  17 Jul 17  1994 fd1D720
brw-rw----   1 root     floppy     2,  29 Jul 17  1994 fd1H1440
brw-rw----   1 root     floppy     2,  33 Jul 17  1994 fd1H2880
brw-rw----   1 root     floppy     2,  13 Jul 17  1994 fd1H360
brw-rw----   1 root     floppy     2,  17 Jul 17  1994 fd1H720
brw-rw----   1 root     floppy     2,   5 Jul 17  1994 fd1d360
brw-rw----   1 root     floppy     2,   9 Jul 17  1994 fd1h1200
brw-rw----   1 root     floppy     2,  21 Jul 17  1994 fd1h360
brw-rw----   1 root     floppy     2,  25 Jul 17  1994 fd1h720
brw-rw----   1 root     disk      22,   0 Jul 17  1994 hd1a
brw-rw----   1 root     disk      22,   1 Jul 17  1994 hd1a1
brw-rw----   1 root     disk      22,  10 Jul 17  1994 hd1a10
brw-rw----   1 root     disk      22,  11 Jul 17  1994 hd1a11
brw-rw----   1 root     disk      22,  12 Jul 17  1994 hd1a12
brw-rw----   1 root     disk      22,   2 Jul 17  1994 hd1a2
brw-rw----   1 root     disk      22,   3 Jul 17  1994 hd1a3
brw-rw----   1 root     disk      22,   4 Jul 17  1994 hd1a4
brw-rw----   1 root     disk      22,   5 Jul 17  1994 hd1a5
brw-rw----   1 root     disk      22,   6 Jul 17  1994 hd1a6
brw-rw----   1 root     disk      22,   7 Jul 17  1994 hd1a7
brw-rw----   1 root     disk      22,   8 Jul 17  1994 hd1a8
brw-rw----   1 root     disk      22,   9 Jul 17  1994 hd1a9
brw-rw----   1 root     disk      22,  64 Jul 17  1994 hd1b
brw-rw----   1 root     disk      22,  65 Jul 17  1994 hd1b1
brw-rw----   1 root     disk      22,  74 Jul 17  1994 hd1b10
brw-rw----   1 root     disk      22,  75 Jul 17  1994 hd1b11
brw-rw----   1 root     disk      22,  76 Jul 17  1994 hd1b12
brw-rw----   1 root     disk      22,  66 Jul 17  1994 hd1b2
brw-rw----   1 root     disk      22,  67 Jul 17  1994 hd1b3
brw-rw----   1 root     disk      22,  68 Jul 17  1994 hd1b4
brw-rw----   1 root     disk      22,  69 Jul 17  1994 hd1b5
brw-rw----   1 root     disk      22,  70 Jul 17  1994 hd1b6
brw-rw----   1 root     disk      22,  71 Jul 17  1994 hd1b7
brw-rw----   1 root     disk      22,  72 Jul 17  1994 hd1b8
brw-rw----   1 root     disk      22,  73 Jul 17  1994 hd1b9
brw-rw----   1 root     disk      22, 128 Feb 15  1995 hd1c
brw-rw----   1 root     disk      22, 129 Feb 15  1995 hd1c1
brw-rw----   1 root     disk      22, 138 Feb 15  1995 hd1c10
brw-rw----   1 root     disk      22, 139 Feb 15  1995 hd1c11
brw-rw----   1 root     disk      22, 140 Feb 15  1995 hd1c12
brw-rw----   1 root     disk      22, 130 Feb 15  1995 hd1c2
brw-rw----   1 root     disk      22, 131 Feb 15  1995 hd1c3
brw-rw----   1 root     disk      22, 132 Feb 15  1995 hd1c4
brw-rw----   1 root     disk      22, 133 Feb 15  1995 hd1c5
brw-rw----   1 root     disk      22, 134 Feb 15  1995 hd1c6
brw-rw----   1 root     disk      22, 135 Feb 15  1995 hd1c7
brw-rw----   1 root     disk      22, 136 Feb 15  1995 hd1c8
brw-rw----   1 root     disk      22, 137 Feb 15  1995 hd1c9
brw-rw----   1 root     disk      22, 192 Feb 15  1995 hd1d
brw-rw----   1 root     disk      22, 193 Feb 15  1995 hd1d1
brw-rw----   1 root     disk      22, 202 Feb 15  1995 hd1d10
brw-rw----   1 root     disk      22, 203 Feb 15  1995 hd1d11
brw-rw----   1 root     disk      22, 204 Feb 15  1995 hd1d12
brw-rw----   1 root     disk      22, 194 Feb 15  1995 hd1d2
brw-rw----   1 root     disk      22, 195 Feb 15  1995 hd1d3
brw-rw----   1 root     disk      22, 196 Feb 15  1995 hd1d4
brw-rw----   1 root     disk      22, 197 Feb 15  1995 hd1d5
brw-rw----   1 root     disk      22, 198 Feb 15  1995 hd1d6
brw-rw----   1 root     disk      22, 199 Feb 15  1995 hd1d7
brw-rw----   1 root     disk      22, 200 Feb 15  1995 hd1d8
brw-rw----   1 root     disk      22, 201 Feb 15  1995 hd1d9
brw-rw----   1 root     disk       3,   0 Jul 17  1994 hda
brw-rw----   1 root     disk       3,   1 Jul 17  1994 hda1
brw-rw----   1 root     disk       3,  10 Jul 17  1994 hda10
brw-rw----   1 root     disk       3,  11 Jul 17  1994 hda11
brw-rw----   1 root     disk       3,  12 Jul 17  1994 hda12
brw-rw----   1 root     disk       3,   2 Jul 17  1994 hda2
brw-rw----   1 root     disk       3,   3 Jul 17  1994 hda3
brw-rw----   1 root     disk       3,   4 Jul 17  1994 hda4
brw-rw----   1 root     disk       3,   5 Jul 17  1994 hda5
brw-rw----   1 root     disk       3,   6 Jul 17  1994 hda6
brw-rw----   1 root     disk       3,   7 Jul 17  1994 hda7
brw-rw----   1 root     disk       3,   8 Jul 17  1994 hda8
brw-rw----   1 root     disk       3,   9 Jul 17  1994 hda9
brw-rw----   1 root     disk       3,  64 Jul 17  1994 hdb
brw-rw----   1 root     disk       3,  65 Jul 17  1994 hdb1
brw-rw----   1 root     disk       3,  74 Jul 17  1994 hdb10
brw-rw----   1 root     disk       3,  75 Jul 17  1994 hdb11
brw-rw----   1 root     disk       3,  76 Jul 17  1994 hdb12
brw-rw----   1 root     disk       3,  66 Jul 17  1994 hdb2
brw-rw----   1 root     disk       3,  67 Jul 17  1994 hdb3
brw-rw----   1 root     disk       3,  68 Jul 17  1994 hdb4
brw-rw----   1 root     disk       3,  69 Jul 17  1994 hdb5
brw-rw----   1 root     disk       3,  70 Jul 17  1994 hdb6
brw-rw----   1 root     disk       3,  71 Jul 17  1994 hdb7
brw-rw----   1 root     disk       3,  72 Jul 17  1994 hdb8
brw-rw----   1 root     disk       3,  73 Jul 17  1994 hdb9
brw-rw----   1 root     disk       3, 128 Feb 15  1995 hdc
brw-rw----   1 root     disk       3, 129 Feb 15  1995 hdc1
brw-rw----   1 root     disk       3, 138 Feb 15  1995 hdc10
brw-rw----   1 root     disk       3, 139 Feb 15  1995 hdc11
brw-rw----   1 root     disk       3, 140 Feb 15  1995 hdc12
brw-rw----   1 root     disk       3, 130 Feb 15  1995 hdc2
brw-rw----   1 root     disk       3, 131 Feb 15  1995 hdc3
brw-rw----   1 root     disk       3, 132 Feb 15  1995 hdc4
brw-rw----   1 root     disk       3, 133 Feb 15  1995 hdc5
brw-rw----   1 root     disk       3, 134 Feb 15  1995 hdc6
brw-rw----   1 root     disk       3, 135 Feb 15  1995 hdc7
brw-rw----   1 root     disk       3, 136 Feb 15  1995 hdc8
brw-rw----   1 root     disk       3, 137 Feb 15  1995 hdc9
brw-rw----   1 root     disk       3, 192 Feb 15  1995 hdd
brw-rw----   1 root     disk       3, 193 Feb 15  1995 hdd1
brw-rw----   1 root     disk       3, 202 Feb 15  1995 hdd10
brw-rw----   1 root     disk       3, 203 Feb 15  1995 hdd11
brw-rw----   1 root     disk       3, 204 Feb 15  1995 hdd12
brw-rw----   1 root     disk       3, 194 Feb 15  1995 hdd2
brw-rw----   1 root     disk       3, 195 Feb 15  1995 hdd3
brw-rw----   1 root     disk       3, 196 Feb 15  1995 hdd4
brw-rw----   1 root     disk       3, 197 Feb 15  1995 hdd5
brw-rw----   1 root     disk       3, 198 Feb 15  1995 hdd6
brw-rw----   1 root     disk       3, 199 Feb 15  1995 hdd7
brw-rw----   1 root     disk       3, 200 Feb 15  1995 hdd8
brw-rw----   1 root     disk       3, 201 Feb 15  1995 hdd9
crw-r-----   1 root     mem        1,   2 Sep 17 07:23 kmem
crw-rw----   1 root     mem        1,   1 Sep 17 07:23 mem
crw-rw-rw-   1 root     mem        1,   3 Sep 17 07:22 null
brw-rw----   1 root     disk       1,   0 Sep 17 07:24 ram
brw-rw-rw-   1 root     disk      25,   0 Jul 18  1994 sbpcd
crw-rw-rw-   1 root     tty        5,   0 Jul 17  1994 tty
crw--w--w-   1 root     tty        4,   0 Jul 17  1994 tty0
crw--w--w-   1 root     tty        4,   1 Sep 16 08:23 tty1
crw--w--w-   1 root     tty        4,   2 Sep 16 08:23 tty2
crw--w--w-   1 root     tty        4,   3 Sep 16 08:23 tty3
crw--w--w-   1 root     tty        4,   4 Sep 16 08:23 tty4
crw--w--w-   1 root     tty        4,   5 Sep 16 08:23 tty5
crw--w--w-   1 root     tty        4,   6 Sep 16 08:23 tty6
crw-rw-rw-   1 root     tty        4,   7 Jul 17  1994 tty7
crw-rw-rw-   1 root     tty        4,   8 Jul 17  1994 tty8
crw-rw-rw-   1 root     tty        4,   9 Jul 18  1994 tty9
crw-rw-rw-   1 root     mem        1,   5 Sep 17 07:22 zero

/mnt/etc:
total 9
-rw-r--r--   1 root     root           98 Sep 16 11:33 fstab
-rw-r--r--   1 root     root          271 Sep 16 12:36 group
-rw-r--r--   1 root     root         2038 Sep 16 12:26 inittab
-rw-r--r--   1 root     root           92 Sep 16 11:16 lilo.conf
-rw-r--r--   1 root     root          495 Sep 17 07:29 passwd
drwxr-xr-x   2 root     root         1024 Sep 17 07:10 rc.d/
-rw-r--r--   1 root     root           86 Sep 17 06:53 securetty
-rw-------   1 root     root          671 Sep 17 07:31 termcap
lrwxrwxrwx   1 root     root           15 Sep 17 06:54 utmp -> ../var/adm/utmp
lrwxrwxrwx   1 root     root           15 Sep 17 06:54 wtmp -> ../var/adm/wtmp

/mnt/etc/rc.d:
total 2
-rwxr-xr--   1 root     root           34 Sep 17 07:42 rc.M*
-rwxr-xr--   1 root     root          176 Sep 17 07:53 rc.S*

/mnt/lib:
total 460
-rwxr-xr-x   1 root     root        20484 Sep 16 09:17 ld.so*
lrwxrwxrwx   1 root     root           14 Sep 17 06:52 libc.so.4 -> libc.so.4.6.27*
-rwxr-xr-x   1 root     root       634880 Sep 16 09:23 libc.so.4.6.27*
lrwxrwxrwx   1 root     root           14 Sep 17 08:52 libm.so.4 -> libm.so.4.6.27*
-rwxr-xr-x   1 root     root       110592 Sep 17 08:51 libm.so.4.6.27*

/mnt/mnt:
total 0

/mnt/proc:
total 0

/mnt/sbin:
total 100
-rwxr-xr-x   1 root     root         6788 Sep 17 07:20 agetty*
-rwxr-xr-x   1 root     root        13316 Sep 17 08:20 bdflush*
-rwxr-xr-x   1 root     root         9220 Sep 18 07:14 halt*
-rwxr-xr-x   1 root     root        17408 Sep 17 07:28 init*
-rwsr-xr-x   1 root     root        18524 Sep 17 07:20 mount*
lrwxrwxrwx   1 root     root            4 Sep 18 07:16 reboot -> halt*
-rwxr-xr-x   1 root     root        13316 Sep 17 08:47 shutdown*
-rwxr-xr-x   1 root     root         2424 Sep 17 07:20 swapoff*
-rwxr-xr-x   1 root     root         2424 Sep 17 07:20 swapon*
-rwsr-xr-x   1 root     root         8888 Sep 18 07:16 umount*
lrwxrwxrwx   1 root     root            7 Sep 17 08:21 update -> bdflush*

/mnt/tmp:
total 0

/mnt/usr:
total 0

/mnt/var:
total 1
drwxr-xr-x   2 root     root         1024 Sep 17 06:54 adm/

/mnt/var/adm:
total 0
-rw-r--r--   1 root     root            0 Sep 17 06:54 utmp
-rw-r--r--   1 root     root            0 Sep 17 06:54 wtmp

Disk Usage by Directory

1       ./mnt
1       ./proc
1       ./tmp
1       ./usr
1       ./var/adm
2       ./var
3       ./etc/rc.d
5       ./dev
12      ./boot
12      ./etc
101     ./sbin
411     ./bin
461     ./lib
1350    .