summaryrefslogtreecommitdiff
path: root/sag-0.6.1-www/Invisible/sag-0.6/node45.html
blob: 80a3f00d100b8ece2c8d7a9efa3962d0601a2545 (plain)
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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>Creating a filesystem</TITLE>
<META NAME="description" CONTENT="Creating a filesystem">
<META NAME="keywords" CONTENT="sag">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="sag.css">
</HEAD>
<BODY LANG="EN" >
 <A NAME="tex2html885" HREF="node46.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html883" HREF="node41.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html877" HREF="node44.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html887" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html888" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html886" HREF="node46.html">Mounting and unmounting</A>
<B>Up:</B> <A NAME="tex2html884" HREF="node41.html">Filesystems</A>
<B> Previous:</B> <A NAME="tex2html878" HREF="node44.html">Which filesystem should be </A>
<BR> <P>
<H2><A NAME="SECTION00584000000000000000">Creating a filesystem</A></H2>
<A NAME="secmkfs">&#160;</A>
<P>
	Filesystems are created, i.e., initialized, with the <tt>mkfs</tt><A NAME="1563">&#160;</A>
	command.  There is actually a separate program for each filesystem
	type.  <tt>mkfs</tt><A NAME="1565">&#160;</A> is just a front end that runs the appropriate
	program depending on the desired filesystem type.  The type is
	selected with the <tt>-t fstype</tt> option.
<P>
	The programs called by <tt>mkfs</tt><A NAME="1567">&#160;</A> have slightly different
	command line interfaces.  
	The common and most important options are summarized below; see
	the manual pages for more.
	<BLOCKQUOTE> <DL ><DT><STRONG><TT>-t</TT> <I>fstype</I></STRONG>
<DD> Select the type of the filesystem.
	<DT><STRONG><TT>-c</TT></STRONG>
<DD> Search for bad blocks and initialize the bad
		block list accordingly.
	<DT><STRONG><TT>-l</TT> <I>filename</I></STRONG>
<DD> Read the initial bad block list
		from the file <I>filename</I>.
<P>
</DL></BLOCKQUOTE>
	To create an ext2 filesystem on a floppy, one would give the
	following commands:
		<BLOCKQUOTE> <TT>
<code>$</code> <I>fdformat -n /dev/fd0H1440 </I> <BR> 
<code>Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.</code> <BR> 
<code>Formatting ... done</code> <BR> 
<code>$</code> <I>badblocks /dev/fd0H1440 1440 &gt; bad-blocks</I> <BR> 
<code>$</code> <I>mkfs -t ext2 -l bad-blocks /dev/fd0H1440</I> <BR> 
<code>mke2fs 0.5a, 5-Apr-94 for EXT2 FS 0.5, 94/03/10</code> <BR> 
<code>360 inodes, 1440 blocks</code> <BR> 
<code>72 blocks (5.00%) reserved for the super user</code> <BR> 
<code>First data block=1</code> <BR> 
<code>Block size=1024 (log=0)</code> <BR> 
<code>Fragment size=1024 (log=0)</code> <BR> 
<code>1 block group</code> <BR> 
<code>8192 blocks per group, 8192 fragments per group</code> <BR> 
<code>360 inodes per group</code> <BR> 
<code></code><BR> 
<code>Writing inode tables: done     </code> <BR> 
<code>Writing superblocks and filesystem accounting information: done</code> <BR> 
<code>$</code>
		</TT></BLOCKQUOTE>
	First, the floppy was formatted (the <tt>-n</tt> option prevents
	validation, i.e., bad block checking).  Then bad blocks were
	searched with <tt>badblocks</tt><A NAME="1569">&#160;</A>, with the output redirected to
	a file, <tt>bad-blocks</tt>.  Finally, the filesystem was created,
	with the bad block list initialized by whatever <tt>badblocks</tt><A NAME="1571">&#160;</A>
	found.
<P>
	The <TT>-c</TT> option could have been used with <tt>mkfs</tt><A NAME="1573">&#160;</A>
	instead of <tt>badblocks</tt><A NAME="1575">&#160;</A> and a separate file.  The example
	below does that.
		<BLOCKQUOTE> <TT>
<code>$</code> <I>mkfs -t ext2 -c /dev/fd0H1440</I> <BR> 
<code>mke2fs 0.5a, 5-Apr-94 for EXT2 FS 0.5, 94/03/10</code> <BR> 
<code>360 inodes, 1440 blocks</code> <BR> 
<code>72 blocks (5.00%) reserved for the super user</code> <BR> 
<code>First data block=1</code> <BR> 
<code>Block size=1024 (log=0)</code> <BR> 
<code>Fragment size=1024 (log=0)</code> <BR> 
<code>1 block group</code> <BR> 
<code>8192 blocks per group, 8192 fragments per group</code> <BR> 
<code>360 inodes per group</code> <BR> 
<code> </code> <BR> 
<code>Checking for bad blocks (read-only test): done</code> <BR> 
<code>Writing inode tables: done     </code> <BR> 
<code>Writing superblocks and filesystem accounting information: done</code> <BR> 
<code>$ </code>
		</TT></BLOCKQUOTE>
	The <TT>-c</TT> is more convenient than a separate use of
	<tt>badblocks</tt><A NAME="1577">&#160;</A>, but <tt>badblocks</tt><A NAME="1579">&#160;</A> is necessary for checking
	after the filesystem has been created.
<P>
	The process to prepare filesystems on hard disks or partitions
	is the same as for floppies, except that the formatting isn't needed.
<P>
<HR><A NAME="tex2html885" HREF="node46.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html883" HREF="node41.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html877" HREF="node44.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html887" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html888" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html886" HREF="node46.html">Mounting and unmounting</A>
<B>Up:</B> <A NAME="tex2html884" HREF="node41.html">Filesystems</A>
<B> Previous:</B> <A NAME="tex2html878" HREF="node44.html">Which filesystem should be </A>
<P><ADDRESS>
<I>Lars Wirzenius <BR>
Sat Nov 15 02:32:11 EET 1997</I>
</ADDRESS>
</BODY>
</HTML>