This file is indexed.

/usr/share/bibledit-gtk/site/gtk/tutorials/collaboration/2reposetup/usb-flash-drive-repository-setup.html is in bibledit-gtk-data 4.9-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="../../../../bibledit.css" rel="stylesheet" type="text/css" /><!-- 

Copyright (©) 2003-2011 Teus Benschop and Contributors to the Wiki.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts.  A copy of the license is included in the section entitled "GNU
Free Documentation License" in the file FDL.

-->
    <title></title>
  </head>
  <body>
    <div id="menu">
      <ul>
        <li>
          <a href="../../../../home.html">1 Bibledit</a>
        </li>
        <li>
          <a href="../2reposetup.html">2reposetup</a>
        </li>
        <li style="list-style: none; display: inline">
          <hr />
        </li>
        <li>
          <a href="open-network-repository-setup.html">Open network repository setup</a>
        </li>
        <li>
          <a href="secure-network-repository-setup.html">Secure network repository setup</a>
        </li>
        <li>
          <a href="secure-shell-keys-setup.html">Secure shell keys setup</a>
        </li>
        <li>USB flash drive repository setup
        </li>
      </ul>
    </div>
    <div id="content">
      <h1>
        USB flash drive repository setup
      </h1>
      <h3>
        <a name="TOC-Introduction" href="" id="TOC-Introduction"></a>Introduction
      </h3>
      <p>
        In this document we will set up a repository on a USB flash drive, also called a USB stick.
      </p>
      <h3>
        <a name="formattingthestick" href="" id="formattingthestick"></a>Formatting the stick
      </h3>
      <p>
        Normally a USB stick, as it comes out of the box, has been formatted with a FAT filesystem. Such a filesystem is not supported for collaboration. The stick needs to formatted to the ext3 filesystem for collaboration to work. How this is done will be described here.
      </p>
      <p>
        Insert the stick into the computer, and wait a little till it gets mounted. It is supposed to mount automatically. If it does not mount on its own, then automatic mounting needs to be set up. Setting up automatic mounting goes beyond the scope of this tutorial.
      </p>
      <p>
        In the terminal, give the command
      </p>
      <pre>
df
</pre>
      <p>
        The output of this command can be something like:
      </p>
      <pre>
Filesystem 1K-blocks      Used Available Use% Mounted on<br />/dev/sda1   93539428  76882380  11905428  87% /<br />udev           10240       104     10136   2% /dev<br />tmpfs        1038428         0   1038428   0% /dev/shm<br />/dev/hda      629742    629742         0 100% /media/cdrom0<br />/dev/sdb5  306619956 189335920 101708620  66% /media/293gig<br />/dev/sdc1  240362656  64350876 163801980  29% /media/250gb<br />/dev/sdd1    1960684    660896   1200188  36% /media/usbdisk
</pre>
      <p>
        Looking through the list of mounting points, we assume that the USB stick that was inserted mounts at /media/usbdisk. From there we can see that the device is /dev/sdd1. Once we have that information, we are ready for the next step.
      </p>
      <p>
        Before the stick can be formatted, it must be unmounted first. Issue the following command to unmount the stick:
      </p>
      <pre>
sudo umount /media/usbdisk
</pre>
      <p>
        The "sudo" in the command means that root privileges are needed to execute the command.
      </p>
      <p>
        To format the USB stick to the ext3 filesystem, issue the following command:
      </p>
      <pre>
sudo mkfs.ext3 /dev/sdd1
</pre>
      <p>
        The formatting process will be visible and at the end some information about it will be given. At this point it is important to see if no errors occurred.
      </p>
      <p>
        The formatting command is very powerful. One could even format the main drive of the computer, wiping out all information. Extreme care should be used to ensure that the USB stick is going to be formatted, and nothing else.
      </p>
      <h3>
        <a name="labellingthestick" href="" id="labellingthestick"></a>Labelling the stick
      </h3>
      <p>
        A label needs to be written to the USB stick. The reason of this is so as to make sure that this stick will always mount at the same mounting point. In this tutorial we write the label "usbstick" to it.
      </p>
      <p>
        We take it that the same device is being used as we used for formatting the stick. That is device /dev/sdd1. To write the label to the stick, issue the following two commands:
      </p>
      <pre>
sudo e2label /dev/sdd1 usbstick
</pre>
      <pre>
sync
</pre>
      <p>
        After the label has been written to it, remove the stick from the computer, and insert it again. It should now mount to the name of the label. In this case it should mount under /media/usbstick.
      </p>
      <p>
        This can be verified with command "df":
      </p>
      <pre>
df
</pre>
      <p>
        The output of this command:
      </p>
      <pre>
Filesystem 1K-blocks      Used Available Use% Mounted on<br />/dev/sda1   93539428  76882380  11905428  87% /<br />udev           10240       104     10136   2% /dev<br />tmpfs        1038428         0   1038428   0% /dev/shm<br />/dev/hda      629742    629742         0 100% /media/cdrom0<br />/dev/sdb5  306619956 189335920 101708620  66% /media/293gig<br />/dev/sdc1  240362656  64350876 163801980  29% /media/250gb<br />/dev/sdd1    1960684    660896   1200188  36% /media/usbstick
</pre>
      <p>
        This shows that it now mounts under the new name.
      </p>
      <h3>
        <a name="creatingtherepositoryonthestick" href="" id="creatingtherepositoryonthestick"></a>Creating the repository on the stick
      </h3>
      <p>
        The USB stick will hold the data repository.
      </p>
      <p>
        To make this stick fit for collaboration, there are a few steps to be taken. These steps are:
      </p>
      <p>
        1. The first step will be to create a directory for the repository, and to make that directory writable. If we assume that the stick mounts at /media/usbstick, then the command to create a directory called "repository" is:
      </p>
      <pre>
sudo mkdir /media/usbstick/repository
</pre>
      <p>
        Notice the "sudo" command, which means that this usually needs to be done by user root. If this is done by an ordinary user, permission would be denied.
      </p>
      <p>
        Once the directory for the repository is there, this directory needs to be made writable for ordinary users. This is the command:
      </p>
      <pre>
sudo chmod -R 0777 /media/usbstick/repository/
</pre>
      <p>
        Note the "sudo" again.
      </p>
      <p>
        Now it is time to check whether the USB stick is writable. We do this by trying to create a file in the repository. If this succeeds, then it is writable. Here's the command:
      </p>
      <pre>
touch /media/usbstick/repository/testfile
</pre>
      <p>
        This command should complete without errors. After that the file needs to be removed again:
      </p>
      <pre>
rm /media/usbstick/repository/testfile
</pre>
      <p>
        2. The second step is to make the USB stick the current working directory. Type:
      </p>
      <pre>
cd /media/usbstick/repository
</pre>
      <p>
        3. The next step is to create a repository on the USB stick, and to copy the data to it.
      </p>
      <p>
        To create a shared repository on the USB stick, type:
      </p>
      <pre>
git --bare init --shared
</pre>
      <p>
        Git will respond saying that an empty shared Git repository has been created.
      </p>
      <p>
        Before removing the stick, ensure that the data gets written to it, by issuing the command
      </p>
      <pre>
sync
</pre>
      <p>
        This finishes setting up the repository on the USB flash drive.
      </p>
      <h3>
        <a name="repositoryurl" href="" id="repositoryurl"></a>Repository URL
      </h3>
      <p>
        The repository that was created in this tutorial has the following URL:
      </p>
      <pre>
file:///media/usbstick/repository
</pre>
      <p>
        The users that are going to use this repository need this URL.
      </p>
    </div>
  </body>
</html>