]> git.ipfire.org Git - thirdparty/util-linux.git/blob - disk-utils/README.bootutils-0.1
Imported from util-linux-2.5 tarball.
[thirdparty/util-linux.git] / disk-utils / README.bootutils-0.1
1 bootutils-0.1
2
3 * ALPHA RELEASE: Use at your own risk! *
4
5 * You MUST have 0.99pl10 or later kernel to make use of all of the
6 facilities of this package. If you can live without the unmount-root
7 feature, then 0.99pl9 will work. *
8
9 This is the first release of a set of utilities designed to automate
10 the management and checking of filesystems at boot time and shutdown.
11 It supports automatic and safe 'fsck' of all filesystems (including
12 root) at boot time by booting with root readonly; if the fsck succeeds
13 then root is remounted read-write and booting can continue.
14
15 Why bother?
16
17 Well, many people like to have a safe and reliable check of all their
18 filesystems during boot. This is especially true for ext2fs, because
19 all ext2fs filesystems have a special 'clean' flag which gets set when
20 the filesystem is cleaned (by e2fsck) or is unmounted cleanly, and
21 which gets unset when the filesystem is active. e2fsck can sense this
22 flag, and will skip over filesystems which are clean.
23
24 This means that e2fsck won't bother you with a laborious filesystem
25 check at each startup, as long as you always shut down cleanly; but it
26 will check your filesystems automatically if you ever have a crash,
27 because afterwards the filesystem 'clean' flags will not be set. You
28 *can* still mount an unclean filesystem, but ext2fs will give you a
29 warning and will not mark it clean when it gets unmounted.
30
31 One of the problems with automatic fsck'ing is that it is unsafe to
32 check mounted, active filesystems. The solution is to initially mount
33 only the root filesystem, and to mount it in readonly mode. In this
34 situation, fsck can run safely on all filesystems, without the danger
35 that the kernel might start conflicting with the repairs being done to
36 the filesystem.
37
38 If any repairs were done, it is unsafe to proceed any further because
39 the kernel might have cached old information about the filesystems
40 which has been updated by fsck. However, if the fsck succeeded, then
41 we can remount the root filesystem in read-write mode and proceed to
42 mount all of the other filesystems.
43
44 Finally, in order to ensure that filesystems are correctly tidied up
45 on shutdown, we need to unmount the root at shutdown. This is usually
46 done automatically; the standard Linux shutdown programs do a 'umount
47 - -a' command to unmount all mounted filesystems. You MUST have a
48 0.99pl10 or later kernel for this to work. Many versions of umount
49 explicitly do not try to unmount the root, since pre-99pl10 kernels
50 forbade this. The umount included here will unmount even the root
51 filesystem. (A special kernel trick in pl10 allows this to work by
52 keeping the filesystem alive in readonly mode after it has been tidied
53 up.)
54
55 The bootup operation of this package is invoked by the /etc/rc shell
56 script, an example of which is in mount/etc/rc. It contains the
57 following important lines:
58
59 # Check the integrity of all filesystems
60 /bin/fsck -A -a
61 # If there was a failure, drop into single-user mode.
62 if [ $? -gt 1 ] ; then
63 echo fsck failed. Please reboot.
64 sh
65 fi
66
67 # Remount the root filesystem in read-write mode
68 /etc/mount -n -o remount /dev/hda3 /
69
70 # remove /etc/mtab* so that mount will create it with a root entry
71 /bin/rm -f /etc/mtab* /etc/nologin /etc/utmp
72
73 # mount file systems in fstab (and create an entry for /)
74 # but not NFS because TCP/IP is not yet configured
75 /etc/mount -avt nonfs
76
77
78 This is the first attempt at a complete package for automated clean
79 fsck support, so you may well find that you would like a slightly
80 different behaviour. Please feel free to send me comments, bug
81 reports and improvements!
82
83
84 This package includes three separate items, shamelessly adapted from
85 other, more or less standard Linux programs.
86
87 * rdev.c: a modified rdev which is extended to allow the
88 readonly/readwrite status of the kernel image to be altered. Use
89 rdev -R <kernel> 1
90 to make the kernel mount in readonly mode. This can be overridden
91 by the use of the 'read-only' or 'read-write' keywords of the most
92 recent version of LILO.
93
94 * Mount/umount package: This was recently posted to the net, and
95 implements the '-o remount' mount option which allows filesystems to
96 be remounted. Unlike the previous post, the version included here
97 also attempts to unmount the root filesystem on 'umount -a'. I have
98 also tried to clean up the man-pages.
99
100 * fsck package: David Engel's fsck front-end. Read the README for it.
101 This package implements the 'fsck -A' command which will check all
102 filesystems in /etc/fstab automatically.
103
104 Stephen Tweedie <sct@dcs.ed.ac.uk>