Difference between pages "Funtoo Filesystem Guide, Part 2" and "Install/Stage3"

(Difference between pages)
 
(Installing the Stage 3 tarball)
 
Line 1: Line 1:
{{Article
+
<noinclude>
|Author=Drobbins
+
{{InstallPart|the process of installing the Stage3 tarball}}
|Previous in Series=Funtoo Filesystem Guide, Part 1
+
</noinclude>
|Next in Series=Funtoo Filesystem Guide, Part 3
+
==== Setting the Date ====
}}
+
== Using ReiserFS and Linux ==
+
  
=== Introduction ===
+
{{fancyimportant|If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date. However, if you system time is relatively close to correct, you can probably skip this step for now.}}
In this article, I'll show you how to get ReiserFS running under a typical Linux distribution. I'll also share lots of technical information on a variety of topics, such as performance considerations and more. Since I'll be covering installation first, I recommend that you read this article in its entirety before following the installation instructions. That way, you'll have all the technical notes in the back of your head as you start getting ReiserFS running on your systems, allowing you to make any necessary adjustments along the way.
+
  
=== The Search For A Good Kernel ===
+
Now is a good time to verify the date and time are correctly set to UTC. Use the <code>date</code> command to verify the date and time:
To enable ReiserFS on your system, you'll first need to find a suitable kernel. At the time this article was orginally written (way back in 2001,) finding a suitable kernel for running ReiserFS required some effort, as ReiserFS was still an experimental filesystem. However, these days ReiserFS is no longer considered to be experimental and it's quite easy to find a kernel that supports ReiserFS. Unfortunately, Red Hat has removed ReiserFS support from the official Red Hat Enterprise Linux kernel, but it available in the stock Linux kernel sources, as well as various RHEL-based kernels.
+
  
If for some reason you are using a 2.4 kernel version, try to avoid early revisions of the kernel and use something that is fairly recent, like 2.4.30 or higher.
+
<console>
 +
# ##i##date
 +
Fri Jul 15 19:47:18 UTC 2011
 +
</console>
  
=== Are You Ready? ===
+
If the date and/or time need to be corrected, do so using <code>date MMDDhhmmYYYY</code>, keeping in mind <code>hhmm</code> are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:
The first step in using ReiserFS is to make sure that your kernel has ReiserFS support available. To do this, type:
+
<pre>
+
cat /proc/filesystems
+
</pre>
+
If you see "reiserfs" listed in the resultant list, then reiserfs support is currently available. You're ready to go!
+
  
Now, what happens if you don't see ReiserFS support listed? Well, it's possible that it's actually there, but available as a kernel module and not yet loaded. To see if this is the case, first become the root user if you aren't root already, and type:
+
<console>
<pre>
+
# ##i##date 071620002011
# modprobe reiserfs
+
Fri Jul 16 20:00:00 UTC 2011
</pre>
+
</console>
Was modprobe able to load the reiserfs module? Run the <span style="color:green">cat /proc/filesystems</span> command again and see if reiserfs is in the list. If it is, great! If not, then it looks like you are going to need to either upgrade to a kernel with ReiserFS support or recompile your existing kernel, if you enjoy doing that kind of thing.
+
  
If you're up for recompiling your own kernel, here's how you'd go about enabling ReiserFS. First, type <span style="color:green">make menuconfig</span> in your kernel source tree. Under the ''Code maturity level options'' section, make sure that the ''Prompt for development and/or incomplete code/drivers'' option is enabled if you are using a 2.4 kernel. Then, head over to the ''File systems'' section, and enable ''ReiserFS support''. It's recommended that you enable ReiserFS support to be compiled directly into your kernel (not as a module.) You may enable the extra ReiserFS capabilities if you wish. Now, save your settings, compile your kernel (<span style="color:green">make dep</span> (for kernel 2.4 only); <span style="color:green">make bzImage; make modules; make modules_install</span>) and configure your boot loader to load the new ReiserFS-enabled kernel.
+
Once you have set the system clock, it's a very good idea to copy the time to the hardware clock, so it persists across reboots:
  
{{fancyimportant|It's always a good idea to save your current kernel and configure your boot loader so that you can boot with your original kernel, just in case your new kernel doesn't work.}}
+
<console>
 +
# ##i##hwclock --systohc
 +
</console>
  
=== Installing the Tools ===
+
=== Installing the Stage 3 tarball ===
Now, before you potentially reboot with a brand-new, ReiserFS-enabled kernel, we need to make sure that you have the "reiserfsprogs" tools installed. Most modern distributions will have these tools available. To determine if they are installed, run the following command as root:
+
<pre>
+
# reiserfsck
+
</pre>
+
Was it found? If so, great! This means that the reiserfsprogs are installed and available. If they aren't available, I recommend using your distribution's package manager to track down these tools and install them. Once the tools are installed, now would be a good time to reboot to enable a new ReiserFS-enabled kernel if you installed one.
+
  
=== Creating and Mounting the Filesystem ===
+
Now that filesystems are created and your hardware and system clock are set, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux.  
Once rebooted, you'll be able to create a ReiserFS filesystem on an empty partition as follows:
+
<pre>
+
# mkreiserfs /dev/sdxy
+
</pre>
+
In the above example, '''/dev/hdxy''' should be a device node corresponding to a free partition. Mount it as you would any other filesystem:
+
<pre>
+
# mkdir /mnt/reiser
+
# mount /dev/hdxy /mnt/reiser
+
</pre>
+
And, if you'd like to add a ReiserFS filesystem to your '''/etc/fstab''' file, simply set the freq and passno fields to 0, as follows:
+
<pre>
+
/dev/sdc1  /home  reiserfs  defaults  0  0
+
</pre>
+
From this point forward, your ReiserFS filesystems should act identically to their ext2 counterparts, except that you'll no longer need to worry about long fsck times, and overall performance will be much better -- especially for small files.
+
  
== ReiserFS Technical Notes ==
+
To download the correct build of Funtoo Linux for your system, head over to the [[Subarches]] page. Subarches are builds of Funtoo Linux that are designed to run on a particular type of CPU, to offer the best possible performance. They also take advantage of the instruction sets available for each CPU.
  
=== Filesystem Stability ===
+
The [[Subarches]] page lists all CPU-optimized versions of Funtoo Linux. Find the one that is appropriate for the type of CPU that your system has, and then click on its name in the first column (such as <code>corei7</code>, for example.) You will then go to a page dedicated to that subarch, and the available stage3's available for download will be listed.
  
With a modern kernel, ReiserFS is generally just as reliable as ext2 or ext3.
+
For most subarches, you will have several stage3's available to choose from. This next section will help you understand which one to pick.
As with all filesystems, a spattering of older kernels had some filesystem
+
corruption bugs in them and should be avoided. However, if you are relying on
+
your Linux distribution's selection of kernels, then you should not experience
+
any issues with ReiserFS.
+
  
=== No dump/restore ===
+
==== Which Build? ====
  
Yes, it's true; ReiserFS does not yet have a <tt>dump</tt> and <tt>restore</tt>
+
'''If you're not sure, pick <code>funtoo-current</code>.'''
implementation. If you want to user ReiserFS and happen to be a <tt>dump</tt>
+
fan, you'll have to find some alternate way of backing data. In reality, this
+
turns out to be a non-issue, since 2.4+ kernels are incompatible with
+
<tt>dump</tt> and <tt>restore</tt> in the first place. For more information on
+
the dump/kernel incompatibility, read the LKML posting by Linus Torvalds where
+
he says that &quot;Dump was a stupid program in the first place. Leave it
+
behind.&quot;
+
  
=== Performance Issues ===
+
Funtoo Linux has various different 'builds':
  
While ReiserFS generally blows the socks off ext2, ReiserFS does have a few
+
{{TableStart}}
special-case performance weaknesses. The first is sparse file performance.
+
<tr><th class="info">Build</th><th class="info">Description</th></tr>
ReiserFS sparse file performance will be significantly worse than ext2. This
+
<tr><td><code>funtoo-current</code></td><td>The most commonly-selected build of Funtoo Linux. Receives rapid updates and preferred by desktop users.</td></tr>
will change at some point, when the Namesys developers get around to optimizing
+
<tr><td><code>funtoo-stable</code></td><td>Emphasizes less-frequent package updates and trusted, reliable versions of packages over the latest versions.</td></tr>
that part of ReiserFS for ReiserFS 4. Until then, ext2 is a better solution for
+
{{TableEnd}}
applications that place heavy demands on sparse files.
+
  
=== Performance Tweaks ===
+
If you want to read more about this, have a look at [[Funtoo_Linux#What_are_the_differences_between_.27stable.27.2C_.27current.27_and_.27experimental.27_.3F|Differences between stable, current and experimental]].
  
Fortunately, there are a couple of easy general performance tweaks you can use
+
==== Which Variant? ====
to make these problems less severe. The first is to mount your ReiserFS
+
filesystem with the `noatime` mount option (a mount option that's available for
+
other filesystems as well as ReiserFS). As you probably know, UNIX systems
+
record an atime, or access time, for each object on the filesystem that gets
+
updated every time a file is read. For most people, the atime stamp isn't very
+
useful and hardly any applications (none I can think of) rely on the atime for
+
any critical task. For this reason, it can usually be safely turned off, which
+
gives a nice all-around performance boost. Generally, unless you specifically
+
know that you need atime support, you should be mounting your filesystems with
+
the noatime option. Use an `/etc/fstab` entry like this:
+
  
<pre>/dev/hdc1  /home  reiserfs  noatime  0  0</pre>
+
'''If you're not sure, pick <code>(None)</code>.'''
  
 +
Besides our "regular" stage3's (listed with a variant of <code>(None)</code>, the following variant builds are available:
  
In my first ReiserFS article, I mentioned that ReiserFS has a special feature
+
{{TableStart}}
called &quot;tail packing&quot;. In ReiserFS lingo, &quot;tails&quot; are files
+
<tr><th class="info">Variant</th><th class="info">Description</th></tr>
that are smaller than a filesystem block (4k) or the trailing portions of files
+
<tr><td>(None)</td><td>The "standard" version of Funtoo Linux</td></tr>
that don't quite fill up a complete filesystem block. ReiserFS has really
+
<tr><td><code>pure64</code></td><td>A 64-bit build that drops multilib (32-bit compatibility) support. Can be ideal for server systems.</td></tr>
excellent small-file performance because it is able to incorporate these tails
+
<tr><td><code>hardened</code></td><td>Includes PIE/SSP toolchain for enhanced security. PIE does require the use of PaX in the kernel, while SSP works with any kernel, and provides enhanced security in user-space to avoid stack-based exploits.</td></tr>
into its b*tree (its primary organizational data structure) so that they are
+
{{TableEnd}}
really close to the stat-data (ReiserFS' equivalent of an i-node). However,
+
since tails don't fill up a complete block, they can waste a lot of disk space
+
(relatively speaking, of course). To solve this problem, ReiserFS uses its
+
&quot;tail packing&quot; functionality to squish tails into as small a space as
+
possible. Generally, this allows a ReiserFS filesystem to hold around 5% more
+
than an equivalent ext2 filesystem.
+
  
=== Tail Packing Pros and Cons ===
+
==== Download the Stage3 ====
  
However, tail packing also has its disadvantages. For one, it does give you a
+
Once you have found the stage3 that you would like to download, use <code>wget</code> to download the Stage 3 tarball you have chosen to use as the basis for your new Funtoo Linux system. It should be saved to the <code>/mnt/funtoo</code> directory as follows:
small but significant performance hit. Fortunately, the ReiserFS guys
+
anticipated that some people would be willing to sacrifice around 5% of their
+
disk capacity for a little extra performance, so they created the
+
<tt>notail</tt> mount option. When a filesystem is mounted with this option,
+
tail packing will be turned off, giving you greater speed and less storage
+
capacity. In general, filesystem performance freaks mount their filesystems
+
with both <tt>notail</tt> and <tt>noatime</tt> enabled, producing a noticeable
+
performance improvement:
+
  
<pre>/dev/hdc1  /home  reiserfs  noatime,notail  0  0</pre>
+
<console># ##i##cd /mnt/funtoo
 +
# ##i##wget http://build.funtoo.org/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz
 +
</console>
  
Even if you want to save some disk space, there are times when temporarily
+
Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the <code>generic_64</code> or <code>generic_32</code> stage. Consult the [[Subarches]] page for more information.
mounting your filesystem with the <tt>notail</tt> option can be a good thing.
+
In particular, some older boot-loaders have problems loading kernels that were
+
created on a ReiserFS filesystem with tail packing enabled. If you're using a
+
LILO earlier than version 21.6, you'll have this problem. You will also have
+
problems with old versions of GRUB, which will not be able to load its
+
<tt>stage1</tt> and <tt>stage1_5</tt> files. If you're already experiencing
+
this problem, you can fix it by mounting the filesystem with the
+
<tt>notail</tt> option, moving the files to another filesystem, and then moving
+
them back. When they're recreated, they won't have tails. Also, remember that
+
you can easily remount a filesystem (with new options) without unmounting it.
+
This particular example remounts the root filesystem with the <tt>notail</tt>
+
option:
+
  
<pre># mount / -o remount,notail</pre>
+
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:
 +
<console>
 +
# ##i##tar xpf stage3-latest.tar.xz
 +
</console>
  
== Conclusion ==
+
{{important|It is very important to use <code>tar's</code> "<code>'''p'''</code>" option when extracting the Stage 3 tarball - it tells <code>tar</code> to ''preserve'' any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.}}
 
+
I've found ReiserFS to be a truly incredible filesystem, offering oodles of
+
small file performance and great (normally better than ext2) regular file
+
performance. For example, updates to source code repositories using cvs and
+
ReiserFS have been observed to complete in only fifteen seconds, where the same
+
source code tree takes about two minutes to update with ext2. ReiserFS makes
+
many peoples' lives more pleasant, and allows servers to handle large amounts
+
of simultaneous IO without thrashing hard drives and negatively affecting
+
interactive performance.
+
 
+
In future articles, I hope to take a look at Reiser4, a completely new (and
+
incompatible) version of ReiserFS which sports some interesting new
+
capabilities.
+
 
+
== Resources ==
+
Be sure to checkout the other articles in this series:
+
* [[Funtoo Filesystem Guide, Part 1|Part 1]]: Journaling and ReiserFS
+
* [[Funtoo Filesystem Guide, Part 2|Part 2]]: Using ReiserFS and Linux
+
* [[Funtoo Filesystem Guide, Part 3|Part 3]]: Tmpfs and bind mounts
+
* [[Funtoo Filesystem Guide, Part 4|Part 4]]: Introducing Ext3
+
* [[Funtoo Filesystem Guide, Part 5|Part 5]]: Ext3 in action
+
 
+
[[Category:Filesystem Guides]]
+
[[Category:Articles]]
+
{{ArticleFooter}}
+

Revision as of 07:01, December 29, 2014


Note

This is a template that is used as part of the Installation instructions which covers: the process of installing the Stage3 tarball. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.


Setting the Date

Important

If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date. However, if you system time is relatively close to correct, you can probably skip this step for now.

Now is a good time to verify the date and time are correctly set to UTC. Use the date command to verify the date and time:

# date
Fri Jul 15 19:47:18 UTC 2011

If the date and/or time need to be corrected, do so using date MMDDhhmmYYYY, keeping in mind hhmm are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:

# date 071620002011
Fri Jul 16 20:00:00 UTC 2011

Once you have set the system clock, it's a very good idea to copy the time to the hardware clock, so it persists across reboots:

# hwclock --systohc

Installing the Stage 3 tarball

Now that filesystems are created and your hardware and system clock are set, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux.

To download the correct build of Funtoo Linux for your system, head over to the Subarches page. Subarches are builds of Funtoo Linux that are designed to run on a particular type of CPU, to offer the best possible performance. They also take advantage of the instruction sets available for each CPU.

The Subarches page lists all CPU-optimized versions of Funtoo Linux. Find the one that is appropriate for the type of CPU that your system has, and then click on its name in the first column (such as corei7, for example.) You will then go to a page dedicated to that subarch, and the available stage3's available for download will be listed.

For most subarches, you will have several stage3's available to choose from. This next section will help you understand which one to pick.

Which Build?

If you're not sure, pick funtoo-current.

Funtoo Linux has various different 'builds':

BuildDescription
funtoo-currentThe most commonly-selected build of Funtoo Linux. Receives rapid updates and preferred by desktop users.
funtoo-stableEmphasizes less-frequent package updates and trusted, reliable versions of packages over the latest versions.

If you want to read more about this, have a look at Differences between stable, current and experimental.

Which Variant?

If you're not sure, pick (None).

Besides our "regular" stage3's (listed with a variant of (None), the following variant builds are available:

VariantDescription
(None)The "standard" version of Funtoo Linux
pure64A 64-bit build that drops multilib (32-bit compatibility) support. Can be ideal for server systems.
hardenedIncludes PIE/SSP toolchain for enhanced security. PIE does require the use of PaX in the kernel, while SSP works with any kernel, and provides enhanced security in user-space to avoid stack-based exploits.

Download the Stage3

Once you have found the stage3 that you would like to download, use wget to download the Stage 3 tarball you have chosen to use as the basis for your new Funtoo Linux system. It should be saved to the /mnt/funtoo directory as follows:

# cd /mnt/funtoo
# wget http://build.funtoo.org/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz

Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the generic_64 or generic_32 stage. Consult the Subarches page for more information.

Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:

# tar xpf stage3-latest.tar.xz
Important

It is very important to use tar's "p" option when extracting the Stage 3 tarball - it tells tar to preserve any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.