1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
.TH KFS 4
.SH NAME
kfs \- disk file system
.SH SYNOPSIS
.BI "mount {disk/kfs"
.RB [ -r
[
.BI -b " bsize"
] ]
.RB [ -c ]
.RB [ -A ]
.RB [ -P ]
.RB [ -R ]
.RB [ -W ]
[
.BI -n " name"
]
.IB " file" "} " dir
.SH DESCRIPTION
.I Kfs
implements a hierarchical Inferno file system within an existing
.IR file ,
which is typically a disk or flash memory partition.
It gives access to it through the 9P protocol on its standard input,
and the contents can be mounted directly on a given
.I dir
as shown above.
The file system format is the same as that used by the
.I kfs
command of Plan 9, except that the modification user ID is implemented.
.PP
The
.B -r
option causes the file system to be reset to an initially empty state
(`reamed').
Permission checking is turned off, to allow any desired permissions and
file ownership to be set.
(In other words, the
.B -W
and
.B -P
options are also set by default.)
The file system block size is set to the
.IR bsize
given by the
.B -b
option
(default: 1024 bytes),
which must be a multiple of 512 and not greater than 16k bytes.
The block size is stored in the
.I file
and need not be given again.
The storage representation is always little-endian.
.PP
Otherwise, the file system is checked if required, unless the
.B -c
option is given.
.PP
The contents of the file system can be provided by using commands
such as
.IR mkdir (1),
.IR cp (1)
and
.IR rm (1)
in
.IR dir ,
or built from a description using
.IR mkfs (8).
.PP
The mapping between user names and
internal IDs within the file system is established by the file
.BR adm/users
(within the file system itself)
as described by
.IR users (6),
which
.I kfs
reads when it starts.
If no such file exists, as for instance when the file system is initially empty,
.I kfs
uses a minimal set corresponding to the following
.IR users (6)
file:
.IP
.EX
-1:adm:adm:
0:none:adm:
9999:noworld::
10000:sys::
10001:upas:upas:
10002:bootes:bootes:
10006:inferno::
.EE
.PP
Any
.IR users (6)
file used with
.I kfs
should include entries for at least
.BR adm ,
.BR none ,
and
.BR noworld
as above (although group membership can vary).
.PP
.I Kfs
can optionally serve a control file, for use by
.IR kfscmd (8).
If the
.B -n
option is given,
.I kfs
creates a channel
.BI /chan/kfs. name .cmd
and accepts commands on it from the user that started
.IR kfs .
.PP
Other options are:
.TP
.B -A
do not update access times; useful when running a file system in flash over
.IR ftl (3),
to avoid excessive wear
.TP
.B -P
suppress permission checking
.TP
.B -R
file system is read only
.TP
.B -W
allow
.B wstat
(see
.IR sys-stat (2)
or
.IR stat (5))
to make arbitrary changes to user and group fields
.SH EXAMPLES
Create an empty file system
in the file
.BR kfs.file .
Because the file system will be no larger than the existing
file's size, and the file is assumed not to be a device file, use
.IR zeros (1)
to prepare a file with 2048 blocks of 1024 bytes each:
.IP
.EX
zeros 1024 2048 >kfs.file
mount -c {disk/kfs -r kfs.file} /n/local
.EE
.PP
The
.B -c
option to
.I mount
allows files to be created in
.BR /n/local .
.SH SOURCE
.B /appl/cmd/disk/kfs.b
.SH SEE ALSO
.IR dd (1),
.IR zeros (1),
.IR flash (3),
.IR ftl (3),
.IR logfs (3),
.IR sd (3),
.IR users (6),
.IR kfscmd (8),
.IR mkfs (8)
.SH BUGS
Because the file system format is the same as Plan 9's
.IR kfs ,
this one also does not support file names longer than 27 bytes.
It likewise cannot cope with files bigger than 2ⁱ-1 bytes.
|