|
Lines 1926-1932
Link Here
|
| 1926 |
<screen>&prompt.root; <userinput>tunefs -n enable /filesystem</userinput> |
1926 |
<screen>&prompt.root; <userinput>tunefs -n enable /filesystem</userinput> |
| 1927 |
&prompt.root; <userinput>tunefs -n disable /filesystem</userinput></screen> |
1927 |
&prompt.root; <userinput>tunefs -n disable /filesystem</userinput></screen> |
| 1928 |
|
1928 |
|
| 1929 |
<para>A filesystem cannot be modified with &man.tunefs.8; while |
1929 |
<para>A file system cannot be modified with &man.tunefs.8; while |
| 1930 |
it is mounted. A good time to enable Soft Updates is before any |
1930 |
it is mounted. A good time to enable Soft Updates is before any |
| 1931 |
partitions have been mounted, in single-user mode.</para> |
1931 |
partitions have been mounted, in single-user mode.</para> |
| 1932 |
|
1932 |
|
|
Lines 1934-1946
Link Here
|
| 1934 |
file creation and deletion, through the use of a memory cache. We |
1934 |
file creation and deletion, through the use of a memory cache. We |
| 1935 |
recommend to use Soft Updates on all of your file systems. There |
1935 |
recommend to use Soft Updates on all of your file systems. There |
| 1936 |
are two downsides to Soft Updates that you should be aware of: First, |
1936 |
are two downsides to Soft Updates that you should be aware of: First, |
| 1937 |
Soft Updates guarantees filesystem consistency in the case of a crash |
1937 |
Soft Updates guarantees file system consistency in the case of a crash |
| 1938 |
but could very easily be several seconds (even a minute!) behind |
1938 |
but could very easily be several seconds (even a minute!) behind |
| 1939 |
updating the physical disk. If your system crashes you may lose more |
1939 |
updating the physical disk. If your system crashes you may lose more |
| 1940 |
work than otherwise. Secondly, Soft Updates delays the freeing of |
1940 |
work than otherwise. Secondly, Soft Updates delays the freeing of |
| 1941 |
filesystem blocks. If you have a filesystem (such as the root |
1941 |
file system blocks. If you have a file system (such as the root |
| 1942 |
filesystem) which is almost full, performing a major update, such as |
1942 |
file system) which is almost full, performing a major update, such as |
| 1943 |
<command>make installworld</command>, can cause the filesystem to run |
1943 |
<command>make installworld</command>, can cause the file system to run |
| 1944 |
out of space and the update to fail.</para> |
1944 |
out of space and the update to fail.</para> |
| 1945 |
|
1945 |
|
| 1946 |
<sect3> |
1946 |
<sect3> |
|
Lines 1968-1974
Link Here
|
| 1968 |
or not at all. If the data blocks of a file did not find |
1968 |
or not at all. If the data blocks of a file did not find |
| 1969 |
their way out of the buffer cache onto the disk by the time |
1969 |
their way out of the buffer cache onto the disk by the time |
| 1970 |
of the crash, &man.fsck.8; is able to recognize this and |
1970 |
of the crash, &man.fsck.8; is able to recognize this and |
| 1971 |
repair the filesystem by setting the file length to |
1971 |
repair the file system by setting the file length to |
| 1972 |
0. Additionally, the implementation is clear and simple. |
1972 |
0. Additionally, the implementation is clear and simple. |
| 1973 |
The disadvantage is that meta-data changes are slow. An |
1973 |
The disadvantage is that meta-data changes are slow. An |
| 1974 |
<command>rm -r</command>, for instance, touches all the files |
1974 |
<command>rm -r</command>, for instance, touches all the files |
|
Lines 1992-2010
Link Here
|
| 1992 |
implementation is still clear and simple, so there is a low |
1992 |
implementation is still clear and simple, so there is a low |
| 1993 |
risk for bugs creeping into the code. The disadvantage is |
1993 |
risk for bugs creeping into the code. The disadvantage is |
| 1994 |
that there is no guarantee at all for a consistent state of |
1994 |
that there is no guarantee at all for a consistent state of |
| 1995 |
the filesystem. If there is a failure during an operation |
1995 |
the file system. If there is a failure during an operation |
| 1996 |
that updated large amounts of meta-data (like a power |
1996 |
that updated large amounts of meta-data (like a power |
| 1997 |
failure, or someone pressing the reset button), |
1997 |
failure, or someone pressing the reset button), |
| 1998 |
the filesystem |
1998 |
the file system |
| 1999 |
will be left in an unpredictable state. There is no opportunity |
1999 |
will be left in an unpredictable state. There is no opportunity |
| 2000 |
to examine the state of the filesystem when the system |
2000 |
to examine the state of the file system when the system |
| 2001 |
comes up again; the data blocks of a file could already have |
2001 |
comes up again; the data blocks of a file could already have |
| 2002 |
been written to the disk while the updates of the inode |
2002 |
been written to the disk while the updates of the inode |
| 2003 |
table or the associated directory were not. It is actually |
2003 |
table or the associated directory were not. It is actually |
| 2004 |
impossible to implement a <command>fsck</command> which is |
2004 |
impossible to implement a <command>fsck</command> which is |
| 2005 |
able to clean up the resulting chaos (because the necessary |
2005 |
able to clean up the resulting chaos (because the necessary |
| 2006 |
information is not available on the disk). If the |
2006 |
information is not available on the disk). If the |
| 2007 |
filesystem has been damaged beyond repair, the only choice |
2007 |
file system has been damaged beyond repair, the only choice |
| 2008 |
is to use &man.newfs.8; on it and restore it from backup. |
2008 |
is to use &man.newfs.8; on it and restore it from backup. |
| 2009 |
</para> |
2009 |
</para> |
| 2010 |
|
2010 |
|
|
Lines 2028-2034
Link Here
|
| 2028 |
might result. On the other hand, in case of a crash, all |
2028 |
might result. On the other hand, in case of a crash, all |
| 2029 |
pending meta-data operations can be quickly either rolled-back |
2029 |
pending meta-data operations can be quickly either rolled-back |
| 2030 |
or completed from the logging area after the system comes |
2030 |
or completed from the logging area after the system comes |
| 2031 |
up again, resulting in a fast filesystem startup.</para> |
2031 |
up again, resulting in a fast file system startup.</para> |
| 2032 |
|
2032 |
|
| 2033 |
<para>Kirk McKusick, the developer of Berkeley FFS, |
2033 |
<para>Kirk McKusick, the developer of Berkeley FFS, |
| 2034 |
solved this problem with Soft Updates: all pending |
2034 |
solved this problem with Soft Updates: all pending |
|
Lines 2045-2051
Link Here
|
| 2045 |
If the system crashes, this causes an implicit <quote>log |
2045 |
If the system crashes, this causes an implicit <quote>log |
| 2046 |
rewind</quote>: all operations which did not find their way |
2046 |
rewind</quote>: all operations which did not find their way |
| 2047 |
to the disk appear as if they had never happened. A |
2047 |
to the disk appear as if they had never happened. A |
| 2048 |
consistent filesystem state is maintained that appears to |
2048 |
consistent file system state is maintained that appears to |
| 2049 |
be the one of 30 to 60 seconds earlier. The |
2049 |
be the one of 30 to 60 seconds earlier. The |
| 2050 |
algorithm used guarantees that all resources in use |
2050 |
algorithm used guarantees that all resources in use |
| 2051 |
are marked as such in their appropriate bitmaps: blocks and inodes. |
2051 |
are marked as such in their appropriate bitmaps: blocks and inodes. |
|
Lines 2054-2066
Link Here
|
| 2054 |
marked as <quote>used</quote> which are actually <quote>free</quote>. |
2054 |
marked as <quote>used</quote> which are actually <quote>free</quote>. |
| 2055 |
&man.fsck.8; recognizes this situation, |
2055 |
&man.fsck.8; recognizes this situation, |
| 2056 |
and frees the resources that are no longer used. It is safe to |
2056 |
and frees the resources that are no longer used. It is safe to |
| 2057 |
ignore the dirty state of the filesystem after a crash by |
2057 |
ignore the dirty state of the file system after a crash by |
| 2058 |
forcibly mounting it with <command>mount -f</command>. In |
2058 |
forcibly mounting it with <command>mount -f</command>. In |
| 2059 |
order to free resources that may be unused, &man.fsck.8; |
2059 |
order to free resources that may be unused, &man.fsck.8; |
| 2060 |
needs to be run at a later time. This is the idea behind |
2060 |
needs to be run at a later time. This is the idea behind |
| 2061 |
the <emphasis>background fsck</emphasis>: at system startup |
2061 |
the <emphasis>background fsck</emphasis>: at system startup |
| 2062 |
time, only a <emphasis>snapshot</emphasis> of the |
2062 |
time, only a <emphasis>snapshot</emphasis> of the |
| 2063 |
filesystem is recorded. The <command>fsck</command> can be |
2063 |
file system is recorded. The <command>fsck</command> can be |
| 2064 |
run later on. All file systems can then be mounted |
2064 |
run later on. All file systems can then be mounted |
| 2065 |
<quote>dirty</quote>, so the system startup proceeds in |
2065 |
<quote>dirty</quote>, so the system startup proceeds in |
| 2066 |
multiuser mode. Then, background <command>fsck</command>s |
2066 |
multiuser mode. Then, background <command>fsck</command>s |
|
Lines 2077-2093
Link Here
|
| 2077 |
is highly sensitive regarding loss of user data), and a |
2077 |
is highly sensitive regarding loss of user data), and a |
| 2078 |
higher memory consumption. Additionally there are some |
2078 |
higher memory consumption. Additionally there are some |
| 2079 |
idiosyncrasies one has to get used to. |
2079 |
idiosyncrasies one has to get used to. |
| 2080 |
After a crash, the state of the filesystem appears to be |
2080 |
After a crash, the state of the file system appears to be |
| 2081 |
somewhat <quote>older</quote>. In situations where |
2081 |
somewhat <quote>older</quote>. In situations where |
| 2082 |
the standard synchronous approach would have caused some |
2082 |
the standard synchronous approach would have caused some |
| 2083 |
zero-length files to remain after the |
2083 |
zero-length files to remain after the |
| 2084 |
<command>fsck</command>, these files do not exist at all |
2084 |
<command>fsck</command>, these files do not exist at all |
| 2085 |
with a Soft Updates filesystem because neither the meta-data |
2085 |
with a Soft Updates file system because neither the meta-data |
| 2086 |
nor the file contents have ever been written to disk. |
2086 |
nor the file contents have ever been written to disk. |
| 2087 |
Disk space is not released until the updates have been |
2087 |
Disk space is not released until the updates have been |
| 2088 |
written to disk, which may take place some time after |
2088 |
written to disk, which may take place some time after |
| 2089 |
running <command>rm</command>. This may cause problems |
2089 |
running <command>rm</command>. This may cause problems |
| 2090 |
when installing large amounts of data on a filesystem |
2090 |
when installing large amounts of data on a file system |
| 2091 |
that does not have enough free space to hold all the files |
2091 |
that does not have enough free space to hold all the files |
| 2092 |
twice.</para> |
2092 |
twice.</para> |
| 2093 |
</sect3> |
2093 |
</sect3> |