File: Yard_doc-14.html

package info (click to toggle)
yard 1.17.patch1-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 600 kB
  • ctags: 74
  • sloc: perl: 1,729; sh: 250; makefile: 176; asm: 32
file content (104 lines) | stat: -rw-r--r-- 3,122 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7">
 <TITLE>Yard Documentation: Using a loopback device</TITLE>
 <LINK HREF="Yard_doc-13.html" REL=previous>
 <LINK HREF="Yard_doc.html#toc14" REL=contents>
</HEAD>
<BODY>
Next
<A HREF="Yard_doc-13.html">Previous</A>
<A HREF="Yard_doc.html#toc14">Contents</A>
<HR>
<H2><A NAME="loopback"></A> <A NAME="s14">14. Using a loopback device</A></H2>

<P>
<P>A loopback device allows a normal disk file to be mounted as a filesystem.
Depending on how much physical memory you have, using a loopback device may
be preferable to using /dev/ram0 for building a root filesystem with Yard.
<P>To use a loopback device you'll need to do the following:
<BLOCKQUOTE>Thanks to Roderich Schupp for some of this information.</BLOCKQUOTE>
<P>
<OL>
<LI>Enable loopback device support in your kernel if you haven't
already.  Under <EM>Floppy, IDE and other block devices</EM>, select
either Y or M for <EM>Loopback device support</EM>.  Recompile your
kernel and reboot.
</LI>
<LI>Check your 
<BLOCKQUOTE>
mount
</BLOCKQUOTE>
 manpage to see if it supports
loopback devices.  If it doesn't, you'll need modified versions of
mount and losetup.  These are available from:

<BLOCKQUOTE>
<A HREF="ftp://ftp.win.tue.nl:/pub/linux/util/">ftp://ftp.win.tue.nl:/pub/linux/util/</A></BLOCKQUOTE>


in the file <CODE>mount-2.5X.tar.gz</CODE>, where X is the latest
version letter. 
</LI>
<LI> You'll also probably need mke2fs 1.02 or later.  Check the manpage for
<CODE>mke2fs</CODE>;  if there is no ``-F'' option listed, you'll need a
newer version.  mke2fs is included in the e2fsprogs package
available in:
<BLOCKQUOTE><CODE>
<PRE>
                sunsite.unc.edu:/pub/Linux/system/Filesystems/ext2/
        
</PRE>
</CODE></BLOCKQUOTE>

</LI>
</OL>
<P>To use the loopback device/file with Yard, simply:
<P>
<OL>
<LI>In Config.pl, set $device to the name of a temporary disk file
to hold the disk image, eg /tmp/fsfile.  The file need not
already exist.  Set $fs_size to its desired size.
</LI>
<LI>Create the $device file:
<BLOCKQUOTE><CODE>
<PRE>
        create_loopback_file
</PRE>
</CODE></BLOCKQUOTE>



or do it yourself with:

<BLOCKQUOTE><CODE>
<PRE>
        dd if=/dev/zero of=$device bs=1k count=$fs_size
</PRE>
</CODE></BLOCKQUOTE>


and substitute your values for $device and
$fs_size.
</LI>
<LI>If necessary, load the loopback device module (via <CODE>insmod
loop</CODE>) into your kernel.
</LI>
</OL>
<P>Yard may then be run with no further alterations.
<P><EM>Warning:</EM> When using a loopback device, occasionally the ext2
filesystem seems to get corrupted for no apparent reason.  If you start
getting errors in the middle of <CODE>make_root_fs</CODE> from sys()
complaining that a directory doesn't exist, this may be what is happening.
I don't know why this happens and I can't reproduce it consistently;
however, unmounting, deleting and re-creating the file seems to get rid of
the problem.
<P>
<P>
<HR>
Next
<A HREF="Yard_doc-13.html">Previous</A>
<A HREF="Yard_doc.html#toc14">Contents</A>
</BODY>
</HTML>