
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.funtoo.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.funtoo.org/api.php?action=feedcontributions&amp;user=Palica&amp;feedformat=atom</id>
		<title>Funtoo Linux - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.funtoo.org/api.php?action=feedcontributions&amp;user=Palica&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Special:Contributions/Palica"/>
		<updated>2013-05-24T09:45:26Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.20.6</generator>

	<entry>
		<id>http://www.funtoo.org/wiki/Welcome</id>
		<title>Welcome</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Welcome"/>
				<updated>2013-03-21T08:14:25Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: Undo revision 8979 by Khezaltulaiz101 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; width: 35%&amp;quot;&amp;gt;&lt;br /&gt;
{{#widget:Donate|blurb=Your support helps Funtoo grow! Donate Today.}}&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxy&amp;quot;&amp;gt;&lt;br /&gt;
== Get on the UserMap! ==&lt;br /&gt;
{{#compound_query:[[Category:People]] [[Role type::Staff]];?Geoloc;icon=Purplemarker.png&lt;br /&gt;
    |[[Category:People]][[Role type::Contributor]];?Geoloc;icon=Orangemarker.png&lt;br /&gt;
    |[[Category:People]][[Role type::User]];?Geoloc;icon=Greenmarker.png&lt;br /&gt;
    |format=googlemaps3|height=275|zoom=1|type=hybrid|markercluster=yes}}&lt;br /&gt;
See our full-size [[Usermap]] and find out how to become part of the Funtoo Universe!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{Litecoin|blurb=Check it out: Mine litecoins for Funtoo!}}&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxy&amp;quot;&amp;gt;&lt;br /&gt;
=== Latest Commits: ===&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;feed entries=7 url=&amp;quot;https://github.com/funtoo/funtoo-overlay/commits/master.atom&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[{PERMALINK} &amp;lt;nowiki&amp;gt;{TITLE}&amp;lt;/nowiki&amp;gt;]&lt;br /&gt;
&amp;lt;/feed&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxy&amp;quot;&amp;gt;&lt;br /&gt;
=== Featured Resources: ===&lt;br /&gt;
&amp;lt;DynamicPageList&amp;gt;&lt;br /&gt;
category = Featured&lt;br /&gt;
&amp;lt;/DynamicPageList&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxy2&amp;quot;&amp;gt;&lt;br /&gt;
=== [[image:Feed-icon-28x28.png|link=http://forums.funtoo.org/extern.php?action=feed&amp;amp;type=atom]] Latest Forum Posts ===&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;feed entries=6 url=&amp;quot;http://forums.funtoo.org/extern.php?action=feed&amp;amp;type=atom&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[{PERMALINK} &amp;lt;nowiki&amp;gt;{TITLE}&amp;lt;/nowiki&amp;gt;]&lt;br /&gt;
&amp;lt;/feed&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxy2&amp;quot;&amp;gt;&lt;br /&gt;
=== [[image:Feed-icon-28x28.png|link=http://feeds.feedburner.com/planet_larry]] Planet Larry ===&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;feed type=&amp;quot;planet&amp;quot; entries=6 url=&amp;quot;http://feeds.feedburner.com/planet_larry&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[{PERMALINK} &amp;lt;nowiki&amp;gt;{TITLE}&amp;lt;/nowiki&amp;gt;]&lt;br /&gt;
&amp;lt;/feed&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Welcome to the Funtoo Wiki! =&lt;br /&gt;
&lt;br /&gt;
[[Funtoo Linux]] is a Linux-based operating system created by [[user:Drobbins|Daniel Robbins]], the creator and former Chief Architect of Gentoo Linux. &lt;br /&gt;
&lt;br /&gt;
Funtoo Linux is a Free software, or &amp;quot;Open Source&amp;quot; operating system. All distribution source code is freely available, and it can be used and distributed free of charge.&lt;br /&gt;
&lt;br /&gt;
== Featured Video ==&lt;br /&gt;
&lt;br /&gt;
In this video, Jonathan Vasquez ([[User:Fearedbliss|fearedbliss]]) of the Funtoo Linux Core Team walks you through the process of installing Funtoo Linux with ZFS. See the [[ZFS Install Guide]] for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=MXyBamArues|width=640|height=360}}&lt;br /&gt;
&lt;br /&gt;
== Meta-Distribution, Optimized ==&lt;br /&gt;
&lt;br /&gt;
Funtoo Linux is also a ''meta''-distribution, which means that it is built automatically from source code and is customized with the functionality that ''you'' want it to have, and ''without'' the unnecessary features and &amp;quot;bloat&amp;quot; that you want to avoid. &lt;br /&gt;
&lt;br /&gt;
In addition, a Funtoo Linux system is [[Download|optimized for your CPU]], and we offer optimized versions for ''Intel Core i7'', ''Intel Atom'', ''AMD Opteron'', and other processors and architectures. &lt;br /&gt;
&lt;br /&gt;
These combination of factors work together to create an extremely high-performance and flexible computing platform -- a platform where ''you'' are in control, and your system performs optimally. We believe that Funtoo Linux is the most ideal expression of how operating system technology &amp;quot;should&amp;quot; work, and we continually strive to make it better.&lt;br /&gt;
&lt;br /&gt;
== The Gentoo Ecosystem ==&lt;br /&gt;
&lt;br /&gt;
Our [[Core Team]] is focused on advancing the state-of-the-art in Linux distributions by developing our own improvements to Gentoo Linux, while remaining compatible with the upstream changes from the Gentoo Linux project. &lt;br /&gt;
&lt;br /&gt;
We are committed to maintaining high-levels of compatibility and collaboration with the Gentoo Linux project, and challenge ourselves to innovate while providing new approaches that can be easily leveraged by the Gentoo Community. We appreciate the support we receive from members of the Gentoo Community and strive to contribute back to the larger [[Gentoo Ecosystem]].&lt;br /&gt;
&lt;br /&gt;
== Ultimate Flexibility for Developers ==&lt;br /&gt;
&lt;br /&gt;
Does your Linux distribution allow multiple versions of &amp;lt;tt&amp;gt;php&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;[[python]]&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;ruby&amp;lt;/tt&amp;gt; installed happily alongside each other? Funtoo Linux does. Are you tired of hand-building key packages from source to configure them exactly the way you want? Funtoo Linux allows you to tweak the build-time features of packages using handy things called USE variables. Other distributions are forced to either leave stuff out that you want, or include stuff you don't want.&lt;br /&gt;
&lt;br /&gt;
== Virtualization ==&lt;br /&gt;
&lt;br /&gt;
We support the [[OpenVZ]] project and build up-to-date Funtoo Linux OpenVZ containers that you can [[Download|download]]. Also see [[VagrantUp]] for a nice way to deploy VirtualBox-based Funtoo Linux systems. [[Metro]], our automated distro build tool, is capable of building OpenVZ, Linux VServer and [[Linux Containers]] (LXC) images. Funtoo Linux also makes an excellent virtualization host system for [[Xen]].&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
[[Funtoo Linux]] features native [[wikipedia:UTF-8|UTF-8]] support enabled by default, a [[wikipedia:Git (software)|git]]-based, [[Portage Tree|distributed Portage Tree]] and funtoo overlay, an enhanced [[Portage]] with more compact mini-manifest tree, automated imports of new [http://www.gentoo.org Gentoo] changes every 12 hours, [[GUID Booting Guide|GPT/GUID boot support]] and [[Boot-Update|streamlined boot configuration]], [[Funtoo Linux Networking|enhanced network configuration]], up-to-date [http://ftp.osuosl.org/pub/funtoo/funtoo-stable/ stable] and [http://ftp.osuosl.org/pub/funtoo/funtoo-current/ current] Funtoo [[Stage Tarball|stages]], all built using Funtoo's [[Metro]] build tool. We also offer Ubuntu Server, Debian, RHEL and Fedora-based [[Funtoo Linux Kernels|kernels]].&lt;br /&gt;
&lt;br /&gt;
Funtoo is currently supported on the following processor families :&lt;br /&gt;
* PC-compatible, both 32 and 64-bit (''x86-32bit'', ''x86-64bit'')&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* Learn more about [[Funtoo Linux]].&lt;br /&gt;
* Why you should [[Choose Funtoo]]: ...and how its different than other distros.&lt;br /&gt;
* Visit [[:Category:Projects|Funtoo Linux Projects]] and also look at the stuff online for [[Metro]].&lt;br /&gt;
* Learn [[:Category:Linux Core Concepts| Core Linux concepts]] from articles originally written by Daniel Robbins.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOTITLE__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
[[Category:Funtoo|*]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Rootfs_over_encrypted_lvm_over_raid-1_on_GPT</id>
		<title>Rootfs over encrypted lvm over raid-1 on GPT</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Rootfs_over_encrypted_lvm_over_raid-1_on_GPT"/>
				<updated>2013-03-21T08:13:24Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Rootfs over encrypted lvm over raid-1 on GPT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This howto describes how to setup LVM and rootfs with cryptoLUKS-encrypted raid-1 over drive with GPT &lt;br /&gt;
= Rootfs over encrypted lvm over raid-1 on GPT =&lt;br /&gt;
&lt;br /&gt;
To start read [[Rootfs_over_encrypted_lvm|Rootfs over encrypted lvm]]&lt;br /&gt;
&lt;br /&gt;
How to prepare the hard disk for GPT read [[Funtoo_Linux_Installation#GPT_Partitions|Funtoo Linux Installation on GPT_Partitions]].&lt;br /&gt;
For example, installing a new system on /dev/sdb Be careful ;) I warned you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@localhost ~]# gdisk -l /dev/sdb&lt;br /&gt;
GPT fdisk (gdisk) version 0.6.13&lt;br /&gt;
&lt;br /&gt;
Partition table scan:&lt;br /&gt;
  MBR: protective&lt;br /&gt;
  BSD: not present&lt;br /&gt;
  APM: not present&lt;br /&gt;
  GPT: present&lt;br /&gt;
&lt;br /&gt;
Found valid GPT with protective MBR; using GPT.&lt;br /&gt;
Disk /dev/sdb: 625142448 sectors, 298.1 GiB&lt;br /&gt;
Logical sector size: 512 bytes&lt;br /&gt;
Disk identifier (GUID): 67AC0F92-E033-4B53-B6C5-D99DD8F49D90&lt;br /&gt;
Partition table holds up to 128 entries&lt;br /&gt;
First usable sector is 34, last usable sector is 625142414&lt;br /&gt;
Partitions will be aligned on 2048-sector boundaries&lt;br /&gt;
Total free space is 3038 sectors (1.5 MiB)&lt;br /&gt;
&lt;br /&gt;
Number  Start (sector)    End (sector)  Size       Code  Name&lt;br /&gt;
   1            2048          206847   100.0 MiB   0700  Linux/Windows data&lt;br /&gt;
   2          206848          207871   512.0 KiB   EF02  BIOS boot partition&lt;br /&gt;
   3          208896       625142414   298.0 GiB   FD00  Linux RAID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you plan to use a raid-1 for installing only one partition (/dev/sdb3 in example) and, if successful, later add more to the mirror, issue something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you prefer to add the two final destination devices to the array in the first place, issue something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything worked well, the arrays will start synchronising immediately. You can monitor this progress by viewing at the content of /proc/mdstat :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;root@golf576:~# cat /proc/mdstat&lt;br /&gt;
Personalities : [raid1] [raid0] [raid6] [raid5] [raid4]&lt;br /&gt;
md2 : active raid1 sdb5[1] sda5[0]&lt;br /&gt;
      581595328 blocks [2/2] [UU]&lt;br /&gt;
        resync=DELAYED&lt;br /&gt;
&lt;br /&gt;
md1 : active raid1 sdb4[1] sda4[0]&lt;br /&gt;
      41942976 blocks [2/2] [UU]&lt;br /&gt;
      [&amp;gt;....................]  resync =  1.6% (691456/41942976) finish=8.9min speed=76828K/sec&lt;br /&gt;
&lt;br /&gt;
md0 : active raid1 sdb1[1] sda1[0]&lt;br /&gt;
      511936 blocks [2/2] [UU]&lt;br /&gt;
&lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
root@golf576:~#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, that's awesome, isn't it? :)&lt;br /&gt;
Even more awesome is the fact that you can immediately start using your shiny new RAID. It will finish it's sync in the background while you do changes to it's filesystem.&lt;br /&gt;
&lt;br /&gt;
= Encrypting the raid-1 =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cryptsetup -c aes-xts-plain luksFormat /dev/md0&lt;br /&gt;
cryptsetup luksOpen /dev/md0 dmcrypt_root&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further, all the same [http://docs.funtoo.org/Rootfs_over_encrypted_lvm as here]… The differences begin with the &amp;quot;Initramfs setup and configuration&amp;quot; &lt;br /&gt;
&lt;br /&gt;
To activate the raid-1 during boot to perform:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;Activating RAID device.&amp;quot;&lt;br /&gt;
if [ ! -e '/etc/mdadm.conf' ]&lt;br /&gt;
then&lt;br /&gt;
	echo &amp;quot;DEVICE /dev/sda[0-9] /dev/sdb[0-9] /dev/md[0-9]&amp;quot; &amp;gt; /etc/mdadm.conf&lt;br /&gt;
	mdadm --examine --scan --config=/etc/mdadm.conf  &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
	mdadm --assemble --scan&lt;br /&gt;
fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or use [https://github.com/slashbeast/better-initramfs better-initramfs with raid-1 mdadm support]&lt;br /&gt;
&amp;lt;pre&amp;gt;git clone https://github.com/slashbeast/better-initramfs.git&amp;lt;/pre&amp;gt;&lt;br /&gt;
This script is well documented at it's GitHub overview site (which displays the documentation from README.rst).&lt;br /&gt;
&lt;br /&gt;
= Grub2 configuration =&lt;br /&gt;
Importantly do not forget &amp;lt;pre&amp;gt;enc_root=/dev/md0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional links =&lt;br /&gt;
* [http://en.gentoo-wiki.com/wiki/RAID/Software RAID/Software]&lt;br /&gt;
* [http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml Gentoo Linux x86 with Software Raid and LVM2 Quick Install Guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Fundamentals,_Part_1</id>
		<title>Linux Fundamentals, Part 1</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Fundamentals,_Part_1"/>
				<updated>2013-03-21T08:02:45Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: Undo revision 8974 by 117.218.53.13 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Before You Start ==&lt;br /&gt;
&lt;br /&gt;
=== About this tutorial ===&lt;br /&gt;
Welcome to &amp;quot;Linux fundamentals,&amp;quot; the first of four tutorials designed to prepare you for the Linux Professional Institute's 101 exam. In this tutorial, we'll introduce you to bash (the standard Linux shell), show you how to take full advantage of standard Linux commands like ls, cp, and mv, explain inodes and hard and symbolic links, and much more. By the end of this tutorial, you'll have a solid grounding in Linux fundamentals and will even be ready to begin learning some basic Linux system administration tasks. By the end of this series of tutorials (eight in all), you'll have the knowledge you need to become a Linux Systems Administrator and will be ready to attain an LPIC Level 1 certification from the Linux Professional Institute if you so choose.&lt;br /&gt;
&lt;br /&gt;
This particular tutorial (Part 1) is ideal for those who are new to Linux, or those who want to review or improve their understanding of fundamental Linux concepts like copying and moving files, creating symbolic and hard links, and using Linux' standard text-processing commands along with pipelines and redirection. Along the way, we'll share plenty of hints, tips, and tricks to keep the tutorial meaty and practical, even for those with a good amount of previous Linux experience. For beginners, much of this material will be new, but more experienced Linux users may find this tutorial to be a great way of rounding out their fundamental Linux skills.&lt;br /&gt;
&lt;br /&gt;
For those who have taken the release 1 version of this tutorial for reasons other than LPI exam preparation, you probably don't need to take this one. However, if you do plan to take the exams, you should strongly consider reading this revised tutorial.&lt;br /&gt;
&lt;br /&gt;
== Introducing bash ==&lt;br /&gt;
=== The shell ===&lt;br /&gt;
If you've used a Linux system, you know that when you log in, you are greeted by a prompt that looks something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The particular prompt that you see may look quite different. It may contain your systems host name, the name of the current working directory, or both. But regardless of what your prompt looks like, there's one thing that's certain. The program that printed that prompt is called a &amp;quot;shell,&amp;quot; and it's very likely that your particular shell is a program called &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Are you running bash? ===&lt;br /&gt;
You can check to see if you're running &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo $SHELL&lt;br /&gt;
/bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the above line gave you an error or didn't respond similarly to our example, then you may be running a shell other than bash. In that case, most of this tutorial should still apply, but it would be advantageous for you to switch to &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; for the sake of preparing for the 101 exam.&lt;br /&gt;
&lt;br /&gt;
=== About bash ===&lt;br /&gt;
Bash, an acronym for &amp;quot;Bourne-again shell,&amp;quot; is the default shell on most Linux systems. The shell's job is to obey your commands so that you can interact with your Linux system. When you're finished entering commands, you may instruct the shell to exit or logout, at which point you'll be returned to a login prompt.&lt;br /&gt;
&lt;br /&gt;
By the way, you can also log out by pressing control-D at the bash prompt.&lt;br /&gt;
&lt;br /&gt;
=== Using &amp;quot;cd&amp;quot; ===&lt;br /&gt;
As you've probably found, staring at your bash prompt isn't the most exciting thing in the world. So, let's start using bash to navigate around our file system. At the prompt, type the following (without the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;$&amp;lt;/span&amp;gt;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We've just told bash that you want to work in /, also known as the root directory; all the directories on the system form a tree, and / is considered the top of this tree, or the root. cd sets the directory where you are currently working, also known as the &amp;quot;current working directory.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Paths ===&lt;br /&gt;
To see bash's current working directory, you can type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pwd&lt;br /&gt;
/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the above example, the / argument to &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cd&amp;lt;/span&amp;gt; is called a ''path''. It tells cd where we want to go. In particular, the / argument is an ''absolute'' path, meaning that it specifies a location relative to the root of the file system tree.&lt;br /&gt;
&lt;br /&gt;
=== Absolute paths ===&lt;br /&gt;
Here are some other absolute paths:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev&lt;br /&gt;
/usr&lt;br /&gt;
/usr/bin&lt;br /&gt;
/usr/local/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, the one thing that all absolute paths have in common is that they begin with /. With a path of /usr/local/bin, we're telling cd to enter the / directory, then the usr directory under that, and then local and bin. Absolute paths are always evaluated by starting at / first.&lt;br /&gt;
&lt;br /&gt;
=== Relative paths ===&lt;br /&gt;
The other kind of path is called a ''relative path''. &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Bash&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cd&amp;lt;/span&amp;gt;, and other commands always interpret these paths relative to the current directory. Relative paths never begin with a /. So, if we're in /usr:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /usr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we can use a relative path to change to the /usr/local/bin directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd local/bin&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/local/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using .. ===&lt;br /&gt;
Relative paths may also contain one or more .. directories. The .. directory is a special directory that points to the parent directory. So, continuing from the example above:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/local/bin&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, our current directory is now /usr/local. We were able to go &amp;quot;backwards&amp;quot; one directory, relative to the current directory that we were in.&lt;br /&gt;
&lt;br /&gt;
In addition, we can also add .. to an existing relative path, allowing us to go into a directory that's alongside one we are already in, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/local&lt;br /&gt;
$ cd ../share&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/share&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relative path examples ===&lt;br /&gt;
Relative paths can get quite complex. Here are a few examples, all without the resultant target directory displayed. Try to figure out where you'll end up after typing these commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /bin&lt;br /&gt;
$ cd ../usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ cd /usr/X11R6/bin&lt;br /&gt;
$ cd ../lib/X11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ cd /usr/bin&lt;br /&gt;
$ cd ../bin/../bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, try them out and see if you got them right :)&lt;br /&gt;
&lt;br /&gt;
=== Understanding &amp;quot;.&amp;quot; ===&lt;br /&gt;
Before we finish our coverage of cd, there are a few more things I need to mention. First, there is another special directory called ., which means &amp;quot;the current directory&amp;quot;. While this directory isn't used with the cd command, it's often used to execute some program in the current directory, as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./myprog&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the above example, the myprog executable residing in the current working directory will be executed.&lt;br /&gt;
&lt;br /&gt;
=== cd and the home directory ===&lt;br /&gt;
If we wanted to change to our home directory, we could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With no arguments, cd will change to your home directory, which is /root for the superuser and typically /home/username for a regular user. But what if we want to specify a file in our home directory? Maybe we want to pass a file argument to the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;myprog&amp;lt;/span&amp;gt; command. If the file lives in our home directory, we can type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./myprog /home/drobbins/myfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, using an absolute path like that isn't always convenient. Thankfully, we can use the ~ (tilde) character to do the same thing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./myprog ~/myfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other users' home directories ===&lt;br /&gt;
Bash will expand a lone ~ to point to your home directory, but you can also use it to point to other users' home directories. For example, if we wanted to refer to a file called fredsfile.txt in Fred's home directory, we could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./myprog ~fred/fredsfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using Linux Commands ==&lt;br /&gt;
&lt;br /&gt;
=== Introducing ls ===&lt;br /&gt;
Now, we'll take a quick look at the ls command. Very likely, you're already familiar with ls and know that typing it by itself will list the contents of the current working directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /usr&lt;br /&gt;
$ ls&lt;br /&gt;
X11R6      doc         i686-pc-linux-gnu  lib      man          sbin   ssl&lt;br /&gt;
bin        gentoo-x86  include            libexec  portage      share  tmp&lt;br /&gt;
distfiles  i686-linux  info               local    portage.old  src&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
By specifying the -a option, you can see all of the files in a directory, including hidden files: those that begin with .. As you can see in the following example, ls -a reveals the . and .. special directory links:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -a&lt;br /&gt;
.      bin        gentoo-x86         include  libexec  portage      share  tmp&lt;br /&gt;
..     distfiles  i686-linux         info     local    portage.old  src&lt;br /&gt;
X11R6  doc        i686-pc-linux-gnu  lib      man      sbin         ssl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Long directory listings ===&lt;br /&gt;
You can also specify one or more files or directories on the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls&amp;lt;/span&amp;gt; command line. If you specify a file, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls&amp;lt;/span&amp;gt; will show that file only. If you specify a directory, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls&amp;lt;/span&amp;gt; will show the ''contents'' of the directory. The -l option comes in very handy when you need to view permissions, ownership, modification time, and size information in your directory listing.&lt;br /&gt;
&lt;br /&gt;
In the following example, we use the -l option to display a full listing of my /usr directory.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -l /usr&lt;br /&gt;
drwxr-xr-x    7 root     root          168 Nov 24 14:02 X11R6&lt;br /&gt;
drwxr-xr-x    2 root     root        14576 Dec 27 08:56 bin&lt;br /&gt;
drwxr-xr-x    2 root     root         8856 Dec 26 12:47 distfiles&lt;br /&gt;
lrwxrwxrwx    1 root     root            9 Dec 22 20:57 doc -&amp;gt; share/doc&lt;br /&gt;
drwxr-xr-x   62 root     root         1856 Dec 27 15:54 gentoo-x86&lt;br /&gt;
drwxr-xr-x    4 root     root          152 Dec 12 23:10 i686-linux&lt;br /&gt;
drwxr-xr-x    4 root     root           96 Nov 24 13:17 i686-pc-linux-gnu&lt;br /&gt;
drwxr-xr-x   54 root     root         5992 Dec 24 22:30 include&lt;br /&gt;
lrwxrwxrwx    1 root     root           10 Dec 22 20:57 info -&amp;gt; share/info&lt;br /&gt;
drwxr-xr-x   28 root     root        13552 Dec 26 00:31 lib&lt;br /&gt;
drwxr-xr-x    3 root     root           72 Nov 25 00:34 libexec&lt;br /&gt;
drwxr-xr-x    8 root     root          240 Dec 22 20:57 local&lt;br /&gt;
lrwxrwxrwx    1 root     root            9 Dec 22 20:57 man -&amp;gt; share/man&lt;br /&gt;
lrwxrwxrwx    1 root     root           11 Dec  8 07:59 portage -&amp;gt; gentoo-x86/&lt;br /&gt;
drwxr-xr-x   60 root     root         1864 Dec  8 07:55 portage.old&lt;br /&gt;
drwxr-xr-x    3 root     root         3096 Dec 22 20:57 sbin&lt;br /&gt;
drwxr-xr-x   46 root     root         1144 Dec 24 15:32 share&lt;br /&gt;
drwxr-xr-x    8 root     root          328 Dec 26 00:07 src&lt;br /&gt;
drwxr-xr-x    6 root     root          176 Nov 24 14:25 ssl&lt;br /&gt;
lrwxrwxrwx    1 root     root           10 Dec 22 20:57 tmp -&amp;gt; ../var/tmp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first column displays permissions information for each item in the listing. I'll explain how to interpret this information in a bit. The next column lists the number of links to each file system object, which we'll gloss over now but return to later. The third and fourth columns list the owner and group, respectively. The fifth column lists the object size. The sixth column is the &amp;quot;last modified&amp;quot; time or &amp;quot;mtime&amp;quot; of the object. The last column is the object's name. If the file is a symbolic link, you'll see a trailing -&amp;gt; and the path to which the symbolic link points.&lt;br /&gt;
&lt;br /&gt;
=== Looking at directories ===&lt;br /&gt;
Sometimes, you'll want to look at a directory, rather than inside it. For these situations, you can specify the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; option, which will tell ls to look at any directories that it would normally look inside:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -dl /usr /usr/bin /usr/X11R6/bin ../share&lt;br /&gt;
drwxr-xr-x    4 root     root           96 Dec 18 18:17 ../share&lt;br /&gt;
drwxr-xr-x   17 root     root          576 Dec 24 09:03 /usr&lt;br /&gt;
drwxr-xr-x    2 root     root         3192 Dec 26 12:52 /usr/X11R6/bin&lt;br /&gt;
drwxr-xr-x    2 root     root        14576 Dec 27 08:56 /usr/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recursive and inode listings ===&lt;br /&gt;
So you can use &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; to look at a directory, but you can also use &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;-R&amp;lt;/span&amp;gt; to do the opposite: not just look inside a directory, but recursively look inside all the files and directories inside that directory! We won't include any example output for this option (since it's generally voluminous), but you may want to try a few &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -R&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -Rl&amp;lt;/span&amp;gt; commands to get a feel for how this works.&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;-i&amp;lt;/span&amp;gt; ls option can be used to display the inode numbers of the file system objects in the listing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -i /usr&lt;br /&gt;
   1409 X11R6        314258 i686-linux           43090 libexec        13394 sbin&lt;br /&gt;
   1417 bin            1513 i686-pc-linux-gnu     5120 local          13408 share&lt;br /&gt;
   8316 distfiles      1517 include                776 man            23779 src&lt;br /&gt;
     43 doc            1386 info                 93892 portage        36737 ssl&lt;br /&gt;
  70744 gentoo-x86     1585 lib                   5132 portage.old      784 tmp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Understanding inodes ===&lt;br /&gt;
Every object on a file system is assigned a unique index, called an inode number. This might seem trivial, but understanding inodes is essential to understanding many file system operations. For example, consider the . and .. links that appear in every directory. To fully understand what a .. directory actually is, we'll first take a look at /usr/local's inode number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -id /usr/local&lt;br /&gt;
   5120 /usr/local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The /usr/local directory has an inode number of 5120. Now, let's take a look at the inode number of /usr/local/bin/..:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -id /usr/local/bin/..&lt;br /&gt;
   5120 /usr/local/bin/..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, /usr/local/bin/.. has the same inode number as /usr/local! Here's how we can come to grips with this shocking revelation. In the past, we've considered /usr/local to be the directory itself. Now, we discover that inode 5120 is in fact the directory, and we have found two directory entries (called &amp;quot;links&amp;quot;) that point to this inode. Both /usr/local and /usr/local/bin/.. are links to inode 5120. Although inode 5120 only exists in one place on disk, multiple things link to it. Inode 5120 is the actual entry on disk.&lt;br /&gt;
&lt;br /&gt;
In fact, we can see the total number of times that inode 5120 is referenced by using the &amp;lt;pre&amp;gt;ls -dl&amp;lt;/pre&amp;gt; command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -dl /usr/local&lt;br /&gt;
drwxr-xr-x    8 root     root          240 Dec 22 20:57 /usr/local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If we take a look at the second column from the left, we see that the directory /usr/local (inode 5120) is referenced eight times. On my system, here are the various paths that reference this inode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local&lt;br /&gt;
/usr/local/.&lt;br /&gt;
/usr/local/bin/..&lt;br /&gt;
/usr/local/games/..&lt;br /&gt;
/usr/local/lib/..&lt;br /&gt;
/usr/local/sbin/..&lt;br /&gt;
/usr/local/share/..&lt;br /&gt;
/usr/local/src/..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mkdir ===&lt;br /&gt;
Let's take a quick look at the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mkdir&amp;lt;/span&amp;gt; command, which can be used to create new directories. The following example creates three new directories, tic, tac, and toe, all under /tmp:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ mkdir tic tac toe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
By default, the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mkdir&amp;lt;/span&amp;gt; command doesn't create parent directories for you; the entire path up to the next-to-last element needs to exist. So, if you want to create the directories '''won/der/ful''', you'd need to issue three separate &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mkdir&amp;lt;/span&amp;gt; commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir won/der/ful&lt;br /&gt;
mkdir: cannot create directory `won/der/ful': No such file or directory&lt;br /&gt;
$ mkdir won&lt;br /&gt;
$ mkdir won/der&lt;br /&gt;
$ mkdir won/der/ful&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, mkdir has a handy -p option that tells mkdir to create any missing parent directories, as you can see here:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir -p easy/as/pie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
All in all, pretty straightforward. To learn more about the mkdir command, type &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;man mkdir&amp;lt;/span&amp;gt; to read the manual page. This will work for nearly all commands covered here (for example, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;man ls&amp;lt;/span&amp;gt;), except for &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cd&amp;lt;/span&amp;gt;, which is built-in to bash.&lt;br /&gt;
&lt;br /&gt;
=== touch ===&lt;br /&gt;
Now, we're going to take a quick look at the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cp&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt; commands, used to copy, rename, and move files and directories. To begin this overview, we'll first use the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt; command to create a file in /tmp:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ touch copyme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The touch command updates the &amp;quot;mtime&amp;quot; of a file if it exists (recall the sixth column in &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -l&amp;lt;/span&amp;gt; output). If the file doesn't exist, then a new, empty file will be created. You should now have a '''/tmp/copyme''' file with a size of zero.&lt;br /&gt;
&lt;br /&gt;
=== echo ===&lt;br /&gt;
Now that the file exists, let's add some data to the file. We can do this using the echo command, which takes its arguments and prints them to standard output. First, the echo command by itself:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo &amp;quot;firstfile&amp;quot;&lt;br /&gt;
firstfile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, the same echo command with output redirection:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo &amp;quot;firstfile&amp;quot; &amp;gt; copyme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The greater-than sign tells the shell to write echo's output to a file called copyme. This file will be created if it doesn't exist, and will be overwritten if it does exist. By typing &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -l&amp;lt;/span&amp;gt;, we can see that the copyme file is 10 bytes long, since it contains the word firstfile and the newline character:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -l copyme&lt;br /&gt;
-rw-r--r--    1 root     root           10 Dec 28 14:13 copyme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== cat and cp ===&lt;br /&gt;
To display the contents of the file on the terminal, use the cat command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat copyme&lt;br /&gt;
firstfile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, we can use a basic invocation of the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cp&amp;lt;/span&amp;gt; command to create a copiedme file from the original copyme file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp copyme copiedme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Upon investigation, we find that they are truly separate files; their inode numbers are different:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -i copyme copiedme&lt;br /&gt;
  648284 copiedme   650704 copyme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mv ===&lt;br /&gt;
Now, let's use the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt; command to rename &amp;quot;copiedme&amp;quot; to &amp;quot;movedme&amp;quot;. The inode number will remain the same; however, the filename that points to the inode will change.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mv copiedme movedme&lt;br /&gt;
$ ls -i movedme&lt;br /&gt;
  648284 movedme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A moved file's inode number will remain the same as long as the destination file resides on the same file system as the source file. We'll take a closer look at file systems in [[Linux Fundamentals, Part 3]] of this tutorial series.&lt;br /&gt;
&lt;br /&gt;
While we're talking about &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt;, let's look at another way to use this command. &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt;, in addition to allowing us to rename files, also allows us to move one or more files to another location in the directory hierarchy. For example, to move '''/var/tmp/myfile.txt''' to '''/home/drobbins''' (which happens to be my home directory,) I could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mv /var/tmp/myfile.txt /home/drobbins&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After typing this command, myfile.txt will be moved to '''/home/drobbins/myfile.txt'''. And if '''/home/drobbins''' is on a different file system than /var/tmp, the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt; command will handle the copying of myfile.txt to the new file system and erasing it from the old file system. As you might guess, when myfile.txt is moved between file systems, the myfile.txt at the new location will have a new inode number. This is because every file system has its own independent set of inode numbers.&lt;br /&gt;
&lt;br /&gt;
We can also use the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt; command to move multiple files to a single destination directory. For example, to move myfile1.txt and myarticle3.txt to /home/drobbins, I could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mv /var/tmp/myfile1.txt /var/tmp/myarticle3.txt /home/drobbins&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating Links and Removing Files ==&lt;br /&gt;
&lt;br /&gt;
=== Hard links ===&lt;br /&gt;
We've mentioned the term &amp;quot;link&amp;quot; when referring to the relationship between directory entries (the &amp;quot;names&amp;quot; we type) and inodes (the index numbers on the underlying file system that we can usually ignore.) There are actually two kinds of links available on Linux. The kind we've discussed so far are called hard links. A given inode can have any number of hard links, and the inode will persist on the file system until all the hard links disappear. When the last hard link disappears and no program is holding the file open, Linux will delete the file automatically. New hard links can be created using the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ln&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ touch firstlink&lt;br /&gt;
$ ln firstlink secondlink&lt;br /&gt;
$ ls -i firstlink secondlink&lt;br /&gt;
  15782 firstlink    15782 secondlink&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, hard links work on the inode level to point to a particular file. On Linux systems, hard links have several limitations. For one, you can only make hard links to files, not directories. That's right; even though . and .. are system-created hard links to directories, you (even as the &amp;quot;root&amp;quot; user) aren't allowed to create any of your own. The second limitation of hard links is that they can't span file systems; which would be the case if the file systems are on separate disk partitions. This means that you can't create a link from /usr/bin/bash to /bin/bash if your / and /usr directories exist on separate disk partitions.&lt;br /&gt;
&lt;br /&gt;
=== Symbolic links ===&lt;br /&gt;
&lt;br /&gt;
In practice, symbolic links (or symlinks) are used more often than hard links. Symlinks are a special file type where the link refers to another file by name, rather than directly to the inode. Symlinks do not prevent a file from being deleted; if the target file disappears, then the symlink will just be unusable, or broken.&lt;br /&gt;
&lt;br /&gt;
A symbolic link can be created by passing the -s option to &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ln&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ln -s secondlink thirdlink&lt;br /&gt;
$ ls -l firstlink secondlink thirdlink&lt;br /&gt;
-rw-rw-r--    2 agriffis agriffis        0 Dec 31 19:08 firstlink&lt;br /&gt;
-rw-rw-r--    2 agriffis agriffis        0 Dec 31 19:08 secondlink&lt;br /&gt;
lrwxrwxrwx    1 agriffis agriffis       10 Dec 31 19:39 thirdlink -&amp;gt; secondlink&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Symbolic links can be distinguished in &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -l&amp;lt;/span&amp;gt; output from normal files in three ways. First, notice that the first column contains an l character to signify the symbolic link. Second, the size of the symbolic link is the number of characters in the target (secondlink, in this case). Third, the last column of the output displays the target filename preceded by a cute little -&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Symlinks in-depth ===&lt;br /&gt;
Symbolic links are generally more flexible than hard links. You can create a symbolic link to any type of file system object, including directories. And because the implementation of symbolic links is based on paths (not inodes), it's perfectly fine to create a symbolic link that points to an object on another physical file system; that is, a different disk partition. However, this fact can also make symbolic links tricky to understand.&lt;br /&gt;
&lt;br /&gt;
Consider a situation where we want to create a link in /tmp that points to /usr/local/bin. Should we type this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ln -s /usr/local/bin bin1&lt;br /&gt;
$ ls -l bin1&lt;br /&gt;
lrwxrwxrwx    1 root     root           14 Jan  1 15:42 bin1 -&amp;gt; /usr/local/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or alternatively:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ln -s ../usr/local/bin bin2&lt;br /&gt;
$ ls -l bin2&lt;br /&gt;
lrwxrwxrwx    1 root     root           16 Jan  1 15:43 bin2 -&amp;gt; ../usr/local/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, both symbolic links point to the same directory. However, if our second symbolic link is ever moved to another directory, it will be &amp;quot;broken&amp;quot; because of the relative path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -l bin2&lt;br /&gt;
lrwxrwxrwx    1 root     root           16 Jan  1 15:43 bin2 -&amp;gt; ../usr/local/bin&lt;br /&gt;
$ mkdir mynewdir&lt;br /&gt;
$ mv bin2 mynewdir&lt;br /&gt;
$ cd mynewdir&lt;br /&gt;
$ cd bin2&lt;br /&gt;
bash: cd: bin2: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because the directory /tmp/usr/local/bin doesn't exist, we can no longer change directories into bin2; in other words, bin2 is now broken.&lt;br /&gt;
&lt;br /&gt;
For this reason, it is sometimes a good idea to avoid creating symbolic links with relative path information. However, there are many cases where relative symbolic links come in handy. Consider an example where you want to create an alternate name for a program in /usr/bin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ls -l /usr/bin/keychain &lt;br /&gt;
-rwxr-xr-x    1 root     root        10150 Dec 12 20:09 /usr/bin/keychain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As the root user, you may want to create an alternate name for &amp;quot;keychain&amp;quot;, such as &amp;quot;kc&amp;quot;. In this example, we have root access, as evidenced by our bash prompt changing to &amp;quot;#&amp;quot;. We need root access because normal users aren't able to create files in /usr/bin. As root, we could create an alternate name for keychain as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /usr/bin&lt;br /&gt;
# ln -s /usr/bin/keychain kc&lt;br /&gt;
# ls -l keychain&lt;br /&gt;
-rwxr-xr-x    1 root     root        10150 Dec 12 20:09 /usr/bin/keychain&lt;br /&gt;
# ls -l kc       &lt;br /&gt;
lrwxrwxrwx    1 root     root           17 Mar 27 17:44 kc -&amp;gt; /usr/bin/keychain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example, we created a symbolic link called kc that points to the file /usr/bin/keychain.&lt;br /&gt;
&lt;br /&gt;
While this solution will work, it will create problems if we decide that we want to move both files, /usr/bin/keychain and /usr/bin/kc to /usr/local/bin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mv /usr/bin/keychain /usr/bin/kc /usr/local/bin&lt;br /&gt;
# ls -l /usr/local/bin/keychain&lt;br /&gt;
-rwxr-xr-x    1 root     root        10150 Dec 12 20:09 /usr/local/bin/keychain&lt;br /&gt;
# ls -l /usr/local/bin/kc&lt;br /&gt;
lrwxrwxrwx    1 root     root           17 Mar 27 17:44 kc -&amp;gt; /usr/bin/keychain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because we used an absolute path in our symbolic link, our kc symlink is still pointing to /usr/bin/keychain, which no longer exists since we moved /usr/bin/keychain to /usr/local/bin.&lt;br /&gt;
&lt;br /&gt;
That means that kc is now a broken symlink. Both relative and absolute paths in symbolic links have their merits, and you should use a type of path that's appropriate for your particular application. Often, either a relative or absolute path will work just fine. The following example would have worked even after both files were moved:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /usr/bin&lt;br /&gt;
# ln -s keychain kc&lt;br /&gt;
# ls -l kc&lt;br /&gt;
lrwxrwxrwx    1 root     root            8 Jan  5 12:40 kc -&amp;gt; keychain&lt;br /&gt;
# mv keychain kc /usr/local/bin&lt;br /&gt;
# ls -l /usr/local/bin/keychain&lt;br /&gt;
-rwxr-xr-x    1 root     root        10150 Dec 12 20:09 /usr/local/bin/keychain&lt;br /&gt;
# ls -l /usr/local/bin/kc&lt;br /&gt;
lrwxrwxrwx    1 root     root           17 Mar 27 17:44 kc -&amp;gt; keychain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, we can run the keychain program by typing /usr/local/bin/kc. /usr/local/bin/kc points to the program keychain in the same directory as kc.&lt;br /&gt;
&lt;br /&gt;
=== rm ===&lt;br /&gt;
Now that we know how to use cp, mv, and ln, it's time to learn how to remove objects from the file system. Normally, this is done with the rm command. To remove files, simply specify them on the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ touch file1 file2&lt;br /&gt;
$ ls -l file1 file2&lt;br /&gt;
-rw-r--r--    1 root     root            0 Jan  1 16:41 file1&lt;br /&gt;
-rw-r--r--    1 root     root            0 Jan  1 16:41 file2&lt;br /&gt;
$ rm file1 file2&lt;br /&gt;
$ ls -l file1 file2&lt;br /&gt;
ls: file1: No such file or directory&lt;br /&gt;
ls: file2: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that under Linux, once a file is rm'ed, it's typically gone forever. For this reason, many junior system administrators will use the -i option when removing files. The -i option tells rm to remove all files in interactive mode -- that is, prompt before removing any file. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm -i file1 file2&lt;br /&gt;
rm: remove regular empty file `file1'? y&lt;br /&gt;
rm: remove regular empty file `file2'? y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the above example, the rm command prompted whether or not the specified files should *really* be deleted. In order for them to be deleted, I had to type &amp;quot;y&amp;quot; and Enter twice. If I had typed &amp;quot;n&amp;quot;, the file would not have been removed. Or, if I had done something really wrong, I could have typed Control-C to abort the rm -i command entirely -- all before it is able to do any potential damage to my system.&lt;br /&gt;
&lt;br /&gt;
If you are still getting used to the rm command, it can be useful to add the following line to your ~/.bashrc file using your favorite text editor, and then log out and log back in. Then, any time you type rm, the bash shell will convert it automatically to an rm -i command. That way, rm will always work in interactive mode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias rm=&amp;quot;rm -i&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== rmdir ===&lt;br /&gt;
To remove directories, you have two options. You can remove all the objects inside the directory and then use &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;rmdir&amp;lt;/span&amp;gt; to remove the directory itself:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir mydir&lt;br /&gt;
$ touch mydir/file1&lt;br /&gt;
$ rm mydir/file1&lt;br /&gt;
$ rmdir mydir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This method is commonly referred to as &amp;quot;directory removal for suckers.&amp;quot; All real power users and administrators worth their salt use the much more convenient &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;rm -rf&amp;lt;/span&amp;gt; command, covered next.&lt;br /&gt;
&lt;br /&gt;
The best way to remove a directory is to use the ''recursive force'' options of the rm command to tell rm to remove the directory you specify, as well as all objects contained in the directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm -rf mydir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Generally, rm -rf is the preferred method of removing a directory tree. Be very careful when using rm -rf, since its power can be used for both good and evil :)&lt;br /&gt;
&lt;br /&gt;
== Using Wild cards ==&lt;br /&gt;
&lt;br /&gt;
=== Introducing Wild cards ===&lt;br /&gt;
In your day-to-day Linux use, there are many times when you may need to perform a single operation (such as rm) on many file system objects at once. In these situations, it can often be cumbersome to type in many files on the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm file1 file2 file3 file4 file5 file6 file7 file8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To solve this problem, you can take advantage of Linux' built-in wild card support. This support, also called &amp;quot;globbing&amp;quot; (for historical reasons), allows you to specify multiple files at once by using a wildcard pattern. Bash and other Linux commands will interpret this pattern by looking on disk and finding any files that match it. So, if you had files file1 through file8 in the current working directory, you could remove these files by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm file[1-8]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or if you simply wanted to remove all files whose names begin with file as well as any file named file, you could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm file*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The * wildcard matches any character or sequence of characters, or even &amp;quot;no character.&amp;quot; Of course, glob wildcards can be used for more than simply removing files, as we'll see in the next panel.&lt;br /&gt;
&lt;br /&gt;
=== Understanding non-matches ===&lt;br /&gt;
If you wanted to list all the file system objects in /etc beginning with g as well as any file called g, you could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -d /etc/g*&lt;br /&gt;
/etc/gconf  /etc/ggi  /etc/gimp  /etc/gnome  /etc/gnome-vfs-mime-magic  /etc/gpm  /etc/group  /etc/group-&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, what happens if you specify a pattern that doesn't match any file system objects? In the following example, we try to list all the files in /usr/bin that begin with asdf and end with jkl, including potentially the file asdfjkl:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -d /usr/bin/asdf*jkl&lt;br /&gt;
ls: /usr/bin/asdf*jkl: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here's what happened. Normally, when we specify a pattern, that pattern matches one or more files on the underlying file system, and ''bash replaces the pattern with a space-separated list of all matching objects''. However, when the pattern doesn't produce any matches, ''bash leaves the argument, wild cards and all, as-is''. So, then ls can't find the file /usr/bin/asdf*jkl and it gives us an error. The operative rule here is that ''glob patterns are expanded only if they match objects in the file system''. Otherwise they remain as is and are passed literally to the program you're calling.&lt;br /&gt;
&lt;br /&gt;
=== Wild card syntax: * and ? ===&lt;br /&gt;
Now that we've seen how globbing works, we should look at wild card syntax. You can use special characters for wild card expansion:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; will match zero or more characters. It means &amp;quot;anything can go here, including nothing&amp;quot;. Examples:&lt;br /&gt;
&lt;br /&gt;
* /etc/g* matches all files in /etc that begin with g, or a file called g.&lt;br /&gt;
* /tmp/my*1 matches all files in /tmp that begin with my and end with 1, including the file my1.&lt;br /&gt;
&lt;br /&gt;
? matches any single character. Examples:&lt;br /&gt;
&lt;br /&gt;
* myfile? matches any file whose name consists of myfile followed by a single character&lt;br /&gt;
* /tmp/notes?txt would match both /tmp/notes.txt and /tmp/notes_txt, if they exist&lt;br /&gt;
&lt;br /&gt;
=== Wild card syntax: [] ===&lt;br /&gt;
This wild card is like a ?, but it allows more specificity. To use this wild card, place any characters you'd like to match inside the []. The resultant expression will match a single occurrence of any of these characters. You can also use - to specify a range, and even combine ranges. Examples:&lt;br /&gt;
&lt;br /&gt;
* myfile[12] will match myfile1 and myfile2. The wild card will be expanded as long as at least one of these files exists in the current directory.&lt;br /&gt;
* [Cc]hange[Ll]og will match Changelog, ChangeLog, changeLog, and changelog. As you can see, using bracket wild cards can be useful for matching variations in capitalization.&lt;br /&gt;
* ls /etc/[0-9]* will list all files in /etc that begin with a number.&lt;br /&gt;
* ls /tmp/[A-Za-z]* will list all files in /tmp that begin with an upper or lower-case letter.&lt;br /&gt;
&lt;br /&gt;
The [!] construct is similar to the [] construct, except rather than matching any characters inside the brackets, it'll match any character, as long as it is not listed between the [! and ]. Example:&lt;br /&gt;
&lt;br /&gt;
* rm myfile[!9] will remove all files named myfile plus a single character, except for myfile9&lt;br /&gt;
&lt;br /&gt;
=== Wild card caveats ===&lt;br /&gt;
Here are some caveats to watch out for when using wild cards. Since bash treats wild card-related characters (?, [, ], and *) specially, you need to take special care when typing in an argument to a command that contains these characters. For example, if you want to create a file that contains the string [fo]*, the following command may not do what you want:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo [fo]* &amp;gt; /tmp/mynewfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the pattern [fo]* matches any files in the current working directory, then you'll find the names of those files inside /tmp/mynewfile.txt rather than a literal [fo]* like you were expecting. The solution? Well, one approach is to surround your characters with single quotes, which tell bash to perform absolutely no wild card expansion on them:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo '[fo]*' &amp;gt; /tmp/mynewfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using this approach, your new file will contain a literal [fo]* as expected. Alternatively, you could use backslash escaping to tell bash that [, ], and * should be treated literally rather than as wild cards:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo \[fo\]\* &amp;gt; /tmp/mynewfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Both approaches (single quotes and backslash escaping) have the same effect. Since we're talking about backslash expansion, now would be a good time to mention that in order to specify a literal \, you can either enclose it in single quotes as well, or type \\ instead (it will be expanded to \).&lt;br /&gt;
{{fancynote|Double quotes will work similarly to single quotes, but will still allow bash to do some limited expansion. Therefore, single quotes are your best bet when you are truly interested in passing literal text to a command. For more information on wild card expansion, type man 7 glob. For more information on quoting in bash, type man 8 glob and read the section titled QUOTING. If you're planning to take the LPI exams, consider this a homework assignment :)}}&lt;br /&gt;
&lt;br /&gt;
== Summary and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
Congratulations; you've reached the end of our review of Linux fundamentals! I hope that it has helped you to firm up your foundational Linux knowledge. The topics you've learned here, including the basics of bash, basic Linux commands, links, and wild cards, have laid the groundwork for our next tutorial on basic administration, in which we'll cover topics like regular expressions, ownership and permissions, user account management, and more.&lt;br /&gt;
&lt;br /&gt;
By continuing in this tutorial series, you'll soon be ready to attain your LPIC Level 1 Certification from the Linux Professional Institute. Speaking of LPIC certification, if this is something you're interested in, then we recommend that you study the Resources in the next panel, which have been carefully selected to augment the material covered in this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
Be sure to read the other articles in this series:&lt;br /&gt;
*[[Linux Fundamentals, Part 2]]&lt;br /&gt;
*[[Linux Fundamentals, Part 3]]&lt;br /&gt;
*[[Linux Fundamentals, Part 4]]&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;Bash by Example&amp;quot; article series, Daniel shows you how to use bash programming constructs to write your own bash scripts. This series (particularly Parts 1 and 2) will be good preparation for the LPIC Level 1 exam:&lt;br /&gt;
* [[Bash by Example, Part 1]]: Fundamental programming in the Bourne-again shell&lt;br /&gt;
* [[Bash by Example, Part 2]]: More bash programming fundamentals&lt;br /&gt;
* [[Bash by Example, Part 3]]: Exploring the ebuild system&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
[[Category:Linux Core Concepts]]&lt;br /&gt;
[[Category:Articles]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/ZFS_Install_Guide</id>
		<title>ZFS Install Guide</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/ZFS_Install_Guide"/>
				<updated>2013-01-22T23:10:14Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Installing Funtoo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{fancywarning|This guide is a work in progress. Expect some quirks.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial will show you how to install Funtoo on ZFS (rootfs). This tutorial is meant to be an &amp;quot;overlay&amp;quot; over the [[Funtoo_Linux_Installation|Regular Funtoo Installation]]. Follow the normal installation and only use this guide for steps 2, 3, and 8.&lt;br /&gt;
&lt;br /&gt;
{{fancyimportant|'''Since ZFS was really designed for 64 bit systems, we are only recommending and supporting 64 bit platforms and installations. We will not be supporting 32 bit platforms'''!}}&lt;br /&gt;
&lt;br /&gt;
== Setting up your environment ==&lt;br /&gt;
In order for us to install Funtoo on ZFS, you will need an environment that provides the ZFS tools. We will be downloading two things: &lt;br /&gt;
&lt;br /&gt;
# System Rescue CD, &lt;br /&gt;
# ZFS System Rescue Module (SRM)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is just a file that when combined with System Rescue CD, gives you those tools.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Name: SystemRescueCd-x86-3.2.0 (353 MiB)&lt;br /&gt;
Release Date: 2013-01-07&lt;br /&gt;
md5sum 90528f0c4b861363992fd9cbcc52d00a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/systemrescuecd/files/sysresccd-x86/3.2.0/systemrescuecd-x86-3.2.0.iso/download Download System Rescue CD 3.2.0]&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://jonathanvasquez.com/files/sysresccd/ Download the ZFS System Rescue Module]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Creating_System_Rescue_CD_Modules|Follow the instructions here to download and place the srm into your flash drive]].&lt;br /&gt;
== Creating partitions ==&lt;br /&gt;
There are two ways to partition your disk: You can use your entire drive and let ZFS automatically partition it for you, or you can do it manually.&lt;br /&gt;
&lt;br /&gt;
Using your entire disk drive is recommended since ZFS turns on/off a few settings. For one, if you use your whole-disk, ZFS will set the I/O elevator for the drive automatically. On Solaris machines, ZFS also enables the disk's write cache.&lt;br /&gt;
&lt;br /&gt;
If you partition it manually, you should set your I/O scheduler to no-op so it doesn't conflict with the ZFS scheduler. Partitioning manually also gives you the advantage of putting your /boot outside the ZFS pool so that you can use a bootloader that doesn't support booting from ZFS.&lt;br /&gt;
=== Whole Disk ===&lt;br /&gt;
This is the easiest method and the recommended method. &amp;lt;br /&amp;gt;&lt;br /&gt;
First lets make sure that the disk is completely wiped from any previous disk labels and partitions.&lt;br /&gt;
We will also assume that &amp;lt;tt&amp;gt;/dev/sda&amp;lt;/tt&amp;gt; is the target drive.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##gdisk /dev/sda&lt;br /&gt;
&lt;br /&gt;
Command: ##i##x ↵&lt;br /&gt;
Expert command: ##i##z ↵&lt;br /&gt;
About to wipe out GPT on /dev/sda. Proceed?: ##i##y ↵&lt;br /&gt;
GPT data structures destroyed! You may now partition the disk using fdisk or other utilities.&lt;br /&gt;
Blank out MBR?: ##i##y ↵&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
{{fancywarning|This is a destructive operation. Make sure you really don't want anything on this disk.}}&lt;br /&gt;
Now that we have a clean drive, we will create the new pool in it while letting zfs automatically partition it. &lt;br /&gt;
&lt;br /&gt;
Create the pool as normal:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##zpool create -f -o ashift=12 -o cachefile= -O compression=on -m none -R /mnt/funtoo rpool /dev/sda&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
Doing this will let ZFS create a GPT style disk with two partitions. We will also slightly modify this to add a BIOS Boot Partition so that grub can be installed successfully. First lets export the pool so that the kernel can use the new partition table without rebooting.&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##zpool export rpool&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And now lets create a new BIOS Boot Partition at partition 2 from sectors '''48''' to '''2047''':&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##gdisk /dev/sda&lt;br /&gt;
&lt;br /&gt;
Command (? for help): ##i##p ↵&lt;br /&gt;
&lt;br /&gt;
Number  Start (sector)    End (sector)  Size       Code  Name   &lt;br /&gt;
1            2048        16758783   8.0 GiB     BF01  zfs   &lt;br /&gt;
9        16758784        16775167   8.0 MiB     BF07 &lt;br /&gt;
&lt;br /&gt;
Command: ##i##n ↵&lt;br /&gt;
Partition number: ##i##2 ↵&lt;br /&gt;
First sector: ##i##48 ↵&lt;br /&gt;
Last sector: ##i##2047 ↵&lt;br /&gt;
Hex code or GUID: ##i##EF02 ↵&lt;br /&gt;
&lt;br /&gt;
Command: ##i##w ↵&lt;br /&gt;
Do you want to proceed? (Y/N): ##i##y&lt;br /&gt;
OK; writing new GUID partition table (GPT) to /dev/sda.&lt;br /&gt;
The operation has completed successfully.&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to check &amp;lt;tt&amp;gt;/dev/sda&amp;lt;/tt&amp;gt; again, you would see these 3 partitions:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
Number  Start (sector)    End (sector)  Size       Code  Name   &lt;br /&gt;
1            2048        16758783   8.0 GiB     BF01  zfs   &lt;br /&gt;
2              48            2047   1000.0 KiB  EF02  BIOS boot partition   &lt;br /&gt;
9        16758784        16775167   8.0 MiB     BF07&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let's import the pool again:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##zpool import -f -o cachefile= -R /mnt/funtoo rpool&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ZFS_Install_Guide#Create_the_zfs_datasets|Now continue with creating your datasets.]]&lt;br /&gt;
=== Manual partitioning ===&lt;br /&gt;
==== fdisk (MBR Style) ====&lt;br /&gt;
'''Create Partition 1''' (boot):&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
Command: ##i##n ↵&lt;br /&gt;
Partition type: ##i##↵&lt;br /&gt;
Partition number: ##i##↵&lt;br /&gt;
First sector: ##i##↵&lt;br /&gt;
Last sector: ##i##+250M ↵&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Create Partition 2''' (ZFS):&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
Command: ##i##n ↵&lt;br /&gt;
Partition type: ##i##↵&lt;br /&gt;
Partition number: ##i##↵&lt;br /&gt;
First sector: ##i##↵&lt;br /&gt;
Last sector: ##i##↵&lt;br /&gt;
&lt;br /&gt;
Command: ##i##t ↵&lt;br /&gt;
Partition number: ##i##2 ↵&lt;br /&gt;
Hex code: ##i##bf ↵&lt;br /&gt;
&lt;br /&gt;
Command: ##i##p ↵&lt;br /&gt;
&lt;br /&gt;
Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1            2048      514047      256000   83  Linux&lt;br /&gt;
/dev/sda2          514048  1953525167   976505560   bf  Solaris&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== gdisk (GPT Style) ====&lt;br /&gt;
'''Create Partition 1''' (boot):&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
Command: ##i##n ↵&lt;br /&gt;
Partition Number: ##i##↵&lt;br /&gt;
First sector: ##i##↵&lt;br /&gt;
Last sector: ##i##+250M ↵&lt;br /&gt;
Hex Code: ##i##↵&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Create Partition 2''' (BIOS Boot Partition):&lt;br /&gt;
&amp;lt;console&amp;gt;Command: ##i##n ↵&lt;br /&gt;
Partition Number: ##i##↵&lt;br /&gt;
First sector: ##i##↵&lt;br /&gt;
Last sector: ##i##+32M ↵&lt;br /&gt;
Hex Code: ##i##EF02 ↵&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
{{fancyimportant|Only make the above BIOS Boot Partition if you are using GRUB 2 on GPT. If you are using the extlinux bootloader, this partition is not necessary.}}&lt;br /&gt;
&lt;br /&gt;
'''Create Partition 2''' (ZFS):&lt;br /&gt;
&amp;lt;console&amp;gt;Command: ##i##n ↵&lt;br /&gt;
Partition Number: ##i##↵&lt;br /&gt;
First sector: ##i##↵&lt;br /&gt;
Last sector: ##i##↵&lt;br /&gt;
Hex Code: ##i##bf01 ↵&lt;br /&gt;
&lt;br /&gt;
Command: ##i##p ↵&lt;br /&gt;
&lt;br /&gt;
Number  Start (sector)    End (sector)  Size       Code  Name   &lt;br /&gt;
1            2048          514047   250.0 MiB   8300  Linux filesystem   &lt;br /&gt;
2          514048      1953525134   931.3 GiB   BF01  Solaris /usr &amp;amp; Mac ZFS&lt;br /&gt;
&lt;br /&gt;
Command: ##i##w ↵&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format your boot volume ===&lt;br /&gt;
If you did manual partitioning, format your separate boot partition:&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##mkfs.ext4 /dev/sda1&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create the zpool ===&lt;br /&gt;
We will first create the pool. The pool will be named `rpool` and the disk will be aligned to 4096 (using ashift=12)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##zpool create -f -o ashift=12 -o cachefile= -O compression=on -m none -R /mnt/funtoo rpool /dev/sda2&amp;lt;/console&amp;gt;&lt;br /&gt;
{{fancyimportant|If you followed the manual GPT partitioning instructions, you should change /dev/sda2 to /dev/sda3.}}{{fancynote|If you have a previous pool that you would like to import, you can do a: '''zpool import -f -R /mnt/funtoo &amp;lt;pool_name&amp;gt;'''}}&lt;br /&gt;
&lt;br /&gt;
=== Create the zfs datasets ===&lt;br /&gt;
We will now create some datasets. For this installation, we will create a small but future proof amount of datasets. We will have a dataset for the OS (/), and your swap. We will also show you how to create some optional datasets: /home, /var, /usr/src, and /usr/portage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
Create some empty containers for organization purposes, and make the dataset that will hold /&lt;br /&gt;
# ##i##zfs create -o mountpoint=none rpool/ROOT&lt;br /&gt;
# ##i##zfs create -o mountpoint=/ rpool/ROOT/funtoo&lt;br /&gt;
&lt;br /&gt;
Optional, but recommended datasets: /home, /root&lt;br /&gt;
# ##i##zfs create -o mountpoint=/home rpool/HOME&lt;br /&gt;
# ##i##zfs create -o mountpoint=/root rpool/HOME/root&lt;br /&gt;
&lt;br /&gt;
Optional datasets: /usr/src, /var&lt;br /&gt;
# ##i##zfs create -o mountpoint=none rpool/FUNTOO&lt;br /&gt;
# ##i##zfs create -o mountpoint=/usr/src rpool/FUNTOO/src&lt;br /&gt;
# ##i##zfs create -o mountpoint=/var rpool/FUNTOO/var&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Creating a separate portage dataset (optional) ====&lt;br /&gt;
Creating a separate portage dataset could be useful if you would like to keep your portage tree, distfiles (source code files), and packages (your compiled binaries if you have FEATURES=&amp;quot;buildpkg&amp;quot; enabled) in a safe place (or if you want to back up this directory up easily). This requires a few extra steps because we can't just do a regular emerge --sync when we initially chroot. We will need to download a portage snapshot tarball and extract it into the directory. The required steps for getting and extracting the snapshot will be shown later on in the guide once you chroot into the environment. &lt;br /&gt;
&lt;br /&gt;
For now just create the datasets:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##zfs create -o mountpoint=/usr/portage -o compression=off rpool/FUNTOO/portage&lt;br /&gt;
# ##i##zfs create -o mountpoint=/usr/portage/distfiles -o compression=off rpool/FUNTOO/distfiles&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create your swap zvol ===&lt;br /&gt;
'''Make your swap +1G greater than your RAM. An 8G machine would have 9G of RAM (This is kinda big though).'''&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##zfs create -o sync=always -o primarycache=metadata -o secondarycache=none -V 9G rpool/swap&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format your swap zvol ===&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##mkswap -f /dev/zvol/rpool/swap&lt;br /&gt;
# ##i##swapon /dev/zvol/rpool/swap&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Last minute checks and touches ===&lt;br /&gt;
Check to make sure everything appears fine:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##zpool status&lt;br /&gt;
# ##i##zfs list&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the '''zpool.cache''' file to your new environment.&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##mkdir -p /mnt/funtoo/etc/zfs&lt;br /&gt;
# ##i##cp /etc/zfs/zpool.cache /mnt/funtoo/etc/zfs&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make an empty mtab file&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##touch /mnt/funtoo/etc/mtab&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we will continue to install funtoo.&lt;br /&gt;
== Installing Funtoo ==&lt;br /&gt;
[[Funtoo_Linux_Installation|Download and install the Funtoo stage3 and continue installation as normal.]]&lt;br /&gt;
&lt;br /&gt;
Then chroot into your new funtoo environment:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##cd /mnt/funtoo&lt;br /&gt;
&lt;br /&gt;
Mount your boot drive ** You don't need to do this if you're using whole-disk zfs **&lt;br /&gt;
# ##i##mount /dev/sda1 /mnt/funtoo/boot&lt;br /&gt;
&lt;br /&gt;
Bind the kernel related directories&lt;br /&gt;
# ##i##mount --rbind /proc proc&lt;br /&gt;
# ##i##mount --rbind /dev dev&lt;br /&gt;
# ##i##mount --rbind /sys sys&lt;br /&gt;
&lt;br /&gt;
Copy network settings&lt;br /&gt;
# ##i##cp /etc/resolv.conf etc/chroot into your new funtoo environment&lt;br /&gt;
# ##i##env -i HOME=/root TERM=$TERM chroot . /bin/bash -l&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Syncing your portage tree ===&lt;br /&gt;
==== If you didn't create a separate portage dataset, then just sync your portage tree as normal. ====&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##emerge --sync&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== If you did create a separate portage dataset, let's now get the portage snapshot set up. ====&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
Change into your /usr directory&lt;br /&gt;
# ##i##cd /usr&lt;br /&gt;
&lt;br /&gt;
Download and extract the portage snapshot&lt;br /&gt;
# ##i##wget http://ftp.osuosl.org/pub/funtoo/funtoo-current/snapshots/portage-latest.tar.xz&lt;br /&gt;
# ##i##tar xf portage-latest.tar.xz&lt;br /&gt;
&lt;br /&gt;
Change into your portage directory and checkout the funtoo branch&lt;br /&gt;
# ##i##cd portage&lt;br /&gt;
# ##i##git checkout funtoo.org&lt;br /&gt;
&lt;br /&gt;
Now sync your portage tree&lt;br /&gt;
# ##i##emerge --sync&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Kernel Configuration ==&lt;br /&gt;
{{fancynote|The below configurations are the requirements for &amp;quot;Bliss Initramfs Creator&amp;quot;. Some of these might not be needed for genkernel.}}&lt;br /&gt;
&lt;br /&gt;
Tested with kernel 2.6.32, 3.2.34, 3.6.9, 3.7.[1-3].&lt;br /&gt;
&lt;br /&gt;
When you get up to the kernel, make sure that you disable the CFQ scheduler, and turn on No-op (It's the default one once you disable all schedulers). The reason for this is because ZFS has its own scheduler and the CFQ one conflicts with it. Go to your kernel config, and make sure you have the following: (there should be a /usr/src/linux symlink as well)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ZLIB_INFLATE/DEFLATE must be compiled into the kernel (not as a module).&lt;br /&gt;
&amp;gt; ZLIB_INFLATE [=y], ZLIB_DEFLATE [=y]&lt;br /&gt;
&lt;br /&gt;
General setup ---&amp;gt;&lt;br /&gt;
&amp;gt; [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support&lt;br /&gt;
&amp;gt; () Initramfs source file(s)&lt;br /&gt;
[*] Enable loadable module support ---&amp;gt;&lt;br /&gt;
[*] Module unloading&lt;br /&gt;
Enable the block layer ---&amp;gt;&lt;br /&gt;
IO Schedulers ---&amp;gt;&lt;br /&gt;
&amp;lt; &amp;gt; Deadline I/O scheduler&lt;br /&gt;
&amp;lt; &amp;gt; CFQ I/O scheduler&lt;br /&gt;
Default I/O scheduler (No-op)&lt;br /&gt;
&lt;br /&gt;
Device Drivers ---&amp;gt;&lt;br /&gt;
&amp;gt; Generic Driver Options ---&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; [*] Maintain a devtmpfs filesystem to mount at /dev&lt;br /&gt;
&amp;gt;&amp;gt; [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Cryptographic API ---&amp;gt;&lt;br /&gt;
&amp;lt;*&amp;gt; Deflate compression algorithm&lt;br /&gt;
&amp;lt;*&amp;gt; Zlib compression algorithm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* All other drivers required to see your PATA/SATA drives must be compiled in.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continue and compile/install your kernel:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##make bzImage modules&lt;br /&gt;
# ##i##make install&lt;br /&gt;
# ##i##make modules_install&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the ZFS userspace tools ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##emerge -av zfs&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check to make sure that the zfs tools are working, the zpool.cache file that you copied before should be displayed.&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##zpool status&lt;br /&gt;
# ##i##zfs list&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything worked, continue.&lt;br /&gt;
&lt;br /&gt;
== Install the bootloader ==&lt;br /&gt;
&lt;br /&gt;
=== GRUB 2 ===&lt;br /&gt;
If you are using whole-disk zfs then you will need grub2 because grub2 is the only bootloader that supports booting from a zfs pool. &lt;br /&gt;
&lt;br /&gt;
Before you do this, make sure this checklist is followed:&lt;br /&gt;
* Installed kernel and kernel modules&lt;br /&gt;
* Installed zfs package from the tree&lt;br /&gt;
* /dev, /proc, /sys are mounted in the chroot environment&lt;br /&gt;
&lt;br /&gt;
Once all this is checked, let's install grub2. First we need to enable the &amp;quot;libzfs&amp;quot; use flag so zfs support is compiled for grub2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##echo &amp;quot;sys-boot/grub libzfs&amp;quot; &amp;gt;&amp;gt; /etc/portage/package.use&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we will compile grub2:&lt;br /&gt;
{{fancyimportant|GRUB should be _at least_ version 2.0.0 since 2.0.0 added zfs support. 1.99,.98 will not work.}}&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##emerge -av grub&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you can check that grub is version 2.00 by doing the following command:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##grub-install --version&lt;br /&gt;
grub-install (GRUB) 2.00&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try to install grub2:&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##grub-install --no-floppy /dev/sda&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should receive the following message&lt;br /&gt;
&amp;lt;console&amp;gt;Installation finished. No error reported.&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, then go back to the above checklist.&lt;br /&gt;
=== Extlinux ===&lt;br /&gt;
There are four things we need to do for extlinux:&lt;br /&gt;
&lt;br /&gt;
# Install extlinux bootloader&lt;br /&gt;
# Write the .bin to the front of the target disk&lt;br /&gt;
# Toggle BIOS partition flag&lt;br /&gt;
# Write a extlinux configuration file&lt;br /&gt;
&lt;br /&gt;
First emerge extlinux:&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##emerge -av syslinux&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create a /boot/extlinux directory:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##cd /boot&lt;br /&gt;
# ##i##mkdir /boot/extlinux&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change into the extlinux dir and install the bootloader:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##cd /boot/extlinux&lt;br /&gt;
# ##i##extlinux --install .&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== MBR ====&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##fdisk /dev/sda&lt;br /&gt;
&lt;br /&gt;
Command: ##i##a ↵&lt;br /&gt;
Partition number: ##i##1 ↵&lt;br /&gt;
Command: ##i##w ↵&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Printing the &amp;lt;tt&amp;gt;fdisk&amp;lt;/tt&amp;gt; partition layout should show a star next to &amp;lt;tt&amp;gt;/dev/sda1&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;console&amp;gt;/dev/sda   *    2048    514047    256000    83    Linux&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flash the .bin to the front of the disk:&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##dd conv=notrunc bs=440 count=1 if=/usr/share/syslinux/mbr.bin of=/dev/sda&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPT ===&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##sgdisk /dev/sda --attributes=1:set:2&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flash the .bin to the front of the disk:&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##dd conv=notrunc bs=440 count=1 if=/usr/share/syslinux/gptmbr.bin of=/dev/sda&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will write the extlinux/grub configuration file in the next section.&lt;br /&gt;
== Create the initramfs ==&lt;br /&gt;
There are two ways to do this, you can use genkernel, or you can use my bliss initramfs creator. I will show you both.&lt;br /&gt;
&lt;br /&gt;
=== genkernel ===&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##emerge -av sys-kernel/genkernel&lt;br /&gt;
# ##i##genkernel --zfs initramfs&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Example: kernel name is: vmlinuz-3.7.3-ALL&lt;br /&gt;
initramfs name is: initramfs-genkernel-x86_64-3.7.3-ALL&lt;br /&gt;
pool name is: rpool&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''grub.cfg''':&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
set timeout=3&lt;br /&gt;
set default=0&lt;br /&gt;
&lt;br /&gt;
# Funtoo&lt;br /&gt;
menuentry &amp;quot;Funtoo - 3.7.3&amp;quot; {  &lt;br /&gt;
  insmod zfs  &lt;br /&gt;
  linux /ROOT/funtoo/@/boot/vmlinuz-3.7.3-ALL root=rpool/ROOT/funtoo real_root=ZFS=rpool/ROOT/funtoo dozfs=force&lt;br /&gt;
  initrd /ROOT/funtoo/@/boot/initramfs-genkernel-x86_64-3.7.3-ALL&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''extlinux.conf''':&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
LABEL funtoo&lt;br /&gt;
  MENU LABEL Funtoo 3.7.3-ALL&lt;br /&gt;
  KERNEL /boot/vmlinuz-3.7.3-ALL&lt;br /&gt;
  INITRD /boot/initramfs-genkernel-x86_64-3.7.3-ALL&lt;br /&gt;
  APPEND real_root=ZFS=rpool/ROOT/funtoo dozfs=force&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bliss Initramfs Creator ===&lt;br /&gt;
Clone my creator which is located at: git://github.com/fearedbliss/Bliss-Initramfs-Creator.git&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##git clone git://github.com/fearedbliss/Bliss-Initramfs-Creator.git&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then go into this new directory, run the script as root, and place it into /boot:&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##cd Bliss-Initramfs-Creator&lt;br /&gt;
# ##i##./createInit&lt;br /&gt;
# ##i##mv initrd-&amp;lt;kernel_name&amp;gt;.img /boot&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;kernel_name&amp;gt;''' is the name of what you selected in the initramfs creator, and the name of the outputted file. Once you do this just go to your bootloader config, and add it in there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Example: Kernel name is: vmlinuz-3.7.3-ALL&lt;br /&gt;
initramfs name is: initrd-3.7.3-ALL.img&lt;br /&gt;
Pool root is: rpool/ROOT/funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''grub.cfg''':&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
set timeout=3&lt;br /&gt;
set default=0&lt;br /&gt;
&lt;br /&gt;
# Funtoo&lt;br /&gt;
menuentry &amp;quot;Funtoo - 3.7.3&amp;quot; {  &lt;br /&gt;
  insmod zfs&lt;br /&gt;
  linux /ROOT/funtoo/@/boot/vmlinuz-3.7.3-ALL root=rpool/ROOT/funtoo quiet&lt;br /&gt;
  initrd /ROOT/funtoo/@/boot/initrd-3.7.3-ALL.img&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''extlinux.conf:'''&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
LABEL funtoo  &lt;br /&gt;
  MENU LABEL Funtoo 3.7.3-ALL  &lt;br /&gt;
  KERNEL /boot/vmlinuz-3.7.3-ALL  &lt;br /&gt;
  INITRD /boot/initrd-3.7.3-ALL.img  &lt;br /&gt;
  APPEND root=rpool/ROOT/funtoo&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final configuration ==&lt;br /&gt;
=== Add the zfs tools to openrc ===&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##rc-update add zfs boot&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add filesystems to /etc/fstab ===&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##nano /etc/fstab&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;fs&amp;gt;                  &amp;lt;mountpoint&amp;gt;    &amp;lt;type&amp;gt;          &amp;lt;opts&amp;gt;          &amp;lt;dump/pass&amp;gt;&lt;br /&gt;
# Do not add the /boot line below if you are using whole-disk zfs&lt;br /&gt;
/dev/sda1               /boot           ext4            defaults        1 2&lt;br /&gt;
/dev/zvol/rpool/swap    none            swap            sw              0 0&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Clean up and reboot ===&lt;br /&gt;
We are almost done, we are just going to clean up, '''set our root password''', and unmount whatever we mounted and get out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
Delete the stage3/portage tarballs you downloaded earlier so they don't take up space.&lt;br /&gt;
# ##i##cd /&lt;br /&gt;
# ##i##rm stage3-latest.tar.xz&lt;br /&gt;
# ##i##rm /usr/portage-latest.tar.xz&lt;br /&gt;
&lt;br /&gt;
Set your root password&lt;br /&gt;
# ##i##passwd&lt;br /&gt;
&amp;gt;&amp;gt; Enter your password, you won't see what you are writing (for security reasons), but it is there!&lt;br /&gt;
&lt;br /&gt;
Get out of the chroot environment&lt;br /&gt;
# ##i##exit&lt;br /&gt;
&lt;br /&gt;
Unmount all the kernel filesystem stuff and boot (if you have a separate /boot)&lt;br /&gt;
# ##i##cd /mnt/funtoo&lt;br /&gt;
# ##i##umount -l proc dev sys boot&lt;br /&gt;
&lt;br /&gt;
Turn off the swap&lt;br /&gt;
# ##i##swapoff /dev/zvol/rpool/swap&lt;br /&gt;
&lt;br /&gt;
Export the zpool&lt;br /&gt;
# ##i##cd /&lt;br /&gt;
# ##i##zpool export -f rpool&lt;br /&gt;
&lt;br /&gt;
Reboot&lt;br /&gt;
# ##i##reboot&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{fancyimportant|'''Don't forget to set your root password as stated above before exiting chroot and rebooting. If you don't set the root password, you won't be able to log into your new system.'''}}&lt;br /&gt;
&lt;br /&gt;
and that should be enough to get your system to boot on ZFS.&lt;br /&gt;
&lt;br /&gt;
== Extra: After reboot ==&lt;br /&gt;
After you restart your machine and your inside your desktop, continue to set up anything you need in terms of /etc configurations. Once you have everything the way you like it, take a snapshot of your system. You will be using this snapshot to revert back to this state if anything ever happens to your system down the road. The snapshots are cheap, and almost instant. &lt;br /&gt;
&lt;br /&gt;
To take the snapshot of your rootfs, type the following:&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##zfs snapshot rpool/ROOT/funtoo@install&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if your snapshot was taken, type:&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##zfs list -t snapshot&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your machine ever fails and you need to get back to this state, just type:&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##zfs rollback rpool/ROOT/funtoo@install&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recovery Environment ===&lt;br /&gt;
On ZFS it is extremely easy to create a recovery environment using an already working snapshot. So that's what we will be doing. Create a clone of the @install snapshot which you will use for recovery purposes. If something happens to your main install, you can boot into this clone and fix the main one. One of the differences (maybe the only difference) between a clone and a snapshot is that a clone is rewritable while a snapshot is only read-only.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;# ##i##zfs clone rpool/ROOT/funtoo@install rpool/ROOT/recovery&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add the clone to your grub.cfg ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
set timeout=3&lt;br /&gt;
set default=0&lt;br /&gt;
&lt;br /&gt;
# Funtoo Recovery&lt;br /&gt;
menuentry &amp;quot;Funtoo Recovery - 3.7.3&amp;quot; {  &lt;br /&gt;
  insmod zfs&lt;br /&gt;
  linux /ROOT/funtoo/@/boot/vmlinuz-3.7.3-ALL root=rpool/ROOT/recovery quiet&lt;br /&gt;
  initrd /ROOT/funtoo/@/boot/initrd-3.7.3-ALL.img&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add the clone to your extlinux.conf ====&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
LABEL funtoo-recovery    &lt;br /&gt;
  MENU LABEL Funtoo Recovery    &lt;br /&gt;
  KERNEL /boot/vmlinuz-3.7.3-ALL    &lt;br /&gt;
  INITRD /boot/initrd-3.7.3-ALL.img    &lt;br /&gt;
  APPEND root=rpool/ROOT/recovery&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Things to watch out for ====&lt;br /&gt;
Since your recovery clone will tend to get old as you use your main system, and since your recovery and other stuff are on the same pool, we don't want the new pool stuff to be mounted when we launch recovery. We also don't want video drivers to be conflicting.&lt;br /&gt;
# Make sure that nvidia/nouveau stuff are blacklisted.&lt;br /&gt;
# Make sure that your /boot and /lib/modules for the kernel in your 'recovery' are matching.&lt;br /&gt;
# Disable the zfs openrc script so that nothing else gets automatically mounted. Only your rootfs.&lt;br /&gt;
&lt;br /&gt;
You can do the above stuff by mounting your copy and chrooting into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
Mount the recovery clone&lt;br /&gt;
# ##i##mkdir /mnt/recovery&lt;br /&gt;
# ##i##mount -t zfs -o zfsutil rpool/ROOT/recovery /mnt/recovery&lt;br /&gt;
# ##i##cd /mnt/recovery&lt;br /&gt;
&lt;br /&gt;
Mount the kernel devices&lt;br /&gt;
# ##i##mount --rbind /proc ./proc&lt;br /&gt;
# ##i##mount --rbind /dev ./dev&lt;br /&gt;
# ##i##mount --rbind /sys ./sys&lt;br /&gt;
&lt;br /&gt;
Copy zpool.cache&lt;br /&gt;
# ##i##cp /etc/zfs/zpool.cache etc/zfs&lt;br /&gt;
&lt;br /&gt;
Chroot into the new environment&lt;br /&gt;
# ##i##env -i HOME=/root TERM=$TERM chroot . bash --login&lt;br /&gt;
&lt;br /&gt;
Disable zfs/zfs-shutdown openrc scripts&lt;br /&gt;
# ##i##rc-config delete zfs boot&lt;br /&gt;
&lt;br /&gt;
Blacklist nouveau/nvidia drivers&lt;br /&gt;
# ##i##echo &amp;quot;blacklist nouveau&amp;quot; &amp;gt;&amp;gt; /etc/modprobe.d/blacklist.conf&lt;br /&gt;
# ##i##echo &amp;quot;blacklist nvidia&amp;quot; &amp;gt;&amp;gt; /etc/modprobe.d/blacklist.conf&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you are done doing your changes, just umount and exit the chroot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##cd /&lt;br /&gt;
# ##i##umount -l proc dev sys&lt;br /&gt;
# ##i##exit&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting into the recovery ====&lt;br /&gt;
Just start your machine and pick the '''Funtoo Recovery''' option from the Boot Menu.&lt;br /&gt;
&lt;br /&gt;
Enjoy your new install on ZFS :)&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Filesystems]]&lt;br /&gt;
[[Category:Featured]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Containers</id>
		<title>Linux Containers</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Containers"/>
				<updated>2013-01-22T22:57:21Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* /etc/lxc/funtoo/fstab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Linux Containers, or LXC, is a Linux feature that allows Linux to run one or more isolated virtual systems (with their own network interfaces, process namespace, user namespace, and power state) using a single Linux kernel on a single server. &lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
As of Linux kernel 3.1.5, LXC is usable for isolating your own private workloads from one another. It is not yet ready to isolate potentially malicious users from one another or the host system. For a more mature containers solution that is appropriate for hosting environments, see [[OpenVZ]].&lt;br /&gt;
&lt;br /&gt;
LXC containers don't yet have their own system uptime, and they see everything that's in the host's &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; output, among other things. But in general, the technology works.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Funtoo Host System ==&lt;br /&gt;
&lt;br /&gt;
=== Install LXC kernel ===&lt;br /&gt;
Any kernel beyond 3.1.5 will probably work. Personally I prefer the sys-kernel/gentoo-sources-3.4.9 as these have support for all the namespaces without sacrificing the xfs, FUSE or NFS support for example. These checks were introduced later starting from kernel 3.5, this could also mean that the user namespace is not working optimally.&lt;br /&gt;
&lt;br /&gt;
* User namespace (EXPERIMENTAL) depends on EXPERIMENTAL and on UIDGID_CONVERTED&lt;br /&gt;
** config UIDGID_CONVERTED&lt;br /&gt;
*** True if all of the selected software components are known to have uid_t and gid_t converted to kuid_t and kgid_t where appropriate and are otherwise safe to use with the user namespace.&lt;br /&gt;
**** Networking - depends on NET_9P = n&lt;br /&gt;
**** Filesystems - 9P_FS = n, AFS_FS = n, AUTOFS4_FS = n, CEPH_FS = n, CIFS = n, CODA_FS = n, FUSE_FS = n, GFS2_FS = n, NCP_FS = n, NFSD = n, NFS_FS = n, OCFS2_FS = n, XFS_FS = n&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration ====&lt;br /&gt;
These options should be enable in your kernel to be able to take full advantage of LXC.&lt;br /&gt;
&lt;br /&gt;
* General setup&lt;br /&gt;
** CONFIG_NAMESPACES&lt;br /&gt;
*** CONFIG_UTS_NS&lt;br /&gt;
*** CONFIG_IPC_NS&lt;br /&gt;
*** CONFIG_PID_NS&lt;br /&gt;
*** CONFIG_NET_NS&lt;br /&gt;
*** CONFIG_USER_NS&lt;br /&gt;
** CONFIG_CGROUPS&lt;br /&gt;
*** CONFIG_CGROUP_DEVICE&lt;br /&gt;
*** CONFIG_CGROUP_SCHED&lt;br /&gt;
*** CONFIG_CGROUP_CPUACCT&lt;br /&gt;
*** CONFIG_CGROUP_MEM_RES_CTLR&lt;br /&gt;
*** CONFIG_CPUSETS (on multiprocessor hosts)&lt;br /&gt;
* Networking support&lt;br /&gt;
** Networking options&lt;br /&gt;
*** CONFIG_VLAN_8021Q&lt;br /&gt;
* Device Drivers&lt;br /&gt;
** Character devices&lt;br /&gt;
*** Unix98 PTY support&lt;br /&gt;
**** CONFIG_DEVPTS_MULTIPLE_INSTANCES&lt;br /&gt;
** Network device support&lt;br /&gt;
*** Network core driver support&lt;br /&gt;
**** CONFIG_VETH&lt;br /&gt;
**** CONFIG_MACVLAN&lt;br /&gt;
&lt;br /&gt;
Once you have lxc installed, you can then check your kernel config with:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##CONFIG=/path/to/config /usr/sbin/lxc-checkconfig&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emerge lxc ===&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##emerge -av app-emulation/lxc&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
=== Configure Networking For Container ===&lt;br /&gt;
&lt;br /&gt;
Typically, one uses a bridge to allow containers to connect to the network. This is how to do it under Funtoo Linux:&lt;br /&gt;
&lt;br /&gt;
# create a bridge using the Funtoo network configuration scripts. Name the bridge something like &amp;lt;tt&amp;gt;brwan&amp;lt;/tt&amp;gt; (using &amp;lt;tt&amp;gt;/etc/init.d/netif.brwan&amp;lt;/tt&amp;gt;). Configure your bridge to have an IP address.&lt;br /&gt;
# Make your physical interface, such as &amp;lt;tt&amp;gt;eth0&amp;lt;/tt&amp;gt;, an interface with no IP address (use the Funtoo &amp;lt;tt&amp;gt;interface-noip&amp;lt;/tt&amp;gt; template.)&lt;br /&gt;
# Make &amp;lt;tt&amp;gt;netif.eth0&amp;lt;/tt&amp;gt; a slave of &amp;lt;tt&amp;gt;netif.brwan&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/conf.d/netif.brwan&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Enable your new bridged network and make sure it is functioning properly on the host.&lt;br /&gt;
&lt;br /&gt;
You will now be able to configure LXC to automatically add your container's virtual ethernet interface to the bridge when it starts, which will connect it to your network.&lt;br /&gt;
&lt;br /&gt;
== Setting up a Funtoo Linux LXC Container ==&lt;br /&gt;
&lt;br /&gt;
Here are the steps required to get Funtoo Linux running &amp;lt;i&amp;gt;inside&amp;lt;/i&amp;gt; a container. The steps below show you how to set up a container using an existing Funtoo Linux OpenVZ template. It is now also possible to use [[Metro]] to build an lxc container tarball directly, which will save you manual configuration steps and will provide an &amp;lt;tt&amp;gt;/etc/fstab.lxc&amp;lt;/tt&amp;gt; file that you can use for your host container config. See [[Metro Recipes]] for info on how to use Metro to generate an lxc container.&lt;br /&gt;
&lt;br /&gt;
=== Create and Configure Container Filesystem ===&lt;br /&gt;
&lt;br /&gt;
# Start with a Funtoo LXC template, and unpack it to a directory such as &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Create an empty &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo/etc/fstab&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
# Ensure &amp;lt;tt&amp;gt;c1&amp;lt;/tt&amp;gt; line is uncommented (enabled) and &amp;lt;tt&amp;gt;c2&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;c6&amp;lt;/tt&amp;gt; lines are disabled in &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo/etc/inittab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
That's almost all you need to get the container filesystem ready to start.&lt;br /&gt;
&lt;br /&gt;
=== Create Container Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Create the following files:&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/config&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{{fancynote|Daniel Robbins needs to update this config to be more in line with http://wiki.progress-linux.org/software/lxc/ -- this config appears to have nice, refined device node permissions and other goodies.}}&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 5 lxc.conf&amp;quot; , to get more information about linux container configuration file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Container&lt;br /&gt;
lxc.utsname                             = funtoo&lt;br /&gt;
lxc.rootfs                              = /var/lib/lxc/funtoo&lt;br /&gt;
lxc.arch                                = x86_64&lt;br /&gt;
lxc.tty                                 = 6&lt;br /&gt;
lxc.pts                                 = 1024&lt;br /&gt;
#lxc.console                            = /var/log/lxc/funtoo.console&lt;br /&gt;
&lt;br /&gt;
## Capabilities&lt;br /&gt;
lxc.cap.drop                            = sys_admin sys_module mac_admin mac_override&lt;br /&gt;
&lt;br /&gt;
## Devices&lt;br /&gt;
# Allow all devices&lt;br /&gt;
#lxc.cgroup.devices.allow               = a&lt;br /&gt;
# Deny all devices&lt;br /&gt;
lxc.cgroup.devices.deny                 = a&lt;br /&gt;
# Allow to mknod all devices (but not using them)&lt;br /&gt;
lxc.cgroup.devices.allow                = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow                = b *:* m&lt;br /&gt;
# /dev/console&lt;br /&gt;
lxc.cgroup.devices.allow                = c 5:1 rwm&lt;br /&gt;
# /dev/fuse&lt;br /&gt;
lxc.cgroup.devices.allow                = c 10:229 rwm&lt;br /&gt;
# /dev/null&lt;br /&gt;
lxc.cgroup.devices.allow                = c 1:3 rwm&lt;br /&gt;
# /dev/ptmx&lt;br /&gt;
lxc.cgroup.devices.allow                = c 5:2 rwm&lt;br /&gt;
# /dev/pts/*&lt;br /&gt;
lxc.cgroup.devices.allow                = c 136:* rwm&lt;br /&gt;
# /dev/random&lt;br /&gt;
lxc.cgroup.devices.allow                = c 1:8 rwm&lt;br /&gt;
# /dev/rtc&lt;br /&gt;
lxc.cgroup.devices.allow                = c 254:0 rwm&lt;br /&gt;
# /dev/tty&lt;br /&gt;
lxc.cgroup.devices.allow                = c 5:0 rwm&lt;br /&gt;
# /dev/urandom&lt;br /&gt;
lxc.cgroup.devices.allow                = c 1:9 rwm&lt;br /&gt;
# /dev/zero&lt;br /&gt;
lxc.cgroup.devices.allow                = c 1:5 rwm&lt;br /&gt;
&lt;br /&gt;
## Limits#&lt;br /&gt;
lxc.cgroup.cpu.shares                  = 1024&lt;br /&gt;
#lxc.cgroup.cpuset.cpus                 = 0&lt;br /&gt;
#lxc.cgroup.memory.limit_in_bytes       = 256M&lt;br /&gt;
#lxc.cgroup.memory.memsw.limit_in_bytes = 1G&lt;br /&gt;
&lt;br /&gt;
## Filesystem&lt;br /&gt;
lxc.mount                               = /etc/lxc/funtoo/fstab&lt;br /&gt;
#lxc.mount.entry                         = proc /var/lib/lxc/example.org/rootfs/proc proc nodev,noexec,nosuid 0 0&lt;br /&gt;
#lxc.mount.entry                         = sysfs /var/lib/lxc/example.org/rootfs/sys sysfs defaults,ro 0 0&lt;br /&gt;
#lxc.mount.entry                        = /srv/share/example.org /var/lib/example.org/rootfs/srv/example.org none defaults,bind 0 0&lt;br /&gt;
&lt;br /&gt;
## Network&lt;br /&gt;
lxc.network.type                        = veth&lt;br /&gt;
lxc.network.flags                       = up&lt;br /&gt;
lxc.network.hwaddr                      = #put your MAC address here, otherwise you will get a random one&lt;br /&gt;
lxc.network.link                        = br0&lt;br /&gt;
lxc.network.name                        = eth0&lt;br /&gt;
#lxc.network.veth.pair                   = veth-example&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 7 capabilities&amp;quot; to get more information aboout Linux capabilities.&lt;br /&gt;
&lt;br /&gt;
Above, use the following command to generate a random MAC for &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is a very good idea to assign a static MAC address to your container using &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;. If you don't, LXC will auto-generate a new random MAC every time your container starts, which may confuse network equipment that expects MAC addresses to remain constant.&lt;br /&gt;
&lt;br /&gt;
It might happen from case to case that you aren't able to start your LXC Container with the above generated MAC address so for all these who run into that problem here is a little script that connects your IP for the container with the MAC address. Just save the following code as &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh&amp;lt;/tt&amp;gt;, make it executable and run it like &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh xxx.xxx.xxx.xxx&amp;lt;/tt&amp;gt; where xxx.xxx.xxx.xxx represents your Container IP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
IP=$*&lt;br /&gt;
HA=`printf &amp;quot;02:00:%x:%x:%x:%x&amp;quot; ${IP//./ }`&lt;br /&gt;
echo $HA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/fstab&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
none /lxc/funtoo/dev/pts devpts defaults 0 0&lt;br /&gt;
none /lxc/funtoo/proc proc defaults 0 0&lt;br /&gt;
none /lxc/funtoo/sys sysfs defaults 0 0&lt;br /&gt;
none /lxc/funtoo/dev/shm tmpfs nodev,nosuid,noexec,mode=1777,rw 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing and Starting the Container ==&lt;br /&gt;
&lt;br /&gt;
You will probably need to set the root password for the container before you can log in. You can use chroot to do this quickly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chroot /lxc/funtoo&lt;br /&gt;
(chroot) # passwd&lt;br /&gt;
New password: XXXXXXXX&lt;br /&gt;
Retype new password: XXXXXXXX&lt;br /&gt;
passwd: password updated successfully&lt;br /&gt;
# exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the root password is set, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-start -n funtoo -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; option will cause it to run in the background.&lt;br /&gt;
&lt;br /&gt;
To attach to the console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-console -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to log in and use the container. In addition, the container should now be accessible on the network.&lt;br /&gt;
&lt;br /&gt;
To stop the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-stop -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that networking is working from within the container while it is running, and you're good to go!&lt;br /&gt;
&lt;br /&gt;
== LXC Bugs/Missing Features ==&lt;br /&gt;
&lt;br /&gt;
This section is devoted to documenting issues with the current implementation of LXC and its associated tools. We will be gradually expanding this section with detailed descriptions of problems, their status, and proposed solutions.&lt;br /&gt;
&lt;br /&gt;
=== reboot ===&lt;br /&gt;
&lt;br /&gt;
By default, lxc does not support rebooting a container from within. It will simply stop and the host will not know to start it.&lt;br /&gt;
&lt;br /&gt;
=== PID namespaces ===&lt;br /&gt;
&lt;br /&gt;
Process ID namespaces are functional, but the container can still see the CPU utilization of the host via the system load (ie. in &amp;lt;tt&amp;gt;top&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== /dev/pts newinstance ===&lt;br /&gt;
&lt;br /&gt;
* Some changes may be required to the host to properly implement &amp;quot;newinstance&amp;quot; &amp;lt;tt&amp;gt;/dev/pts&amp;lt;/tt&amp;gt;. See [https://bugzilla.redhat.com/show_bug.cgi?id=501718 This Red Hat bug].&lt;br /&gt;
&lt;br /&gt;
=== lxc-create and lxc-destroy ===&lt;br /&gt;
&lt;br /&gt;
* LXC's shell scripts are badly designed and are sure way to destruction, avoid using lxc-create and lxc-destroy.&lt;br /&gt;
&lt;br /&gt;
=== network initialization and cleanup ===&lt;br /&gt;
&lt;br /&gt;
* If used network.type = phys after lxc-stop the interface will be renamed to value from lxc.network.link. It supposed to be fixed in 0.7.4, happens still on 0.7.5 - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01760.html&lt;br /&gt;
&lt;br /&gt;
* Re-starting a container can result in a failure as network resource are tied up from the already-defunct instance: [http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg00824.html]&lt;br /&gt;
&lt;br /&gt;
=== lxc-halt ===&lt;br /&gt;
&lt;br /&gt;
* Missing tool to graceful shutdown container. 'lxc-halt' should be written and be posix sh-compatible, using lxc-execute to run halt in container.&lt;br /&gt;
&lt;br /&gt;
=== funtoo ===&lt;br /&gt;
&lt;br /&gt;
* Our udev should be updated to contain &amp;lt;tt&amp;gt;-lxc&amp;lt;/tt&amp;gt; in scripts. (This has been done as of 02-Nov-2011, so should be resolved. But not fixed in our openvz templates, so need to regen them in a few days.)&lt;br /&gt;
* Our openrc should be patched to handle the case where it cannot mount tmpfs, and gracefully handle this situation somehow. (Work-around in our docs above, which is to mount tmpfs to &amp;lt;tt&amp;gt;/libexec/rc/init.d&amp;lt;/tt&amp;gt; using the container-specific &amp;lt;tt&amp;gt;fstab&amp;lt;/tt&amp;gt; file (on the host.)&lt;br /&gt;
* Emerging udev within a container can/will fail when realdev is run, if a device node cannot be created (such as /dev/console) if there are no mknod capabilities within the container. This should be fixed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 7 capabilities&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 5 lxc.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* There are a number of additional lxc features that can be enabled via patches: [http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/]&lt;br /&gt;
* [https://wiki.ubuntu.com/UserNamespace Ubuntu User Namespaces page]&lt;br /&gt;
* lxc-gentoo setup script [https://github.com/globalcitizen/lxc-gentoo on GitHub]&lt;br /&gt;
&lt;br /&gt;
* '''IBM developerWorks'''&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-containers/index.html LXC: Linux Container Tools]&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-security/ Secure Linux Containers Cookbook]&lt;br /&gt;
&lt;br /&gt;
* '''Linux Weekly News'''&lt;br /&gt;
** [http://lwn.net/Articles/244531/ Smack for simplified access control]&lt;br /&gt;
&lt;br /&gt;
[[Category:Labs]]&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Containers</id>
		<title>Linux Containers</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Containers"/>
				<updated>2013-01-22T22:56:20Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* /etc/lxc/funtoo/config */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Linux Containers, or LXC, is a Linux feature that allows Linux to run one or more isolated virtual systems (with their own network interfaces, process namespace, user namespace, and power state) using a single Linux kernel on a single server. &lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
As of Linux kernel 3.1.5, LXC is usable for isolating your own private workloads from one another. It is not yet ready to isolate potentially malicious users from one another or the host system. For a more mature containers solution that is appropriate for hosting environments, see [[OpenVZ]].&lt;br /&gt;
&lt;br /&gt;
LXC containers don't yet have their own system uptime, and they see everything that's in the host's &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; output, among other things. But in general, the technology works.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Funtoo Host System ==&lt;br /&gt;
&lt;br /&gt;
=== Install LXC kernel ===&lt;br /&gt;
Any kernel beyond 3.1.5 will probably work. Personally I prefer the sys-kernel/gentoo-sources-3.4.9 as these have support for all the namespaces without sacrificing the xfs, FUSE or NFS support for example. These checks were introduced later starting from kernel 3.5, this could also mean that the user namespace is not working optimally.&lt;br /&gt;
&lt;br /&gt;
* User namespace (EXPERIMENTAL) depends on EXPERIMENTAL and on UIDGID_CONVERTED&lt;br /&gt;
** config UIDGID_CONVERTED&lt;br /&gt;
*** True if all of the selected software components are known to have uid_t and gid_t converted to kuid_t and kgid_t where appropriate and are otherwise safe to use with the user namespace.&lt;br /&gt;
**** Networking - depends on NET_9P = n&lt;br /&gt;
**** Filesystems - 9P_FS = n, AFS_FS = n, AUTOFS4_FS = n, CEPH_FS = n, CIFS = n, CODA_FS = n, FUSE_FS = n, GFS2_FS = n, NCP_FS = n, NFSD = n, NFS_FS = n, OCFS2_FS = n, XFS_FS = n&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration ====&lt;br /&gt;
These options should be enable in your kernel to be able to take full advantage of LXC.&lt;br /&gt;
&lt;br /&gt;
* General setup&lt;br /&gt;
** CONFIG_NAMESPACES&lt;br /&gt;
*** CONFIG_UTS_NS&lt;br /&gt;
*** CONFIG_IPC_NS&lt;br /&gt;
*** CONFIG_PID_NS&lt;br /&gt;
*** CONFIG_NET_NS&lt;br /&gt;
*** CONFIG_USER_NS&lt;br /&gt;
** CONFIG_CGROUPS&lt;br /&gt;
*** CONFIG_CGROUP_DEVICE&lt;br /&gt;
*** CONFIG_CGROUP_SCHED&lt;br /&gt;
*** CONFIG_CGROUP_CPUACCT&lt;br /&gt;
*** CONFIG_CGROUP_MEM_RES_CTLR&lt;br /&gt;
*** CONFIG_CPUSETS (on multiprocessor hosts)&lt;br /&gt;
* Networking support&lt;br /&gt;
** Networking options&lt;br /&gt;
*** CONFIG_VLAN_8021Q&lt;br /&gt;
* Device Drivers&lt;br /&gt;
** Character devices&lt;br /&gt;
*** Unix98 PTY support&lt;br /&gt;
**** CONFIG_DEVPTS_MULTIPLE_INSTANCES&lt;br /&gt;
** Network device support&lt;br /&gt;
*** Network core driver support&lt;br /&gt;
**** CONFIG_VETH&lt;br /&gt;
**** CONFIG_MACVLAN&lt;br /&gt;
&lt;br /&gt;
Once you have lxc installed, you can then check your kernel config with:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##CONFIG=/path/to/config /usr/sbin/lxc-checkconfig&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emerge lxc ===&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##emerge -av app-emulation/lxc&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
=== Configure Networking For Container ===&lt;br /&gt;
&lt;br /&gt;
Typically, one uses a bridge to allow containers to connect to the network. This is how to do it under Funtoo Linux:&lt;br /&gt;
&lt;br /&gt;
# create a bridge using the Funtoo network configuration scripts. Name the bridge something like &amp;lt;tt&amp;gt;brwan&amp;lt;/tt&amp;gt; (using &amp;lt;tt&amp;gt;/etc/init.d/netif.brwan&amp;lt;/tt&amp;gt;). Configure your bridge to have an IP address.&lt;br /&gt;
# Make your physical interface, such as &amp;lt;tt&amp;gt;eth0&amp;lt;/tt&amp;gt;, an interface with no IP address (use the Funtoo &amp;lt;tt&amp;gt;interface-noip&amp;lt;/tt&amp;gt; template.)&lt;br /&gt;
# Make &amp;lt;tt&amp;gt;netif.eth0&amp;lt;/tt&amp;gt; a slave of &amp;lt;tt&amp;gt;netif.brwan&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/conf.d/netif.brwan&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Enable your new bridged network and make sure it is functioning properly on the host.&lt;br /&gt;
&lt;br /&gt;
You will now be able to configure LXC to automatically add your container's virtual ethernet interface to the bridge when it starts, which will connect it to your network.&lt;br /&gt;
&lt;br /&gt;
== Setting up a Funtoo Linux LXC Container ==&lt;br /&gt;
&lt;br /&gt;
Here are the steps required to get Funtoo Linux running &amp;lt;i&amp;gt;inside&amp;lt;/i&amp;gt; a container. The steps below show you how to set up a container using an existing Funtoo Linux OpenVZ template. It is now also possible to use [[Metro]] to build an lxc container tarball directly, which will save you manual configuration steps and will provide an &amp;lt;tt&amp;gt;/etc/fstab.lxc&amp;lt;/tt&amp;gt; file that you can use for your host container config. See [[Metro Recipes]] for info on how to use Metro to generate an lxc container.&lt;br /&gt;
&lt;br /&gt;
=== Create and Configure Container Filesystem ===&lt;br /&gt;
&lt;br /&gt;
# Start with a Funtoo LXC template, and unpack it to a directory such as &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Create an empty &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo/etc/fstab&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
# Ensure &amp;lt;tt&amp;gt;c1&amp;lt;/tt&amp;gt; line is uncommented (enabled) and &amp;lt;tt&amp;gt;c2&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;c6&amp;lt;/tt&amp;gt; lines are disabled in &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo/etc/inittab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
That's almost all you need to get the container filesystem ready to start.&lt;br /&gt;
&lt;br /&gt;
=== Create Container Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Create the following files:&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/config&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{{fancynote|Daniel Robbins needs to update this config to be more in line with http://wiki.progress-linux.org/software/lxc/ -- this config appears to have nice, refined device node permissions and other goodies.}}&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 5 lxc.conf&amp;quot; , to get more information about linux container configuration file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Container&lt;br /&gt;
lxc.utsname                             = funtoo&lt;br /&gt;
lxc.rootfs                              = /var/lib/lxc/funtoo&lt;br /&gt;
lxc.arch                                = x86_64&lt;br /&gt;
lxc.tty                                 = 6&lt;br /&gt;
lxc.pts                                 = 1024&lt;br /&gt;
#lxc.console                            = /var/log/lxc/funtoo.console&lt;br /&gt;
&lt;br /&gt;
## Capabilities&lt;br /&gt;
lxc.cap.drop                            = sys_admin sys_module mac_admin mac_override&lt;br /&gt;
&lt;br /&gt;
## Devices&lt;br /&gt;
# Allow all devices&lt;br /&gt;
#lxc.cgroup.devices.allow               = a&lt;br /&gt;
# Deny all devices&lt;br /&gt;
lxc.cgroup.devices.deny                 = a&lt;br /&gt;
# Allow to mknod all devices (but not using them)&lt;br /&gt;
lxc.cgroup.devices.allow                = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow                = b *:* m&lt;br /&gt;
# /dev/console&lt;br /&gt;
lxc.cgroup.devices.allow                = c 5:1 rwm&lt;br /&gt;
# /dev/fuse&lt;br /&gt;
lxc.cgroup.devices.allow                = c 10:229 rwm&lt;br /&gt;
# /dev/null&lt;br /&gt;
lxc.cgroup.devices.allow                = c 1:3 rwm&lt;br /&gt;
# /dev/ptmx&lt;br /&gt;
lxc.cgroup.devices.allow                = c 5:2 rwm&lt;br /&gt;
# /dev/pts/*&lt;br /&gt;
lxc.cgroup.devices.allow                = c 136:* rwm&lt;br /&gt;
# /dev/random&lt;br /&gt;
lxc.cgroup.devices.allow                = c 1:8 rwm&lt;br /&gt;
# /dev/rtc&lt;br /&gt;
lxc.cgroup.devices.allow                = c 254:0 rwm&lt;br /&gt;
# /dev/tty&lt;br /&gt;
lxc.cgroup.devices.allow                = c 5:0 rwm&lt;br /&gt;
# /dev/urandom&lt;br /&gt;
lxc.cgroup.devices.allow                = c 1:9 rwm&lt;br /&gt;
# /dev/zero&lt;br /&gt;
lxc.cgroup.devices.allow                = c 1:5 rwm&lt;br /&gt;
&lt;br /&gt;
## Limits#&lt;br /&gt;
lxc.cgroup.cpu.shares                  = 1024&lt;br /&gt;
#lxc.cgroup.cpuset.cpus                 = 0&lt;br /&gt;
#lxc.cgroup.memory.limit_in_bytes       = 256M&lt;br /&gt;
#lxc.cgroup.memory.memsw.limit_in_bytes = 1G&lt;br /&gt;
&lt;br /&gt;
## Filesystem&lt;br /&gt;
lxc.mount                               = /etc/lxc/funtoo/fstab&lt;br /&gt;
#lxc.mount.entry                         = proc /var/lib/lxc/example.org/rootfs/proc proc nodev,noexec,nosuid 0 0&lt;br /&gt;
#lxc.mount.entry                         = sysfs /var/lib/lxc/example.org/rootfs/sys sysfs defaults,ro 0 0&lt;br /&gt;
#lxc.mount.entry                        = /srv/share/example.org /var/lib/example.org/rootfs/srv/example.org none defaults,bind 0 0&lt;br /&gt;
&lt;br /&gt;
## Network&lt;br /&gt;
lxc.network.type                        = veth&lt;br /&gt;
lxc.network.flags                       = up&lt;br /&gt;
lxc.network.hwaddr                      = #put your MAC address here, otherwise you will get a random one&lt;br /&gt;
lxc.network.link                        = br0&lt;br /&gt;
lxc.network.name                        = eth0&lt;br /&gt;
#lxc.network.veth.pair                   = veth-example&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 7 capabilities&amp;quot; to get more information aboout Linux capabilities.&lt;br /&gt;
&lt;br /&gt;
Above, use the following command to generate a random MAC for &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is a very good idea to assign a static MAC address to your container using &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;. If you don't, LXC will auto-generate a new random MAC every time your container starts, which may confuse network equipment that expects MAC addresses to remain constant.&lt;br /&gt;
&lt;br /&gt;
It might happen from case to case that you aren't able to start your LXC Container with the above generated MAC address so for all these who run into that problem here is a little script that connects your IP for the container with the MAC address. Just save the following code as &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh&amp;lt;/tt&amp;gt;, make it executable and run it like &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh xxx.xxx.xxx.xxx&amp;lt;/tt&amp;gt; where xxx.xxx.xxx.xxx represents your Container IP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
IP=$*&lt;br /&gt;
HA=`printf &amp;quot;02:00:%x:%x:%x:%x&amp;quot; ${IP//./ }`&lt;br /&gt;
echo $HA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/fstab&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
none /lxc/funtoo/dev/pts devpts defaults 0 0&lt;br /&gt;
none /lxc/funtoo/proc proc defaults 0 0&lt;br /&gt;
none /lxc/funtoo/sys sysfs defaults 0 0&lt;br /&gt;
none /lxc/funtoo/dev/shm tmpfs nodev,nosuid,noexec,mode=1777,rw 0 0&lt;br /&gt;
none /lxc/funtoo/libexec/rc/init.d tmpfs rw,mode=755 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing and Starting the Container ==&lt;br /&gt;
&lt;br /&gt;
You will probably need to set the root password for the container before you can log in. You can use chroot to do this quickly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chroot /lxc/funtoo&lt;br /&gt;
(chroot) # passwd&lt;br /&gt;
New password: XXXXXXXX&lt;br /&gt;
Retype new password: XXXXXXXX&lt;br /&gt;
passwd: password updated successfully&lt;br /&gt;
# exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the root password is set, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-start -n funtoo -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; option will cause it to run in the background.&lt;br /&gt;
&lt;br /&gt;
To attach to the console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-console -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to log in and use the container. In addition, the container should now be accessible on the network.&lt;br /&gt;
&lt;br /&gt;
To stop the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-stop -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that networking is working from within the container while it is running, and you're good to go!&lt;br /&gt;
&lt;br /&gt;
== LXC Bugs/Missing Features ==&lt;br /&gt;
&lt;br /&gt;
This section is devoted to documenting issues with the current implementation of LXC and its associated tools. We will be gradually expanding this section with detailed descriptions of problems, their status, and proposed solutions.&lt;br /&gt;
&lt;br /&gt;
=== reboot ===&lt;br /&gt;
&lt;br /&gt;
By default, lxc does not support rebooting a container from within. It will simply stop and the host will not know to start it.&lt;br /&gt;
&lt;br /&gt;
=== PID namespaces ===&lt;br /&gt;
&lt;br /&gt;
Process ID namespaces are functional, but the container can still see the CPU utilization of the host via the system load (ie. in &amp;lt;tt&amp;gt;top&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== /dev/pts newinstance ===&lt;br /&gt;
&lt;br /&gt;
* Some changes may be required to the host to properly implement &amp;quot;newinstance&amp;quot; &amp;lt;tt&amp;gt;/dev/pts&amp;lt;/tt&amp;gt;. See [https://bugzilla.redhat.com/show_bug.cgi?id=501718 This Red Hat bug].&lt;br /&gt;
&lt;br /&gt;
=== lxc-create and lxc-destroy ===&lt;br /&gt;
&lt;br /&gt;
* LXC's shell scripts are badly designed and are sure way to destruction, avoid using lxc-create and lxc-destroy.&lt;br /&gt;
&lt;br /&gt;
=== network initialization and cleanup ===&lt;br /&gt;
&lt;br /&gt;
* If used network.type = phys after lxc-stop the interface will be renamed to value from lxc.network.link. It supposed to be fixed in 0.7.4, happens still on 0.7.5 - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01760.html&lt;br /&gt;
&lt;br /&gt;
* Re-starting a container can result in a failure as network resource are tied up from the already-defunct instance: [http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg00824.html]&lt;br /&gt;
&lt;br /&gt;
=== lxc-halt ===&lt;br /&gt;
&lt;br /&gt;
* Missing tool to graceful shutdown container. 'lxc-halt' should be written and be posix sh-compatible, using lxc-execute to run halt in container.&lt;br /&gt;
&lt;br /&gt;
=== funtoo ===&lt;br /&gt;
&lt;br /&gt;
* Our udev should be updated to contain &amp;lt;tt&amp;gt;-lxc&amp;lt;/tt&amp;gt; in scripts. (This has been done as of 02-Nov-2011, so should be resolved. But not fixed in our openvz templates, so need to regen them in a few days.)&lt;br /&gt;
* Our openrc should be patched to handle the case where it cannot mount tmpfs, and gracefully handle this situation somehow. (Work-around in our docs above, which is to mount tmpfs to &amp;lt;tt&amp;gt;/libexec/rc/init.d&amp;lt;/tt&amp;gt; using the container-specific &amp;lt;tt&amp;gt;fstab&amp;lt;/tt&amp;gt; file (on the host.)&lt;br /&gt;
* Emerging udev within a container can/will fail when realdev is run, if a device node cannot be created (such as /dev/console) if there are no mknod capabilities within the container. This should be fixed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 7 capabilities&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 5 lxc.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* There are a number of additional lxc features that can be enabled via patches: [http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/]&lt;br /&gt;
* [https://wiki.ubuntu.com/UserNamespace Ubuntu User Namespaces page]&lt;br /&gt;
* lxc-gentoo setup script [https://github.com/globalcitizen/lxc-gentoo on GitHub]&lt;br /&gt;
&lt;br /&gt;
* '''IBM developerWorks'''&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-containers/index.html LXC: Linux Container Tools]&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-security/ Secure Linux Containers Cookbook]&lt;br /&gt;
&lt;br /&gt;
* '''Linux Weekly News'''&lt;br /&gt;
** [http://lwn.net/Articles/244531/ Smack for simplified access control]&lt;br /&gt;
&lt;br /&gt;
[[Category:Labs]]&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Containers</id>
		<title>Linux Containers</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Containers"/>
				<updated>2013-01-22T22:51:33Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* /etc/lxc/funtoo/config */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Linux Containers, or LXC, is a Linux feature that allows Linux to run one or more isolated virtual systems (with their own network interfaces, process namespace, user namespace, and power state) using a single Linux kernel on a single server. &lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
As of Linux kernel 3.1.5, LXC is usable for isolating your own private workloads from one another. It is not yet ready to isolate potentially malicious users from one another or the host system. For a more mature containers solution that is appropriate for hosting environments, see [[OpenVZ]].&lt;br /&gt;
&lt;br /&gt;
LXC containers don't yet have their own system uptime, and they see everything that's in the host's &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; output, among other things. But in general, the technology works.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Funtoo Host System ==&lt;br /&gt;
&lt;br /&gt;
=== Install LXC kernel ===&lt;br /&gt;
Any kernel beyond 3.1.5 will probably work. Personally I prefer the sys-kernel/gentoo-sources-3.4.9 as these have support for all the namespaces without sacrificing the xfs, FUSE or NFS support for example. These checks were introduced later starting from kernel 3.5, this could also mean that the user namespace is not working optimally.&lt;br /&gt;
&lt;br /&gt;
* User namespace (EXPERIMENTAL) depends on EXPERIMENTAL and on UIDGID_CONVERTED&lt;br /&gt;
** config UIDGID_CONVERTED&lt;br /&gt;
*** True if all of the selected software components are known to have uid_t and gid_t converted to kuid_t and kgid_t where appropriate and are otherwise safe to use with the user namespace.&lt;br /&gt;
**** Networking - depends on NET_9P = n&lt;br /&gt;
**** Filesystems - 9P_FS = n, AFS_FS = n, AUTOFS4_FS = n, CEPH_FS = n, CIFS = n, CODA_FS = n, FUSE_FS = n, GFS2_FS = n, NCP_FS = n, NFSD = n, NFS_FS = n, OCFS2_FS = n, XFS_FS = n&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration ====&lt;br /&gt;
These options should be enable in your kernel to be able to take full advantage of LXC.&lt;br /&gt;
&lt;br /&gt;
* General setup&lt;br /&gt;
** CONFIG_NAMESPACES&lt;br /&gt;
*** CONFIG_UTS_NS&lt;br /&gt;
*** CONFIG_IPC_NS&lt;br /&gt;
*** CONFIG_PID_NS&lt;br /&gt;
*** CONFIG_NET_NS&lt;br /&gt;
*** CONFIG_USER_NS&lt;br /&gt;
** CONFIG_CGROUPS&lt;br /&gt;
*** CONFIG_CGROUP_DEVICE&lt;br /&gt;
*** CONFIG_CGROUP_SCHED&lt;br /&gt;
*** CONFIG_CGROUP_CPUACCT&lt;br /&gt;
*** CONFIG_CGROUP_MEM_RES_CTLR&lt;br /&gt;
*** CONFIG_CPUSETS (on multiprocessor hosts)&lt;br /&gt;
* Networking support&lt;br /&gt;
** Networking options&lt;br /&gt;
*** CONFIG_VLAN_8021Q&lt;br /&gt;
* Device Drivers&lt;br /&gt;
** Character devices&lt;br /&gt;
*** Unix98 PTY support&lt;br /&gt;
**** CONFIG_DEVPTS_MULTIPLE_INSTANCES&lt;br /&gt;
** Network device support&lt;br /&gt;
*** Network core driver support&lt;br /&gt;
**** CONFIG_VETH&lt;br /&gt;
**** CONFIG_MACVLAN&lt;br /&gt;
&lt;br /&gt;
Once you have lxc installed, you can then check your kernel config with:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##CONFIG=/path/to/config /usr/sbin/lxc-checkconfig&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emerge lxc ===&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##emerge -av app-emulation/lxc&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
=== Configure Networking For Container ===&lt;br /&gt;
&lt;br /&gt;
Typically, one uses a bridge to allow containers to connect to the network. This is how to do it under Funtoo Linux:&lt;br /&gt;
&lt;br /&gt;
# create a bridge using the Funtoo network configuration scripts. Name the bridge something like &amp;lt;tt&amp;gt;brwan&amp;lt;/tt&amp;gt; (using &amp;lt;tt&amp;gt;/etc/init.d/netif.brwan&amp;lt;/tt&amp;gt;). Configure your bridge to have an IP address.&lt;br /&gt;
# Make your physical interface, such as &amp;lt;tt&amp;gt;eth0&amp;lt;/tt&amp;gt;, an interface with no IP address (use the Funtoo &amp;lt;tt&amp;gt;interface-noip&amp;lt;/tt&amp;gt; template.)&lt;br /&gt;
# Make &amp;lt;tt&amp;gt;netif.eth0&amp;lt;/tt&amp;gt; a slave of &amp;lt;tt&amp;gt;netif.brwan&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/conf.d/netif.brwan&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Enable your new bridged network and make sure it is functioning properly on the host.&lt;br /&gt;
&lt;br /&gt;
You will now be able to configure LXC to automatically add your container's virtual ethernet interface to the bridge when it starts, which will connect it to your network.&lt;br /&gt;
&lt;br /&gt;
== Setting up a Funtoo Linux LXC Container ==&lt;br /&gt;
&lt;br /&gt;
Here are the steps required to get Funtoo Linux running &amp;lt;i&amp;gt;inside&amp;lt;/i&amp;gt; a container. The steps below show you how to set up a container using an existing Funtoo Linux OpenVZ template. It is now also possible to use [[Metro]] to build an lxc container tarball directly, which will save you manual configuration steps and will provide an &amp;lt;tt&amp;gt;/etc/fstab.lxc&amp;lt;/tt&amp;gt; file that you can use for your host container config. See [[Metro Recipes]] for info on how to use Metro to generate an lxc container.&lt;br /&gt;
&lt;br /&gt;
=== Create and Configure Container Filesystem ===&lt;br /&gt;
&lt;br /&gt;
# Start with a Funtoo LXC template, and unpack it to a directory such as &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Create an empty &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo/etc/fstab&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
# Ensure &amp;lt;tt&amp;gt;c1&amp;lt;/tt&amp;gt; line is uncommented (enabled) and &amp;lt;tt&amp;gt;c2&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;c6&amp;lt;/tt&amp;gt; lines are disabled in &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo/etc/inittab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
That's almost all you need to get the container filesystem ready to start.&lt;br /&gt;
&lt;br /&gt;
=== Create Container Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Create the following files:&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/config&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{{fancynote|Daniel Robbins needs to update this config to be more in line with http://wiki.progress-linux.org/software/lxc/ -- this config appears to have nice, refined device node permissions and other goodies.}}&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 5 lxc.conf&amp;quot; , to get more information about linux container configuration file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Containerlxc.utsname                             = funtoolxc.rootfs                              = /var/lib/lxc/funtoolxc.arch                                = x86_64lxc.tty                                 = 6lxc.pts                                 = 1024#lxc.console                            = /var/log/lxc/funtoo.console## Capabilitieslxc.cap.drop                            = sys_admin sys_module mac_admin mac_override## Devices# Allow all devices#lxc.cgroup.devices.allow               = a# Deny all deviceslxc.cgroup.devices.deny                 = a# Allow to mknod all devices (but not using them)lxc.cgroup.devices.allow                = c *:* mlxc.cgroup.devices.allow                = b *:* m# /dev/consolelxc.cgroup.devices.allow                = c 5:1 rwm# /dev/fuselxc.cgroup.devices.allow                = c 10:229 rwm# /dev/nulllxc.cgroup.devices.allow                = c 1:3 rwm# /dev/ptmxlxc.cgroup.devices.allow                = c 5:2 rwm# /dev/pts/*lxc.cgroup.devices.allow                = c 136:* rwm# /dev/randomlxc.cgroup.devices.allow                = c 1:8 rwm# /dev/rtclxc.cgroup.devices.allow                = c 254:0 rwm&lt;br /&gt;
# /dev/ttylxc.cgroup.devices.allow                = c 5:0 rwm# /dev/urandomlxc.cgroup.devices.allow                = c 1:9 rwm# /dev/zerolxc.cgroup.devices.allow                = c 1:5 rwm## Limits#lxc.cgroup.cpu.shares                  = 1024#lxc.cgroup.cpuset.cpus                 = 0#lxc.cgroup.memory.limit_in_bytes       = 256M#lxc.cgroup.memory.memsw.limit_in_bytes = 1G## Filesystemlxc.mount                               = /etc/lxc/funtoo/fstab#lxc.mount.entry                         = proc /var/lib/lxc/example.org/rootfs/proc proc nodev,noexec,nosuid 0 0#lxc.mount.entry                         = sysfs /var/lib/lxc/example.org/rootfs/sys sysfs defaults,ro 0 0#lxc.mount.entry                        = /srv/share/example.org /var/lib/example.org/rootfs/srv/example.org none defaults,bind 0 0## Networklxc.network.type                        = vethlxc.network.flags                       = uplxc.network.hwaddr                      = #put your MAC address here, otherwise you will get a random onelxc.network.link                        = br0lxc.network.name                        = eth0#lxc.network.veth.pair                   = veth-example&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 7 capabilities&amp;quot; to get more information aboout Linux capabilities.&lt;br /&gt;
&lt;br /&gt;
Above, use the following command to generate a random MAC for &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is a very good idea to assign a static MAC address to your container using &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;. If you don't, LXC will auto-generate a new random MAC every time your container starts, which may confuse network equipment that expects MAC addresses to remain constant.&lt;br /&gt;
&lt;br /&gt;
It might happen from case to case that you aren't able to start your LXC Container with the above generated MAC address so for all these who run into that problem here is a little script that connects your IP for the container with the MAC address. Just save the following code as &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh&amp;lt;/tt&amp;gt;, make it executable and run it like &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh xxx.xxx.xxx.xxx&amp;lt;/tt&amp;gt; where xxx.xxx.xxx.xxx represents your Container IP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
IP=$*&lt;br /&gt;
HA=`printf &amp;quot;02:00:%x:%x:%x:%x&amp;quot; ${IP//./ }`&lt;br /&gt;
echo $HA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/fstab&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
none /lxc/funtoo/dev/pts devpts defaults 0 0&lt;br /&gt;
none /lxc/funtoo/proc proc defaults 0 0&lt;br /&gt;
none /lxc/funtoo/sys sysfs defaults 0 0&lt;br /&gt;
none /lxc/funtoo/dev/shm tmpfs nodev,nosuid,noexec,mode=1777,rw 0 0&lt;br /&gt;
none /lxc/funtoo/libexec/rc/init.d tmpfs rw,mode=755 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing and Starting the Container ==&lt;br /&gt;
&lt;br /&gt;
You will probably need to set the root password for the container before you can log in. You can use chroot to do this quickly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chroot /lxc/funtoo&lt;br /&gt;
(chroot) # passwd&lt;br /&gt;
New password: XXXXXXXX&lt;br /&gt;
Retype new password: XXXXXXXX&lt;br /&gt;
passwd: password updated successfully&lt;br /&gt;
# exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the root password is set, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-start -n funtoo -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; option will cause it to run in the background.&lt;br /&gt;
&lt;br /&gt;
To attach to the console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-console -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to log in and use the container. In addition, the container should now be accessible on the network.&lt;br /&gt;
&lt;br /&gt;
To stop the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-stop -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that networking is working from within the container while it is running, and you're good to go!&lt;br /&gt;
&lt;br /&gt;
== LXC Bugs/Missing Features ==&lt;br /&gt;
&lt;br /&gt;
This section is devoted to documenting issues with the current implementation of LXC and its associated tools. We will be gradually expanding this section with detailed descriptions of problems, their status, and proposed solutions.&lt;br /&gt;
&lt;br /&gt;
=== reboot ===&lt;br /&gt;
&lt;br /&gt;
By default, lxc does not support rebooting a container from within. It will simply stop and the host will not know to start it.&lt;br /&gt;
&lt;br /&gt;
=== PID namespaces ===&lt;br /&gt;
&lt;br /&gt;
Process ID namespaces are functional, but the container can still see the CPU utilization of the host via the system load (ie. in &amp;lt;tt&amp;gt;top&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== /dev/pts newinstance ===&lt;br /&gt;
&lt;br /&gt;
* Some changes may be required to the host to properly implement &amp;quot;newinstance&amp;quot; &amp;lt;tt&amp;gt;/dev/pts&amp;lt;/tt&amp;gt;. See [https://bugzilla.redhat.com/show_bug.cgi?id=501718 This Red Hat bug].&lt;br /&gt;
&lt;br /&gt;
=== lxc-create and lxc-destroy ===&lt;br /&gt;
&lt;br /&gt;
* LXC's shell scripts are badly designed and are sure way to destruction, avoid using lxc-create and lxc-destroy.&lt;br /&gt;
&lt;br /&gt;
=== network initialization and cleanup ===&lt;br /&gt;
&lt;br /&gt;
* If used network.type = phys after lxc-stop the interface will be renamed to value from lxc.network.link. It supposed to be fixed in 0.7.4, happens still on 0.7.5 - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01760.html&lt;br /&gt;
&lt;br /&gt;
* Re-starting a container can result in a failure as network resource are tied up from the already-defunct instance: [http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg00824.html]&lt;br /&gt;
&lt;br /&gt;
=== lxc-halt ===&lt;br /&gt;
&lt;br /&gt;
* Missing tool to graceful shutdown container. 'lxc-halt' should be written and be posix sh-compatible, using lxc-execute to run halt in container.&lt;br /&gt;
&lt;br /&gt;
=== funtoo ===&lt;br /&gt;
&lt;br /&gt;
* Our udev should be updated to contain &amp;lt;tt&amp;gt;-lxc&amp;lt;/tt&amp;gt; in scripts. (This has been done as of 02-Nov-2011, so should be resolved. But not fixed in our openvz templates, so need to regen them in a few days.)&lt;br /&gt;
* Our openrc should be patched to handle the case where it cannot mount tmpfs, and gracefully handle this situation somehow. (Work-around in our docs above, which is to mount tmpfs to &amp;lt;tt&amp;gt;/libexec/rc/init.d&amp;lt;/tt&amp;gt; using the container-specific &amp;lt;tt&amp;gt;fstab&amp;lt;/tt&amp;gt; file (on the host.)&lt;br /&gt;
* Emerging udev within a container can/will fail when realdev is run, if a device node cannot be created (such as /dev/console) if there are no mknod capabilities within the container. This should be fixed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 7 capabilities&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 5 lxc.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* There are a number of additional lxc features that can be enabled via patches: [http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/]&lt;br /&gt;
* [https://wiki.ubuntu.com/UserNamespace Ubuntu User Namespaces page]&lt;br /&gt;
* lxc-gentoo setup script [https://github.com/globalcitizen/lxc-gentoo on GitHub]&lt;br /&gt;
&lt;br /&gt;
* '''IBM developerWorks'''&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-containers/index.html LXC: Linux Container Tools]&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-security/ Secure Linux Containers Cookbook]&lt;br /&gt;
&lt;br /&gt;
* '''Linux Weekly News'''&lt;br /&gt;
** [http://lwn.net/Articles/244531/ Smack for simplified access control]&lt;br /&gt;
&lt;br /&gt;
[[Category:Labs]]&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Containers</id>
		<title>Linux Containers</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Containers"/>
				<updated>2013-01-22T22:19:40Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Create and Configure Container Filesystem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Linux Containers, or LXC, is a Linux feature that allows Linux to run one or more isolated virtual systems (with their own network interfaces, process namespace, user namespace, and power state) using a single Linux kernel on a single server. &lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
As of Linux kernel 3.1.5, LXC is usable for isolating your own private workloads from one another. It is not yet ready to isolate potentially malicious users from one another or the host system. For a more mature containers solution that is appropriate for hosting environments, see [[OpenVZ]].&lt;br /&gt;
&lt;br /&gt;
LXC containers don't yet have their own system uptime, and they see everything that's in the host's &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; output, among other things. But in general, the technology works.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Funtoo Host System ==&lt;br /&gt;
&lt;br /&gt;
=== Install LXC kernel ===&lt;br /&gt;
Any kernel beyond 3.1.5 will probably work. Personally I prefer the sys-kernel/gentoo-sources-3.4.9 as these have support for all the namespaces without sacrificing the xfs, FUSE or NFS support for example. These checks were introduced later starting from kernel 3.5, this could also mean that the user namespace is not working optimally.&lt;br /&gt;
&lt;br /&gt;
* User namespace (EXPERIMENTAL) depends on EXPERIMENTAL and on UIDGID_CONVERTED&lt;br /&gt;
** config UIDGID_CONVERTED&lt;br /&gt;
*** True if all of the selected software components are known to have uid_t and gid_t converted to kuid_t and kgid_t where appropriate and are otherwise safe to use with the user namespace.&lt;br /&gt;
**** Networking - depends on NET_9P = n&lt;br /&gt;
**** Filesystems - 9P_FS = n, AFS_FS = n, AUTOFS4_FS = n, CEPH_FS = n, CIFS = n, CODA_FS = n, FUSE_FS = n, GFS2_FS = n, NCP_FS = n, NFSD = n, NFS_FS = n, OCFS2_FS = n, XFS_FS = n&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration ====&lt;br /&gt;
These options should be enable in your kernel to be able to take full advantage of LXC.&lt;br /&gt;
&lt;br /&gt;
* General setup&lt;br /&gt;
** CONFIG_NAMESPACES&lt;br /&gt;
*** CONFIG_UTS_NS&lt;br /&gt;
*** CONFIG_IPC_NS&lt;br /&gt;
*** CONFIG_PID_NS&lt;br /&gt;
*** CONFIG_NET_NS&lt;br /&gt;
*** CONFIG_USER_NS&lt;br /&gt;
** CONFIG_CGROUPS&lt;br /&gt;
*** CONFIG_CGROUP_DEVICE&lt;br /&gt;
*** CONFIG_CGROUP_SCHED&lt;br /&gt;
*** CONFIG_CGROUP_CPUACCT&lt;br /&gt;
*** CONFIG_CGROUP_MEM_RES_CTLR&lt;br /&gt;
*** CONFIG_CPUSETS (on multiprocessor hosts)&lt;br /&gt;
* Networking support&lt;br /&gt;
** Networking options&lt;br /&gt;
*** CONFIG_VLAN_8021Q&lt;br /&gt;
* Device Drivers&lt;br /&gt;
** Character devices&lt;br /&gt;
*** Unix98 PTY support&lt;br /&gt;
**** CONFIG_DEVPTS_MULTIPLE_INSTANCES&lt;br /&gt;
** Network device support&lt;br /&gt;
*** Network core driver support&lt;br /&gt;
**** CONFIG_VETH&lt;br /&gt;
**** CONFIG_MACVLAN&lt;br /&gt;
&lt;br /&gt;
Once you have lxc installed, you can then check your kernel config with:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##CONFIG=/path/to/config /usr/sbin/lxc-checkconfig&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emerge lxc ===&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##emerge -av app-emulation/lxc&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
=== Configure Networking For Container ===&lt;br /&gt;
&lt;br /&gt;
Typically, one uses a bridge to allow containers to connect to the network. This is how to do it under Funtoo Linux:&lt;br /&gt;
&lt;br /&gt;
# create a bridge using the Funtoo network configuration scripts. Name the bridge something like &amp;lt;tt&amp;gt;brwan&amp;lt;/tt&amp;gt; (using &amp;lt;tt&amp;gt;/etc/init.d/netif.brwan&amp;lt;/tt&amp;gt;). Configure your bridge to have an IP address.&lt;br /&gt;
# Make your physical interface, such as &amp;lt;tt&amp;gt;eth0&amp;lt;/tt&amp;gt;, an interface with no IP address (use the Funtoo &amp;lt;tt&amp;gt;interface-noip&amp;lt;/tt&amp;gt; template.)&lt;br /&gt;
# Make &amp;lt;tt&amp;gt;netif.eth0&amp;lt;/tt&amp;gt; a slave of &amp;lt;tt&amp;gt;netif.brwan&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/conf.d/netif.brwan&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Enable your new bridged network and make sure it is functioning properly on the host.&lt;br /&gt;
&lt;br /&gt;
You will now be able to configure LXC to automatically add your container's virtual ethernet interface to the bridge when it starts, which will connect it to your network.&lt;br /&gt;
&lt;br /&gt;
== Setting up a Funtoo Linux LXC Container ==&lt;br /&gt;
&lt;br /&gt;
Here are the steps required to get Funtoo Linux running &amp;lt;i&amp;gt;inside&amp;lt;/i&amp;gt; a container. The steps below show you how to set up a container using an existing Funtoo Linux OpenVZ template. It is now also possible to use [[Metro]] to build an lxc container tarball directly, which will save you manual configuration steps and will provide an &amp;lt;tt&amp;gt;/etc/fstab.lxc&amp;lt;/tt&amp;gt; file that you can use for your host container config. See [[Metro Recipes]] for info on how to use Metro to generate an lxc container.&lt;br /&gt;
&lt;br /&gt;
=== Create and Configure Container Filesystem ===&lt;br /&gt;
&lt;br /&gt;
# Start with a Funtoo LXC template, and unpack it to a directory such as &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Create an empty &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo/etc/fstab&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
# Ensure &amp;lt;tt&amp;gt;c1&amp;lt;/tt&amp;gt; line is uncommented (enabled) and &amp;lt;tt&amp;gt;c2&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;c6&amp;lt;/tt&amp;gt; lines are disabled in &amp;lt;tt&amp;gt;/var/lib/lxc/funtoo/etc/inittab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
That's almost all you need to get the container filesystem ready to start.&lt;br /&gt;
&lt;br /&gt;
=== Create Container Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Create the following files:&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/config&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{{fancynote|Daniel Robbins needs to update this config to be more in line with http://wiki.progress-linux.org/software/lxc/ -- this config appears to have nice, refined device node permissions and other goodies.}}&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 5 lxc.conf&amp;quot; , to get more information about linux container configuration file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.utsname = funtoo&lt;br /&gt;
lxc.arch = x86_64&lt;br /&gt;
&lt;br /&gt;
# mount configuration&lt;br /&gt;
lxc.mount = /etc/lxc/funtoo/fstab&lt;br /&gt;
lxc.rootfs = /lxc/funtoo&lt;br /&gt;
&lt;br /&gt;
# network configuration&lt;br /&gt;
lxc.network.type = veth&lt;br /&gt;
lxc.network.flags = up&lt;br /&gt;
lxc.network.link = brwan&lt;br /&gt;
lxc.network.ipv4 = &amp;lt;your IPv4 address here, like 1.2.3.4/29&amp;gt;&lt;br /&gt;
lxc.network.hwaddr = &amp;lt;your randomly-generated MAC address here, like a2:97:b6:df:df:28&amp;gt;&lt;br /&gt;
lxc.network.name = eth0&lt;br /&gt;
&lt;br /&gt;
# CPU &amp;amp; Memory Limits&lt;br /&gt;
# kernel/Documentation/cgroups/cpusets.txt  # cores 0,1 of your CPU&lt;br /&gt;
lxc.cgroup.cpuset.cpus = 0,1&lt;br /&gt;
lxc.cgroup.cpu.shares = 1024&lt;br /&gt;
# kernel/Documentation/cgroups/memory.txt&lt;br /&gt;
lxc.cgroup.memory.limit_in_bytes = 1024M&lt;br /&gt;
lxc.cgroup.memory.memsw.limit_in_bytes = 2048M&lt;br /&gt;
&lt;br /&gt;
# TTY configuration&lt;br /&gt;
lxc.tty = 12&lt;br /&gt;
lxc.pts = 128&lt;br /&gt;
&lt;br /&gt;
# Device configuration:&lt;br /&gt;
# Deny access to all devices:&lt;br /&gt;
lxc.cgroup.devices.deny = a &lt;br /&gt;
# Allow only the following devices to be opened:&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm # dev/null&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm # dev/zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm # dev/random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm # dev/urandom&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm # /dev/tty - allows ssh-add/password input&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm # /dev/console - allows lxc-start output&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm # rtc&lt;br /&gt;
&lt;br /&gt;
# TTYs - we create only 3 TTYs: tty0, tty1, tty2 - you can create up to 12 (see lxc.tty = 12)&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:0 rwm # /dev/tty0&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:1 rwm # /dev/tty1&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:2 rwm # /dev/tty2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# pts namespaces&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm # dev/pts/*&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm # dev/pts/ptmx&lt;br /&gt;
&lt;br /&gt;
# restrict capabilities:&lt;br /&gt;
lxc.cap.drop = audit_control&lt;br /&gt;
lxc.cap.drop = audit_write&lt;br /&gt;
lxc.cap.drop = mac_admin&lt;br /&gt;
lxc.cap.drop = mac_override&lt;br /&gt;
lxc.cap.drop = setpcap&lt;br /&gt;
lxc.cap.drop = sys_admin&lt;br /&gt;
lxc.cap.drop = sys_boot&lt;br /&gt;
lxc.cap.drop = sys_module&lt;br /&gt;
lxc.cap.drop = sys_rawio&lt;br /&gt;
lxc.cap.drop = sys_time&lt;br /&gt;
# By default, don't use lxc.cap.drop = mknod. This will allow mknod to create&lt;br /&gt;
# device nodes so build scripts and other things don't fail. Then, we'll&lt;br /&gt;
# rely on the devices.deny settings (default deny) to prevent any created &lt;br /&gt;
# device nodes inside the container from being used to access the host's &lt;br /&gt;
# hardware:&lt;br /&gt;
# lxc.cap.drop = mknod&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read &amp;quot;man 7 capabilities&amp;quot; to get more information aboout Linux capabilities.&lt;br /&gt;
&lt;br /&gt;
Above, use the following command to generate a random MAC for &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is a very good idea to assign a static MAC address to your container using &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;. If you don't, LXC will auto-generate a new random MAC every time your container starts, which may confuse network equipment that expects MAC addresses to remain constant.&lt;br /&gt;
&lt;br /&gt;
It might happen from case to case that you aren't able to start your LXC Container with the above generated MAC address so for all these who run into that problem here is a little script that connects your IP for the container with the MAC address. Just save the following code as &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh&amp;lt;/tt&amp;gt;, make it executable and run it like &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh xxx.xxx.xxx.xxx&amp;lt;/tt&amp;gt; where xxx.xxx.xxx.xxx represents your Container IP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
IP=$*&lt;br /&gt;
HA=`printf &amp;quot;02:00:%x:%x:%x:%x&amp;quot; ${IP//./ }`&lt;br /&gt;
echo $HA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/fstab&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
none /lxc/funtoo/dev/pts devpts defaults 0 0&lt;br /&gt;
none /lxc/funtoo/proc proc defaults 0 0&lt;br /&gt;
none /lxc/funtoo/sys sysfs defaults 0 0&lt;br /&gt;
none /lxc/funtoo/dev/shm tmpfs nodev,nosuid,noexec,mode=1777,rw 0 0&lt;br /&gt;
none /lxc/funtoo/libexec/rc/init.d tmpfs rw,mode=755 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing and Starting the Container ==&lt;br /&gt;
&lt;br /&gt;
You will probably need to set the root password for the container before you can log in. You can use chroot to do this quickly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chroot /lxc/funtoo&lt;br /&gt;
(chroot) # passwd&lt;br /&gt;
New password: XXXXXXXX&lt;br /&gt;
Retype new password: XXXXXXXX&lt;br /&gt;
passwd: password updated successfully&lt;br /&gt;
# exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the root password is set, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-start -n funtoo -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; option will cause it to run in the background.&lt;br /&gt;
&lt;br /&gt;
To attach to the console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-console -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to log in and use the container. In addition, the container should now be accessible on the network.&lt;br /&gt;
&lt;br /&gt;
To stop the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-stop -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that networking is working from within the container while it is running, and you're good to go!&lt;br /&gt;
&lt;br /&gt;
== LXC Bugs/Missing Features ==&lt;br /&gt;
&lt;br /&gt;
This section is devoted to documenting issues with the current implementation of LXC and its associated tools. We will be gradually expanding this section with detailed descriptions of problems, their status, and proposed solutions.&lt;br /&gt;
&lt;br /&gt;
=== reboot ===&lt;br /&gt;
&lt;br /&gt;
By default, lxc does not support rebooting a container from within. It will simply stop and the host will not know to start it.&lt;br /&gt;
&lt;br /&gt;
=== PID namespaces ===&lt;br /&gt;
&lt;br /&gt;
Process ID namespaces are functional, but the container can still see the CPU utilization of the host via the system load (ie. in &amp;lt;tt&amp;gt;top&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== /dev/pts newinstance ===&lt;br /&gt;
&lt;br /&gt;
* Some changes may be required to the host to properly implement &amp;quot;newinstance&amp;quot; &amp;lt;tt&amp;gt;/dev/pts&amp;lt;/tt&amp;gt;. See [https://bugzilla.redhat.com/show_bug.cgi?id=501718 This Red Hat bug].&lt;br /&gt;
&lt;br /&gt;
=== lxc-create and lxc-destroy ===&lt;br /&gt;
&lt;br /&gt;
* LXC's shell scripts are badly designed and are sure way to destruction, avoid using lxc-create and lxc-destroy.&lt;br /&gt;
&lt;br /&gt;
=== network initialization and cleanup ===&lt;br /&gt;
&lt;br /&gt;
* If used network.type = phys after lxc-stop the interface will be renamed to value from lxc.network.link. It supposed to be fixed in 0.7.4, happens still on 0.7.5 - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01760.html&lt;br /&gt;
&lt;br /&gt;
* Re-starting a container can result in a failure as network resource are tied up from the already-defunct instance: [http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg00824.html]&lt;br /&gt;
&lt;br /&gt;
=== lxc-halt ===&lt;br /&gt;
&lt;br /&gt;
* Missing tool to graceful shutdown container. 'lxc-halt' should be written and be posix sh-compatible, using lxc-execute to run halt in container.&lt;br /&gt;
&lt;br /&gt;
=== funtoo ===&lt;br /&gt;
&lt;br /&gt;
* Our udev should be updated to contain &amp;lt;tt&amp;gt;-lxc&amp;lt;/tt&amp;gt; in scripts. (This has been done as of 02-Nov-2011, so should be resolved. But not fixed in our openvz templates, so need to regen them in a few days.)&lt;br /&gt;
* Our openrc should be patched to handle the case where it cannot mount tmpfs, and gracefully handle this situation somehow. (Work-around in our docs above, which is to mount tmpfs to &amp;lt;tt&amp;gt;/libexec/rc/init.d&amp;lt;/tt&amp;gt; using the container-specific &amp;lt;tt&amp;gt;fstab&amp;lt;/tt&amp;gt; file (on the host.)&lt;br /&gt;
* Emerging udev within a container can/will fail when realdev is run, if a device node cannot be created (such as /dev/console) if there are no mknod capabilities within the container. This should be fixed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 7 capabilities&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 5 lxc.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* There are a number of additional lxc features that can be enabled via patches: [http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/]&lt;br /&gt;
* [https://wiki.ubuntu.com/UserNamespace Ubuntu User Namespaces page]&lt;br /&gt;
* lxc-gentoo setup script [https://github.com/globalcitizen/lxc-gentoo on GitHub]&lt;br /&gt;
&lt;br /&gt;
* '''IBM developerWorks'''&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-containers/index.html LXC: Linux Container Tools]&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-security/ Secure Linux Containers Cookbook]&lt;br /&gt;
&lt;br /&gt;
* '''Linux Weekly News'''&lt;br /&gt;
** [http://lwn.net/Articles/244531/ Smack for simplified access control]&lt;br /&gt;
&lt;br /&gt;
[[Category:Labs]]&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Containers</id>
		<title>Linux Containers</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Containers"/>
				<updated>2013-01-22T22:14:23Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Install LXC kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Linux Containers, or LXC, is a Linux feature that allows Linux to run one or more isolated virtual systems (with their own network interfaces, process namespace, user namespace, and power state) using a single Linux kernel on a single server. &lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
As of Linux kernel 3.1.5, LXC is usable for isolating your own private workloads from one another. It is not yet ready to isolate potentially malicious users from one another or the host system. For a more mature containers solution that is appropriate for hosting environments, see [[OpenVZ]].&lt;br /&gt;
&lt;br /&gt;
LXC containers don't yet have their own system uptime, and they see everything that's in the host's &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; output, among other things. But in general, the technology works.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Funtoo Host System ==&lt;br /&gt;
&lt;br /&gt;
=== Install LXC kernel ===&lt;br /&gt;
Any kernel beyond 3.1.5 will probably work. Personally I prefer the sys-kernel/gentoo-sources-3.4.9 as these have support for all the namespaces without sacrificing the xfs, FUSE or NFS support for example. These checks were introduced later starting from kernel 3.5, this could also mean that the user namespace is not working optimally.&lt;br /&gt;
&lt;br /&gt;
* User namespace (EXPERIMENTAL) depends on EXPERIMENTAL and on UIDGID_CONVERTED&lt;br /&gt;
** config UIDGID_CONVERTED&lt;br /&gt;
*** True if all of the selected software components are known to have uid_t and gid_t converted to kuid_t and kgid_t where appropriate and are otherwise safe to use with the user namespace.&lt;br /&gt;
**** Networking - depends on NET_9P = n&lt;br /&gt;
**** Filesystems - 9P_FS = n, AFS_FS = n, AUTOFS4_FS = n, CEPH_FS = n, CIFS = n, CODA_FS = n, FUSE_FS = n, GFS2_FS = n, NCP_FS = n, NFSD = n, NFS_FS = n, OCFS2_FS = n, XFS_FS = n&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration ====&lt;br /&gt;
These options should be enable in your kernel to be able to take full advantage of LXC.&lt;br /&gt;
&lt;br /&gt;
* General setup&lt;br /&gt;
** CONFIG_NAMESPACES&lt;br /&gt;
*** CONFIG_UTS_NS&lt;br /&gt;
*** CONFIG_IPC_NS&lt;br /&gt;
*** CONFIG_PID_NS&lt;br /&gt;
*** CONFIG_NET_NS&lt;br /&gt;
*** CONFIG_USER_NS&lt;br /&gt;
** CONFIG_CGROUPS&lt;br /&gt;
*** CONFIG_CGROUP_DEVICE&lt;br /&gt;
*** CONFIG_CGROUP_SCHED&lt;br /&gt;
*** CONFIG_CGROUP_CPUACCT&lt;br /&gt;
*** CONFIG_CGROUP_MEM_RES_CTLR&lt;br /&gt;
*** CONFIG_CPUSETS (on multiprocessor hosts)&lt;br /&gt;
* Networking support&lt;br /&gt;
** Networking options&lt;br /&gt;
*** CONFIG_VLAN_8021Q&lt;br /&gt;
* Device Drivers&lt;br /&gt;
** Character devices&lt;br /&gt;
*** Unix98 PTY support&lt;br /&gt;
**** CONFIG_DEVPTS_MULTIPLE_INSTANCES&lt;br /&gt;
** Network device support&lt;br /&gt;
*** Network core driver support&lt;br /&gt;
**** CONFIG_VETH&lt;br /&gt;
**** CONFIG_MACVLAN&lt;br /&gt;
&lt;br /&gt;
Once you have lxc installed, you can then check your kernel config with:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##CONFIG=/path/to/config /usr/sbin/lxc-checkconfig&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emerge lxc ===&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##emerge -av app-emulation/lxc&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
=== Configure Networking For Container ===&lt;br /&gt;
&lt;br /&gt;
Typically, one uses a bridge to allow containers to connect to the network. This is how to do it under Funtoo Linux:&lt;br /&gt;
&lt;br /&gt;
# create a bridge using the Funtoo network configuration scripts. Name the bridge something like &amp;lt;tt&amp;gt;brwan&amp;lt;/tt&amp;gt; (using &amp;lt;tt&amp;gt;/etc/init.d/netif.brwan&amp;lt;/tt&amp;gt;). Configure your bridge to have an IP address.&lt;br /&gt;
# Make your physical interface, such as &amp;lt;tt&amp;gt;eth0&amp;lt;/tt&amp;gt;, an interface with no IP address (use the Funtoo &amp;lt;tt&amp;gt;interface-noip&amp;lt;/tt&amp;gt; template.)&lt;br /&gt;
# Make &amp;lt;tt&amp;gt;netif.eth0&amp;lt;/tt&amp;gt; a slave of &amp;lt;tt&amp;gt;netif.brwan&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/conf.d/netif.brwan&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Enable your new bridged network and make sure it is functioning properly on the host.&lt;br /&gt;
&lt;br /&gt;
You will now be able to configure LXC to automatically add your container's virtual ethernet interface to the bridge when it starts, which will connect it to your network.&lt;br /&gt;
&lt;br /&gt;
== Setting up a Funtoo Linux LXC Container ==&lt;br /&gt;
&lt;br /&gt;
Here are the steps required to get Funtoo Linux running &amp;lt;i&amp;gt;inside&amp;lt;/i&amp;gt; a container. The steps below show you how to set up a container using an existing Funtoo Linux OpenVZ template. It is now also possible to use [[Metro]] to build an lxc container tarball directly, which will save you manual configuration steps and will provide an &amp;lt;tt&amp;gt;/etc/fstab.lxc&amp;lt;/tt&amp;gt; file that you can use for your host container config. See [[Metro Recipes]] for info on how to use Metro to generate an lxc container.&lt;br /&gt;
&lt;br /&gt;
=== Create and Configure Container Filesystem ===&lt;br /&gt;
&lt;br /&gt;
# Start with a Funtoo OpenVZ template, and unpack it to a directory such as &amp;lt;tt&amp;gt;/lxc/funtoo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Edit &amp;lt;tt&amp;gt;/lxc/funtoo/etc/rc.conf&amp;lt;/tt&amp;gt; and change &amp;lt;tt&amp;gt;rc_sys=openvz&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;rc_sys=lxc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Create an empty &amp;lt;tt&amp;gt;/lxc/funtoo/etc/fstab&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
# Ensure &amp;lt;tt&amp;gt;c1&amp;lt;/tt&amp;gt; line is uncommented (enabled) and &amp;lt;tt&amp;gt;c2&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;c6&amp;lt;/tt&amp;gt; lines are disabled in &amp;lt;tt&amp;gt;/lxc/funtoo/etc/inittab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Edit &amp;lt;tt&amp;gt;udev-mount&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;udev-postmount&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;udev-save&amp;lt;/tt&amp;gt; and change the &amp;lt;tt&amp;gt;keyword&amp;lt;/tt&amp;gt; line to have the arguments &amp;lt;tt&amp;gt;-openvz -vserver -lxc&amp;lt;/tt&amp;gt;. (will be fixed in about a week)&lt;br /&gt;
&lt;br /&gt;
That's all you need to get the container filesystem ready to start.&lt;br /&gt;
&lt;br /&gt;
=== Create Container Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Create the following files:&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/config&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{{fancynote|Daniel Robbins needs to update this config to be more in line with http://wiki.progress-linux.org/software/lxc/ -- this config appears to have nice, refined device node permissions and other goodies.}}&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 5 lxc.conf&amp;quot; , to get more information about linux container configuration file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.utsname = funtoo&lt;br /&gt;
lxc.arch = x86_64&lt;br /&gt;
&lt;br /&gt;
# mount configuration&lt;br /&gt;
lxc.mount = /etc/lxc/funtoo/fstab&lt;br /&gt;
lxc.rootfs = /lxc/funtoo&lt;br /&gt;
&lt;br /&gt;
# network configuration&lt;br /&gt;
lxc.network.type = veth&lt;br /&gt;
lxc.network.flags = up&lt;br /&gt;
lxc.network.link = brwan&lt;br /&gt;
lxc.network.ipv4 = &amp;lt;your IPv4 address here, like 1.2.3.4/29&amp;gt;&lt;br /&gt;
lxc.network.hwaddr = &amp;lt;your randomly-generated MAC address here, like a2:97:b6:df:df:28&amp;gt;&lt;br /&gt;
lxc.network.name = eth0&lt;br /&gt;
&lt;br /&gt;
# CPU &amp;amp; Memory Limits&lt;br /&gt;
# kernel/Documentation/cgroups/cpusets.txt  # cores 0,1 of your CPU&lt;br /&gt;
lxc.cgroup.cpuset.cpus = 0,1&lt;br /&gt;
lxc.cgroup.cpu.shares = 1024&lt;br /&gt;
# kernel/Documentation/cgroups/memory.txt&lt;br /&gt;
lxc.cgroup.memory.limit_in_bytes = 1024M&lt;br /&gt;
lxc.cgroup.memory.memsw.limit_in_bytes = 2048M&lt;br /&gt;
&lt;br /&gt;
# TTY configuration&lt;br /&gt;
lxc.tty = 12&lt;br /&gt;
lxc.pts = 128&lt;br /&gt;
&lt;br /&gt;
# Device configuration:&lt;br /&gt;
# Deny access to all devices:&lt;br /&gt;
lxc.cgroup.devices.deny = a &lt;br /&gt;
# Allow only the following devices to be opened:&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm # dev/null&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm # dev/zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm # dev/random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm # dev/urandom&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm # /dev/tty - allows ssh-add/password input&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm # /dev/console - allows lxc-start output&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm # rtc&lt;br /&gt;
&lt;br /&gt;
# TTYs - we create only 3 TTYs: tty0, tty1, tty2 - you can create up to 12 (see lxc.tty = 12)&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:0 rwm # /dev/tty0&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:1 rwm # /dev/tty1&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:2 rwm # /dev/tty2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# pts namespaces&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm # dev/pts/*&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm # dev/pts/ptmx&lt;br /&gt;
&lt;br /&gt;
# restrict capabilities:&lt;br /&gt;
lxc.cap.drop = audit_control&lt;br /&gt;
lxc.cap.drop = audit_write&lt;br /&gt;
lxc.cap.drop = mac_admin&lt;br /&gt;
lxc.cap.drop = mac_override&lt;br /&gt;
lxc.cap.drop = setpcap&lt;br /&gt;
lxc.cap.drop = sys_admin&lt;br /&gt;
lxc.cap.drop = sys_boot&lt;br /&gt;
lxc.cap.drop = sys_module&lt;br /&gt;
lxc.cap.drop = sys_rawio&lt;br /&gt;
lxc.cap.drop = sys_time&lt;br /&gt;
# By default, don't use lxc.cap.drop = mknod. This will allow mknod to create&lt;br /&gt;
# device nodes so build scripts and other things don't fail. Then, we'll&lt;br /&gt;
# rely on the devices.deny settings (default deny) to prevent any created &lt;br /&gt;
# device nodes inside the container from being used to access the host's &lt;br /&gt;
# hardware:&lt;br /&gt;
# lxc.cap.drop = mknod&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read &amp;quot;man 7 capabilities&amp;quot; to get more information aboout Linux capabilities.&lt;br /&gt;
&lt;br /&gt;
Above, use the following command to generate a random MAC for &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is a very good idea to assign a static MAC address to your container using &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;. If you don't, LXC will auto-generate a new random MAC every time your container starts, which may confuse network equipment that expects MAC addresses to remain constant.&lt;br /&gt;
&lt;br /&gt;
It might happen from case to case that you aren't able to start your LXC Container with the above generated MAC address so for all these who run into that problem here is a little script that connects your IP for the container with the MAC address. Just save the following code as &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh&amp;lt;/tt&amp;gt;, make it executable and run it like &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh xxx.xxx.xxx.xxx&amp;lt;/tt&amp;gt; where xxx.xxx.xxx.xxx represents your Container IP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
IP=$*&lt;br /&gt;
HA=`printf &amp;quot;02:00:%x:%x:%x:%x&amp;quot; ${IP//./ }`&lt;br /&gt;
echo $HA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/fstab&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
none /lxc/funtoo/dev/pts devpts defaults 0 0&lt;br /&gt;
none /lxc/funtoo/proc proc defaults 0 0&lt;br /&gt;
none /lxc/funtoo/sys sysfs defaults 0 0&lt;br /&gt;
none /lxc/funtoo/dev/shm tmpfs nodev,nosuid,noexec,mode=1777,rw 0 0&lt;br /&gt;
none /lxc/funtoo/libexec/rc/init.d tmpfs rw,mode=755 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing and Starting the Container ==&lt;br /&gt;
&lt;br /&gt;
You will probably need to set the root password for the container before you can log in. You can use chroot to do this quickly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chroot /lxc/funtoo&lt;br /&gt;
(chroot) # passwd&lt;br /&gt;
New password: XXXXXXXX&lt;br /&gt;
Retype new password: XXXXXXXX&lt;br /&gt;
passwd: password updated successfully&lt;br /&gt;
# exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the root password is set, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-start -n funtoo -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; option will cause it to run in the background.&lt;br /&gt;
&lt;br /&gt;
To attach to the console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-console -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to log in and use the container. In addition, the container should now be accessible on the network.&lt;br /&gt;
&lt;br /&gt;
To stop the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-stop -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that networking is working from within the container while it is running, and you're good to go!&lt;br /&gt;
&lt;br /&gt;
== LXC Bugs/Missing Features ==&lt;br /&gt;
&lt;br /&gt;
This section is devoted to documenting issues with the current implementation of LXC and its associated tools. We will be gradually expanding this section with detailed descriptions of problems, their status, and proposed solutions.&lt;br /&gt;
&lt;br /&gt;
=== reboot ===&lt;br /&gt;
&lt;br /&gt;
By default, lxc does not support rebooting a container from within. It will simply stop and the host will not know to start it.&lt;br /&gt;
&lt;br /&gt;
=== PID namespaces ===&lt;br /&gt;
&lt;br /&gt;
Process ID namespaces are functional, but the container can still see the CPU utilization of the host via the system load (ie. in &amp;lt;tt&amp;gt;top&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== /dev/pts newinstance ===&lt;br /&gt;
&lt;br /&gt;
* Some changes may be required to the host to properly implement &amp;quot;newinstance&amp;quot; &amp;lt;tt&amp;gt;/dev/pts&amp;lt;/tt&amp;gt;. See [https://bugzilla.redhat.com/show_bug.cgi?id=501718 This Red Hat bug].&lt;br /&gt;
&lt;br /&gt;
=== lxc-create and lxc-destroy ===&lt;br /&gt;
&lt;br /&gt;
* LXC's shell scripts are badly designed and are sure way to destruction, avoid using lxc-create and lxc-destroy.&lt;br /&gt;
&lt;br /&gt;
=== network initialization and cleanup ===&lt;br /&gt;
&lt;br /&gt;
* If used network.type = phys after lxc-stop the interface will be renamed to value from lxc.network.link. It supposed to be fixed in 0.7.4, happens still on 0.7.5 - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01760.html&lt;br /&gt;
&lt;br /&gt;
* Re-starting a container can result in a failure as network resource are tied up from the already-defunct instance: [http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg00824.html]&lt;br /&gt;
&lt;br /&gt;
=== lxc-halt ===&lt;br /&gt;
&lt;br /&gt;
* Missing tool to graceful shutdown container. 'lxc-halt' should be written and be posix sh-compatible, using lxc-execute to run halt in container.&lt;br /&gt;
&lt;br /&gt;
=== funtoo ===&lt;br /&gt;
&lt;br /&gt;
* Our udev should be updated to contain &amp;lt;tt&amp;gt;-lxc&amp;lt;/tt&amp;gt; in scripts. (This has been done as of 02-Nov-2011, so should be resolved. But not fixed in our openvz templates, so need to regen them in a few days.)&lt;br /&gt;
* Our openrc should be patched to handle the case where it cannot mount tmpfs, and gracefully handle this situation somehow. (Work-around in our docs above, which is to mount tmpfs to &amp;lt;tt&amp;gt;/libexec/rc/init.d&amp;lt;/tt&amp;gt; using the container-specific &amp;lt;tt&amp;gt;fstab&amp;lt;/tt&amp;gt; file (on the host.)&lt;br /&gt;
* Emerging udev within a container can/will fail when realdev is run, if a device node cannot be created (such as /dev/console) if there are no mknod capabilities within the container. This should be fixed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 7 capabilities&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 5 lxc.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* There are a number of additional lxc features that can be enabled via patches: [http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/]&lt;br /&gt;
* [https://wiki.ubuntu.com/UserNamespace Ubuntu User Namespaces page]&lt;br /&gt;
* lxc-gentoo setup script [https://github.com/globalcitizen/lxc-gentoo on GitHub]&lt;br /&gt;
&lt;br /&gt;
* '''IBM developerWorks'''&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-containers/index.html LXC: Linux Container Tools]&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-security/ Secure Linux Containers Cookbook]&lt;br /&gt;
&lt;br /&gt;
* '''Linux Weekly News'''&lt;br /&gt;
** [http://lwn.net/Articles/244531/ Smack for simplified access control]&lt;br /&gt;
&lt;br /&gt;
[[Category:Labs]]&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Containers</id>
		<title>Linux Containers</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Containers"/>
				<updated>2013-01-22T22:13:11Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Configuring the Funtoo Host System */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Linux Containers, or LXC, is a Linux feature that allows Linux to run one or more isolated virtual systems (with their own network interfaces, process namespace, user namespace, and power state) using a single Linux kernel on a single server. &lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
As of Linux kernel 3.1.5, LXC is usable for isolating your own private workloads from one another. It is not yet ready to isolate potentially malicious users from one another or the host system. For a more mature containers solution that is appropriate for hosting environments, see [[OpenVZ]].&lt;br /&gt;
&lt;br /&gt;
LXC containers don't yet have their own system uptime, and they see everything that's in the host's &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; output, among other things. But in general, the technology works.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Funtoo Host System ==&lt;br /&gt;
&lt;br /&gt;
=== Install LXC kernel ===&lt;br /&gt;
Any kernel beyond 3.1.5 will probably work. Personally I prefer the sys-kernel/gentoo-sources-3.4.9 as these have support for all the namespaces without sacrificing the xfs, FUSE or NFS support for example. These checks were introduced later starting from kernel 3.5, this could also mean that the user namespace is not working optimally.&lt;br /&gt;
&lt;br /&gt;
* User namespace (EXPERIMENTAL) depends on EXPERIMENTAL and on UIDGID_CONVERTED&lt;br /&gt;
** config UIDGID_CONVERTED&lt;br /&gt;
*** True if all of the selected software components are known to have uid_t and gid_t converted to kuid_t and kgid_t where appropriate and are otherwise safe to use with the user namespace.&lt;br /&gt;
**** Networking - depends on NET_9P = n&lt;br /&gt;
**** Filesystems - 9P_FS = n, AFS_FS = n, AUTOFS4_FS = n, CEPH_FS = n, CIFS = n, CODA_FS = n, FUSE_FS = n, GFS2_FS = n, NCP_FS = n, NFSD = n, NFS_FS = n, OCFS2_FS = n, XFS_FS = n&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration ====&lt;br /&gt;
These options should be enable in your kernel to be able to take full advantage of LXC.&lt;br /&gt;
&lt;br /&gt;
* General setup&lt;br /&gt;
** CONFIG_NAMESPACES&lt;br /&gt;
*** CONFIG_UTS_NS&lt;br /&gt;
*** CONFIG_IPC_NS&lt;br /&gt;
*** CONFIG_PID_NS&lt;br /&gt;
*** CONFIG_NET_NS&lt;br /&gt;
*** CONFIG_USER_NS&lt;br /&gt;
** CONFIG_CGROUPS&lt;br /&gt;
*** CONFIG_CGROUP_DEVICE&lt;br /&gt;
*** CONFIG_CGROUP_SCHED&lt;br /&gt;
*** CONFIG_CGROUP_CPUACCT&lt;br /&gt;
*** CONFIG_CGROUP_MEM_RES_CTLR&lt;br /&gt;
*** CONFIG_CPUSETS (on multiprocessor hosts)&lt;br /&gt;
* Networking support&lt;br /&gt;
** Networking options&lt;br /&gt;
*** CONFIG_VLAN_8021Q&lt;br /&gt;
* Device Drivers&lt;br /&gt;
** Character devices&lt;br /&gt;
*** Unix98 PTY support&lt;br /&gt;
**** CONFIG_DEVPTS_MULTIPLE_INSTANCES&lt;br /&gt;
** Network device support&lt;br /&gt;
*** Network core driver support&lt;br /&gt;
**** CONFIG_VETH&lt;br /&gt;
**** CONFIG_MACVLAN&lt;br /&gt;
&lt;br /&gt;
Once you have lxc installed, you can then check your kernel config with:&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##CONFIG=/path/to/config /usr/sbin/lxc-checkconfig&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emerge lxc ===&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##emerge -av app-emulation/lxc&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
=== Configure Networking For Container ===&lt;br /&gt;
&lt;br /&gt;
Typically, one uses a bridge to allow containers to connect to the network. This is how to do it under Funtoo Linux:&lt;br /&gt;
&lt;br /&gt;
# create a bridge using the Funtoo network configuration scripts. Name the bridge something like &amp;lt;tt&amp;gt;brwan&amp;lt;/tt&amp;gt; (using &amp;lt;tt&amp;gt;/etc/init.d/netif.brwan&amp;lt;/tt&amp;gt;). Configure your bridge to have an IP address.&lt;br /&gt;
# Make your physical interface, such as &amp;lt;tt&amp;gt;eth0&amp;lt;/tt&amp;gt;, an interface with no IP address (use the Funtoo &amp;lt;tt&amp;gt;interface-noip&amp;lt;/tt&amp;gt; template.)&lt;br /&gt;
# Make &amp;lt;tt&amp;gt;netif.eth0&amp;lt;/tt&amp;gt; a slave of &amp;lt;tt&amp;gt;netif.brwan&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/conf.d/netif.brwan&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Enable your new bridged network and make sure it is functioning properly on the host.&lt;br /&gt;
&lt;br /&gt;
You will now be able to configure LXC to automatically add your container's virtual ethernet interface to the bridge when it starts, which will connect it to your network.&lt;br /&gt;
&lt;br /&gt;
== Setting up a Funtoo Linux LXC Container ==&lt;br /&gt;
&lt;br /&gt;
Here are the steps required to get Funtoo Linux running &amp;lt;i&amp;gt;inside&amp;lt;/i&amp;gt; a container. The steps below show you how to set up a container using an existing Funtoo Linux OpenVZ template. It is now also possible to use [[Metro]] to build an lxc container tarball directly, which will save you manual configuration steps and will provide an &amp;lt;tt&amp;gt;/etc/fstab.lxc&amp;lt;/tt&amp;gt; file that you can use for your host container config. See [[Metro Recipes]] for info on how to use Metro to generate an lxc container.&lt;br /&gt;
&lt;br /&gt;
=== Create and Configure Container Filesystem ===&lt;br /&gt;
&lt;br /&gt;
# Start with a Funtoo OpenVZ template, and unpack it to a directory such as &amp;lt;tt&amp;gt;/lxc/funtoo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Edit &amp;lt;tt&amp;gt;/lxc/funtoo/etc/rc.conf&amp;lt;/tt&amp;gt; and change &amp;lt;tt&amp;gt;rc_sys=openvz&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;rc_sys=lxc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Create an empty &amp;lt;tt&amp;gt;/lxc/funtoo/etc/fstab&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
# Ensure &amp;lt;tt&amp;gt;c1&amp;lt;/tt&amp;gt; line is uncommented (enabled) and &amp;lt;tt&amp;gt;c2&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;c6&amp;lt;/tt&amp;gt; lines are disabled in &amp;lt;tt&amp;gt;/lxc/funtoo/etc/inittab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Edit &amp;lt;tt&amp;gt;udev-mount&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;udev-postmount&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;udev-save&amp;lt;/tt&amp;gt; and change the &amp;lt;tt&amp;gt;keyword&amp;lt;/tt&amp;gt; line to have the arguments &amp;lt;tt&amp;gt;-openvz -vserver -lxc&amp;lt;/tt&amp;gt;. (will be fixed in about a week)&lt;br /&gt;
&lt;br /&gt;
That's all you need to get the container filesystem ready to start.&lt;br /&gt;
&lt;br /&gt;
=== Create Container Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Create the following files:&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/config&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{{fancynote|Daniel Robbins needs to update this config to be more in line with http://wiki.progress-linux.org/software/lxc/ -- this config appears to have nice, refined device node permissions and other goodies.}}&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 5 lxc.conf&amp;quot; , to get more information about linux container configuration file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.utsname = funtoo&lt;br /&gt;
lxc.arch = x86_64&lt;br /&gt;
&lt;br /&gt;
# mount configuration&lt;br /&gt;
lxc.mount = /etc/lxc/funtoo/fstab&lt;br /&gt;
lxc.rootfs = /lxc/funtoo&lt;br /&gt;
&lt;br /&gt;
# network configuration&lt;br /&gt;
lxc.network.type = veth&lt;br /&gt;
lxc.network.flags = up&lt;br /&gt;
lxc.network.link = brwan&lt;br /&gt;
lxc.network.ipv4 = &amp;lt;your IPv4 address here, like 1.2.3.4/29&amp;gt;&lt;br /&gt;
lxc.network.hwaddr = &amp;lt;your randomly-generated MAC address here, like a2:97:b6:df:df:28&amp;gt;&lt;br /&gt;
lxc.network.name = eth0&lt;br /&gt;
&lt;br /&gt;
# CPU &amp;amp; Memory Limits&lt;br /&gt;
# kernel/Documentation/cgroups/cpusets.txt  # cores 0,1 of your CPU&lt;br /&gt;
lxc.cgroup.cpuset.cpus = 0,1&lt;br /&gt;
lxc.cgroup.cpu.shares = 1024&lt;br /&gt;
# kernel/Documentation/cgroups/memory.txt&lt;br /&gt;
lxc.cgroup.memory.limit_in_bytes = 1024M&lt;br /&gt;
lxc.cgroup.memory.memsw.limit_in_bytes = 2048M&lt;br /&gt;
&lt;br /&gt;
# TTY configuration&lt;br /&gt;
lxc.tty = 12&lt;br /&gt;
lxc.pts = 128&lt;br /&gt;
&lt;br /&gt;
# Device configuration:&lt;br /&gt;
# Deny access to all devices:&lt;br /&gt;
lxc.cgroup.devices.deny = a &lt;br /&gt;
# Allow only the following devices to be opened:&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm # dev/null&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm # dev/zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm # dev/random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm # dev/urandom&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm # /dev/tty - allows ssh-add/password input&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm # /dev/console - allows lxc-start output&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm # rtc&lt;br /&gt;
&lt;br /&gt;
# TTYs - we create only 3 TTYs: tty0, tty1, tty2 - you can create up to 12 (see lxc.tty = 12)&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:0 rwm # /dev/tty0&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:1 rwm # /dev/tty1&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:2 rwm # /dev/tty2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# pts namespaces&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm # dev/pts/*&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm # dev/pts/ptmx&lt;br /&gt;
&lt;br /&gt;
# restrict capabilities:&lt;br /&gt;
lxc.cap.drop = audit_control&lt;br /&gt;
lxc.cap.drop = audit_write&lt;br /&gt;
lxc.cap.drop = mac_admin&lt;br /&gt;
lxc.cap.drop = mac_override&lt;br /&gt;
lxc.cap.drop = setpcap&lt;br /&gt;
lxc.cap.drop = sys_admin&lt;br /&gt;
lxc.cap.drop = sys_boot&lt;br /&gt;
lxc.cap.drop = sys_module&lt;br /&gt;
lxc.cap.drop = sys_rawio&lt;br /&gt;
lxc.cap.drop = sys_time&lt;br /&gt;
# By default, don't use lxc.cap.drop = mknod. This will allow mknod to create&lt;br /&gt;
# device nodes so build scripts and other things don't fail. Then, we'll&lt;br /&gt;
# rely on the devices.deny settings (default deny) to prevent any created &lt;br /&gt;
# device nodes inside the container from being used to access the host's &lt;br /&gt;
# hardware:&lt;br /&gt;
# lxc.cap.drop = mknod&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read &amp;quot;man 7 capabilities&amp;quot; to get more information aboout Linux capabilities.&lt;br /&gt;
&lt;br /&gt;
Above, use the following command to generate a random MAC for &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is a very good idea to assign a static MAC address to your container using &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;. If you don't, LXC will auto-generate a new random MAC every time your container starts, which may confuse network equipment that expects MAC addresses to remain constant.&lt;br /&gt;
&lt;br /&gt;
It might happen from case to case that you aren't able to start your LXC Container with the above generated MAC address so for all these who run into that problem here is a little script that connects your IP for the container with the MAC address. Just save the following code as &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh&amp;lt;/tt&amp;gt;, make it executable and run it like &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh xxx.xxx.xxx.xxx&amp;lt;/tt&amp;gt; where xxx.xxx.xxx.xxx represents your Container IP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
IP=$*&lt;br /&gt;
HA=`printf &amp;quot;02:00:%x:%x:%x:%x&amp;quot; ${IP//./ }`&lt;br /&gt;
echo $HA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/fstab&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
none /lxc/funtoo/dev/pts devpts defaults 0 0&lt;br /&gt;
none /lxc/funtoo/proc proc defaults 0 0&lt;br /&gt;
none /lxc/funtoo/sys sysfs defaults 0 0&lt;br /&gt;
none /lxc/funtoo/dev/shm tmpfs nodev,nosuid,noexec,mode=1777,rw 0 0&lt;br /&gt;
none /lxc/funtoo/libexec/rc/init.d tmpfs rw,mode=755 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing and Starting the Container ==&lt;br /&gt;
&lt;br /&gt;
You will probably need to set the root password for the container before you can log in. You can use chroot to do this quickly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chroot /lxc/funtoo&lt;br /&gt;
(chroot) # passwd&lt;br /&gt;
New password: XXXXXXXX&lt;br /&gt;
Retype new password: XXXXXXXX&lt;br /&gt;
passwd: password updated successfully&lt;br /&gt;
# exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the root password is set, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-start -n funtoo -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; option will cause it to run in the background.&lt;br /&gt;
&lt;br /&gt;
To attach to the console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-console -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to log in and use the container. In addition, the container should now be accessible on the network.&lt;br /&gt;
&lt;br /&gt;
To stop the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-stop -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that networking is working from within the container while it is running, and you're good to go!&lt;br /&gt;
&lt;br /&gt;
== LXC Bugs/Missing Features ==&lt;br /&gt;
&lt;br /&gt;
This section is devoted to documenting issues with the current implementation of LXC and its associated tools. We will be gradually expanding this section with detailed descriptions of problems, their status, and proposed solutions.&lt;br /&gt;
&lt;br /&gt;
=== reboot ===&lt;br /&gt;
&lt;br /&gt;
By default, lxc does not support rebooting a container from within. It will simply stop and the host will not know to start it.&lt;br /&gt;
&lt;br /&gt;
=== PID namespaces ===&lt;br /&gt;
&lt;br /&gt;
Process ID namespaces are functional, but the container can still see the CPU utilization of the host via the system load (ie. in &amp;lt;tt&amp;gt;top&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== /dev/pts newinstance ===&lt;br /&gt;
&lt;br /&gt;
* Some changes may be required to the host to properly implement &amp;quot;newinstance&amp;quot; &amp;lt;tt&amp;gt;/dev/pts&amp;lt;/tt&amp;gt;. See [https://bugzilla.redhat.com/show_bug.cgi?id=501718 This Red Hat bug].&lt;br /&gt;
&lt;br /&gt;
=== lxc-create and lxc-destroy ===&lt;br /&gt;
&lt;br /&gt;
* LXC's shell scripts are badly designed and are sure way to destruction, avoid using lxc-create and lxc-destroy.&lt;br /&gt;
&lt;br /&gt;
=== network initialization and cleanup ===&lt;br /&gt;
&lt;br /&gt;
* If used network.type = phys after lxc-stop the interface will be renamed to value from lxc.network.link. It supposed to be fixed in 0.7.4, happens still on 0.7.5 - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01760.html&lt;br /&gt;
&lt;br /&gt;
* Re-starting a container can result in a failure as network resource are tied up from the already-defunct instance: [http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg00824.html]&lt;br /&gt;
&lt;br /&gt;
=== lxc-halt ===&lt;br /&gt;
&lt;br /&gt;
* Missing tool to graceful shutdown container. 'lxc-halt' should be written and be posix sh-compatible, using lxc-execute to run halt in container.&lt;br /&gt;
&lt;br /&gt;
=== funtoo ===&lt;br /&gt;
&lt;br /&gt;
* Our udev should be updated to contain &amp;lt;tt&amp;gt;-lxc&amp;lt;/tt&amp;gt; in scripts. (This has been done as of 02-Nov-2011, so should be resolved. But not fixed in our openvz templates, so need to regen them in a few days.)&lt;br /&gt;
* Our openrc should be patched to handle the case where it cannot mount tmpfs, and gracefully handle this situation somehow. (Work-around in our docs above, which is to mount tmpfs to &amp;lt;tt&amp;gt;/libexec/rc/init.d&amp;lt;/tt&amp;gt; using the container-specific &amp;lt;tt&amp;gt;fstab&amp;lt;/tt&amp;gt; file (on the host.)&lt;br /&gt;
* Emerging udev within a container can/will fail when realdev is run, if a device node cannot be created (such as /dev/console) if there are no mknod capabilities within the container. This should be fixed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 7 capabilities&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 5 lxc.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* There are a number of additional lxc features that can be enabled via patches: [http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/]&lt;br /&gt;
* [https://wiki.ubuntu.com/UserNamespace Ubuntu User Namespaces page]&lt;br /&gt;
* lxc-gentoo setup script [https://github.com/globalcitizen/lxc-gentoo on GitHub]&lt;br /&gt;
&lt;br /&gt;
* '''IBM developerWorks'''&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-containers/index.html LXC: Linux Container Tools]&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-security/ Secure Linux Containers Cookbook]&lt;br /&gt;
&lt;br /&gt;
* '''Linux Weekly News'''&lt;br /&gt;
** [http://lwn.net/Articles/244531/ Smack for simplified access control]&lt;br /&gt;
&lt;br /&gt;
[[Category:Labs]]&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Containers</id>
		<title>Linux Containers</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Containers"/>
				<updated>2013-01-22T22:09:26Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Emerge lxc */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Linux Containers, or LXC, is a Linux feature that allows Linux to run one or more isolated virtual systems (with their own network interfaces, process namespace, user namespace, and power state) using a single Linux kernel on a single server. &lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
As of Linux kernel 3.1.5, LXC is usable for isolating your own private workloads from one another. It is not yet ready to isolate potentially malicious users from one another or the host system. For a more mature containers solution that is appropriate for hosting environments, see [[OpenVZ]].&lt;br /&gt;
&lt;br /&gt;
LXC containers don't yet have their own system uptime, and they see everything that's in the host's &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; output, among other things. But in general, the technology works.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Funtoo Host System ==&lt;br /&gt;
&lt;br /&gt;
=== Install LXC kernel ===&lt;br /&gt;
Any kernel beyond 3.1.5 will probably work. Personally I prefer the sys-kernel/gentoo-sources-3.4.9 as these have support for all the namespaces without sacrificing the xfs, FUSE or NFS support for example. These checks were introduced later starting from kernel 3.5, this could also mean that the user namespace is not working optimally.&lt;br /&gt;
&lt;br /&gt;
* User namespace (EXPERIMENTAL) depends on EXPERIMENTAL and on UIDGID_CONVERTED&lt;br /&gt;
** config UIDGID_CONVERTED&lt;br /&gt;
*** True if all of the selected software components are known to have uid_t and gid_t converted to kuid_t and kgid_t where appropriate and are otherwise safe to use with the user namespace.&lt;br /&gt;
**** Networking - depends on NET_9P = n&lt;br /&gt;
**** Filesystems - 9P_FS = n, AFS_FS = n, AUTOFS4_FS = n, CEPH_FS = n, CIFS = n, CODA_FS = n, FUSE_FS = n, GFS2_FS = n, NCP_FS = n, NFSD = n, NFS_FS = n, OCFS2_FS = n, XFS_FS = n&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration ====&lt;br /&gt;
These options should be enable in your kernel to be able to take full advantage of LXC.&lt;br /&gt;
&lt;br /&gt;
* General setup&lt;br /&gt;
** CONFIG_NAMESPACES&lt;br /&gt;
*** CONFIG_UTS_NS&lt;br /&gt;
*** CONFIG_IPC_NS&lt;br /&gt;
*** CONFIG_PID_NS&lt;br /&gt;
*** CONFIG_NET_NS&lt;br /&gt;
*** CONFIG_USER_NS&lt;br /&gt;
** CONFIG_CGROUPS&lt;br /&gt;
*** CONFIG_CGROUP_DEVICE&lt;br /&gt;
*** CONFIG_CGROUP_SCHED&lt;br /&gt;
*** CONFIG_CGROUP_CPUACCT&lt;br /&gt;
*** CONFIG_CGROUP_MEM_RES_CTLR&lt;br /&gt;
*** CONFIG_CPUSETS (on multiprocessor hosts)&lt;br /&gt;
* Networking support&lt;br /&gt;
** Networking options&lt;br /&gt;
*** CONFIG_VLAN_8021Q&lt;br /&gt;
* Device Drivers&lt;br /&gt;
** Character devices&lt;br /&gt;
*** Unix98 PTY support&lt;br /&gt;
**** CONFIG_DEVPTS_MULTIPLE_INSTANCES&lt;br /&gt;
** Network device support&lt;br /&gt;
*** Network core driver support&lt;br /&gt;
**** CONFIG_VETH&lt;br /&gt;
**** CONFIG_MACVLAN&lt;br /&gt;
&lt;br /&gt;
Once you have lxc installed, you can then check your kernel config with:&lt;br /&gt;
 CONFIG=/path/to/config /usr/sbin/lxc-checkconfig&lt;br /&gt;
&lt;br /&gt;
=== Emerge lxc ===&lt;br /&gt;
 emerge -av app-emulation/lxc&lt;br /&gt;
&lt;br /&gt;
=== Configure Networking For Container ===&lt;br /&gt;
&lt;br /&gt;
Typically, one uses a bridge to allow containers to connect to the network. This is how to do it under Funtoo Linux:&lt;br /&gt;
&lt;br /&gt;
# create a bridge using the Funtoo network configuration scripts. Name the bridge something like &amp;lt;tt&amp;gt;brwan&amp;lt;/tt&amp;gt; (using &amp;lt;tt&amp;gt;/etc/init.d/netif.brwan&amp;lt;/tt&amp;gt;). Configure your bridge to have an IP address.&lt;br /&gt;
# Make your physical interface, such as &amp;lt;tt&amp;gt;eth0&amp;lt;/tt&amp;gt;, an interface with no IP address (use the Funtoo &amp;lt;tt&amp;gt;interface-noip&amp;lt;/tt&amp;gt; template.)&lt;br /&gt;
# Make &amp;lt;tt&amp;gt;netif.eth0&amp;lt;/tt&amp;gt; a slave of &amp;lt;tt&amp;gt;netif.brwan&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/conf.d/netif.brwan&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Enable your new bridged network and make sure it is functioning properly on the host.&lt;br /&gt;
&lt;br /&gt;
You will now be able to configure LXC to automatically add your container's virtual ethernet interface to the bridge when it starts, which will connect it to your network.&lt;br /&gt;
&lt;br /&gt;
== Setting up a Funtoo Linux LXC Container ==&lt;br /&gt;
&lt;br /&gt;
Here are the steps required to get Funtoo Linux running &amp;lt;i&amp;gt;inside&amp;lt;/i&amp;gt; a container. The steps below show you how to set up a container using an existing Funtoo Linux OpenVZ template. It is now also possible to use [[Metro]] to build an lxc container tarball directly, which will save you manual configuration steps and will provide an &amp;lt;tt&amp;gt;/etc/fstab.lxc&amp;lt;/tt&amp;gt; file that you can use for your host container config. See [[Metro Recipes]] for info on how to use Metro to generate an lxc container.&lt;br /&gt;
&lt;br /&gt;
=== Create and Configure Container Filesystem ===&lt;br /&gt;
&lt;br /&gt;
# Start with a Funtoo OpenVZ template, and unpack it to a directory such as &amp;lt;tt&amp;gt;/lxc/funtoo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Edit &amp;lt;tt&amp;gt;/lxc/funtoo/etc/rc.conf&amp;lt;/tt&amp;gt; and change &amp;lt;tt&amp;gt;rc_sys=openvz&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;rc_sys=lxc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Create an empty &amp;lt;tt&amp;gt;/lxc/funtoo/etc/fstab&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
# Ensure &amp;lt;tt&amp;gt;c1&amp;lt;/tt&amp;gt; line is uncommented (enabled) and &amp;lt;tt&amp;gt;c2&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;c6&amp;lt;/tt&amp;gt; lines are disabled in &amp;lt;tt&amp;gt;/lxc/funtoo/etc/inittab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Edit &amp;lt;tt&amp;gt;udev-mount&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;udev-postmount&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;udev-save&amp;lt;/tt&amp;gt; and change the &amp;lt;tt&amp;gt;keyword&amp;lt;/tt&amp;gt; line to have the arguments &amp;lt;tt&amp;gt;-openvz -vserver -lxc&amp;lt;/tt&amp;gt;. (will be fixed in about a week)&lt;br /&gt;
&lt;br /&gt;
That's all you need to get the container filesystem ready to start.&lt;br /&gt;
&lt;br /&gt;
=== Create Container Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Create the following files:&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/config&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{{fancynote|Daniel Robbins needs to update this config to be more in line with http://wiki.progress-linux.org/software/lxc/ -- this config appears to have nice, refined device node permissions and other goodies.}}&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 5 lxc.conf&amp;quot; , to get more information about linux container configuration file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.utsname = funtoo&lt;br /&gt;
lxc.arch = x86_64&lt;br /&gt;
&lt;br /&gt;
# mount configuration&lt;br /&gt;
lxc.mount = /etc/lxc/funtoo/fstab&lt;br /&gt;
lxc.rootfs = /lxc/funtoo&lt;br /&gt;
&lt;br /&gt;
# network configuration&lt;br /&gt;
lxc.network.type = veth&lt;br /&gt;
lxc.network.flags = up&lt;br /&gt;
lxc.network.link = brwan&lt;br /&gt;
lxc.network.ipv4 = &amp;lt;your IPv4 address here, like 1.2.3.4/29&amp;gt;&lt;br /&gt;
lxc.network.hwaddr = &amp;lt;your randomly-generated MAC address here, like a2:97:b6:df:df:28&amp;gt;&lt;br /&gt;
lxc.network.name = eth0&lt;br /&gt;
&lt;br /&gt;
# CPU &amp;amp; Memory Limits&lt;br /&gt;
# kernel/Documentation/cgroups/cpusets.txt  # cores 0,1 of your CPU&lt;br /&gt;
lxc.cgroup.cpuset.cpus = 0,1&lt;br /&gt;
lxc.cgroup.cpu.shares = 1024&lt;br /&gt;
# kernel/Documentation/cgroups/memory.txt&lt;br /&gt;
lxc.cgroup.memory.limit_in_bytes = 1024M&lt;br /&gt;
lxc.cgroup.memory.memsw.limit_in_bytes = 2048M&lt;br /&gt;
&lt;br /&gt;
# TTY configuration&lt;br /&gt;
lxc.tty = 12&lt;br /&gt;
lxc.pts = 128&lt;br /&gt;
&lt;br /&gt;
# Device configuration:&lt;br /&gt;
# Deny access to all devices:&lt;br /&gt;
lxc.cgroup.devices.deny = a &lt;br /&gt;
# Allow only the following devices to be opened:&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm # dev/null&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm # dev/zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm # dev/random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm # dev/urandom&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm # /dev/tty - allows ssh-add/password input&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm # /dev/console - allows lxc-start output&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm # rtc&lt;br /&gt;
&lt;br /&gt;
# TTYs - we create only 3 TTYs: tty0, tty1, tty2 - you can create up to 12 (see lxc.tty = 12)&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:0 rwm # /dev/tty0&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:1 rwm # /dev/tty1&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:2 rwm # /dev/tty2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# pts namespaces&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm # dev/pts/*&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm # dev/pts/ptmx&lt;br /&gt;
&lt;br /&gt;
# restrict capabilities:&lt;br /&gt;
lxc.cap.drop = audit_control&lt;br /&gt;
lxc.cap.drop = audit_write&lt;br /&gt;
lxc.cap.drop = mac_admin&lt;br /&gt;
lxc.cap.drop = mac_override&lt;br /&gt;
lxc.cap.drop = setpcap&lt;br /&gt;
lxc.cap.drop = sys_admin&lt;br /&gt;
lxc.cap.drop = sys_boot&lt;br /&gt;
lxc.cap.drop = sys_module&lt;br /&gt;
lxc.cap.drop = sys_rawio&lt;br /&gt;
lxc.cap.drop = sys_time&lt;br /&gt;
# By default, don't use lxc.cap.drop = mknod. This will allow mknod to create&lt;br /&gt;
# device nodes so build scripts and other things don't fail. Then, we'll&lt;br /&gt;
# rely on the devices.deny settings (default deny) to prevent any created &lt;br /&gt;
# device nodes inside the container from being used to access the host's &lt;br /&gt;
# hardware:&lt;br /&gt;
# lxc.cap.drop = mknod&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read &amp;quot;man 7 capabilities&amp;quot; to get more information aboout Linux capabilities.&lt;br /&gt;
&lt;br /&gt;
Above, use the following command to generate a random MAC for &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is a very good idea to assign a static MAC address to your container using &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;. If you don't, LXC will auto-generate a new random MAC every time your container starts, which may confuse network equipment that expects MAC addresses to remain constant.&lt;br /&gt;
&lt;br /&gt;
It might happen from case to case that you aren't able to start your LXC Container with the above generated MAC address so for all these who run into that problem here is a little script that connects your IP for the container with the MAC address. Just save the following code as &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh&amp;lt;/tt&amp;gt;, make it executable and run it like &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh xxx.xxx.xxx.xxx&amp;lt;/tt&amp;gt; where xxx.xxx.xxx.xxx represents your Container IP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
IP=$*&lt;br /&gt;
HA=`printf &amp;quot;02:00:%x:%x:%x:%x&amp;quot; ${IP//./ }`&lt;br /&gt;
echo $HA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/fstab&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
none /lxc/funtoo/dev/pts devpts defaults 0 0&lt;br /&gt;
none /lxc/funtoo/proc proc defaults 0 0&lt;br /&gt;
none /lxc/funtoo/sys sysfs defaults 0 0&lt;br /&gt;
none /lxc/funtoo/dev/shm tmpfs nodev,nosuid,noexec,mode=1777,rw 0 0&lt;br /&gt;
none /lxc/funtoo/libexec/rc/init.d tmpfs rw,mode=755 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing and Starting the Container ==&lt;br /&gt;
&lt;br /&gt;
You will probably need to set the root password for the container before you can log in. You can use chroot to do this quickly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chroot /lxc/funtoo&lt;br /&gt;
(chroot) # passwd&lt;br /&gt;
New password: XXXXXXXX&lt;br /&gt;
Retype new password: XXXXXXXX&lt;br /&gt;
passwd: password updated successfully&lt;br /&gt;
# exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the root password is set, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-start -n funtoo -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; option will cause it to run in the background.&lt;br /&gt;
&lt;br /&gt;
To attach to the console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-console -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to log in and use the container. In addition, the container should now be accessible on the network.&lt;br /&gt;
&lt;br /&gt;
To stop the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-stop -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that networking is working from within the container while it is running, and you're good to go!&lt;br /&gt;
&lt;br /&gt;
== LXC Bugs/Missing Features ==&lt;br /&gt;
&lt;br /&gt;
This section is devoted to documenting issues with the current implementation of LXC and its associated tools. We will be gradually expanding this section with detailed descriptions of problems, their status, and proposed solutions.&lt;br /&gt;
&lt;br /&gt;
=== reboot ===&lt;br /&gt;
&lt;br /&gt;
By default, lxc does not support rebooting a container from within. It will simply stop and the host will not know to start it.&lt;br /&gt;
&lt;br /&gt;
=== PID namespaces ===&lt;br /&gt;
&lt;br /&gt;
Process ID namespaces are functional, but the container can still see the CPU utilization of the host via the system load (ie. in &amp;lt;tt&amp;gt;top&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== /dev/pts newinstance ===&lt;br /&gt;
&lt;br /&gt;
* Some changes may be required to the host to properly implement &amp;quot;newinstance&amp;quot; &amp;lt;tt&amp;gt;/dev/pts&amp;lt;/tt&amp;gt;. See [https://bugzilla.redhat.com/show_bug.cgi?id=501718 This Red Hat bug].&lt;br /&gt;
&lt;br /&gt;
=== lxc-create and lxc-destroy ===&lt;br /&gt;
&lt;br /&gt;
* LXC's shell scripts are badly designed and are sure way to destruction, avoid using lxc-create and lxc-destroy.&lt;br /&gt;
&lt;br /&gt;
=== network initialization and cleanup ===&lt;br /&gt;
&lt;br /&gt;
* If used network.type = phys after lxc-stop the interface will be renamed to value from lxc.network.link. It supposed to be fixed in 0.7.4, happens still on 0.7.5 - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01760.html&lt;br /&gt;
&lt;br /&gt;
* Re-starting a container can result in a failure as network resource are tied up from the already-defunct instance: [http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg00824.html]&lt;br /&gt;
&lt;br /&gt;
=== lxc-halt ===&lt;br /&gt;
&lt;br /&gt;
* Missing tool to graceful shutdown container. 'lxc-halt' should be written and be posix sh-compatible, using lxc-execute to run halt in container.&lt;br /&gt;
&lt;br /&gt;
=== funtoo ===&lt;br /&gt;
&lt;br /&gt;
* Our udev should be updated to contain &amp;lt;tt&amp;gt;-lxc&amp;lt;/tt&amp;gt; in scripts. (This has been done as of 02-Nov-2011, so should be resolved. But not fixed in our openvz templates, so need to regen them in a few days.)&lt;br /&gt;
* Our openrc should be patched to handle the case where it cannot mount tmpfs, and gracefully handle this situation somehow. (Work-around in our docs above, which is to mount tmpfs to &amp;lt;tt&amp;gt;/libexec/rc/init.d&amp;lt;/tt&amp;gt; using the container-specific &amp;lt;tt&amp;gt;fstab&amp;lt;/tt&amp;gt; file (on the host.)&lt;br /&gt;
* Emerging udev within a container can/will fail when realdev is run, if a device node cannot be created (such as /dev/console) if there are no mknod capabilities within the container. This should be fixed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 7 capabilities&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 5 lxc.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* There are a number of additional lxc features that can be enabled via patches: [http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/]&lt;br /&gt;
* [https://wiki.ubuntu.com/UserNamespace Ubuntu User Namespaces page]&lt;br /&gt;
* lxc-gentoo setup script [https://github.com/globalcitizen/lxc-gentoo on GitHub]&lt;br /&gt;
&lt;br /&gt;
* '''IBM developerWorks'''&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-containers/index.html LXC: Linux Container Tools]&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-security/ Secure Linux Containers Cookbook]&lt;br /&gt;
&lt;br /&gt;
* '''Linux Weekly News'''&lt;br /&gt;
** [http://lwn.net/Articles/244531/ Smack for simplified access control]&lt;br /&gt;
&lt;br /&gt;
[[Category:Labs]]&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Containers</id>
		<title>Linux Containers</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Containers"/>
				<updated>2013-01-22T22:08:18Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Configuring the Funtoo Host System */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Linux Containers, or LXC, is a Linux feature that allows Linux to run one or more isolated virtual systems (with their own network interfaces, process namespace, user namespace, and power state) using a single Linux kernel on a single server. &lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
As of Linux kernel 3.1.5, LXC is usable for isolating your own private workloads from one another. It is not yet ready to isolate potentially malicious users from one another or the host system. For a more mature containers solution that is appropriate for hosting environments, see [[OpenVZ]].&lt;br /&gt;
&lt;br /&gt;
LXC containers don't yet have their own system uptime, and they see everything that's in the host's &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; output, among other things. But in general, the technology works.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Funtoo Host System ==&lt;br /&gt;
&lt;br /&gt;
=== Install LXC kernel ===&lt;br /&gt;
Any kernel beyond 3.1.5 will probably work. Personally I prefer the sys-kernel/gentoo-sources-3.4.9 as these have support for all the namespaces without sacrificing the xfs, FUSE or NFS support for example. These checks were introduced later starting from kernel 3.5, this could also mean that the user namespace is not working optimally.&lt;br /&gt;
&lt;br /&gt;
* User namespace (EXPERIMENTAL) depends on EXPERIMENTAL and on UIDGID_CONVERTED&lt;br /&gt;
** config UIDGID_CONVERTED&lt;br /&gt;
*** True if all of the selected software components are known to have uid_t and gid_t converted to kuid_t and kgid_t where appropriate and are otherwise safe to use with the user namespace.&lt;br /&gt;
**** Networking - depends on NET_9P = n&lt;br /&gt;
**** Filesystems - 9P_FS = n, AFS_FS = n, AUTOFS4_FS = n, CEPH_FS = n, CIFS = n, CODA_FS = n, FUSE_FS = n, GFS2_FS = n, NCP_FS = n, NFSD = n, NFS_FS = n, OCFS2_FS = n, XFS_FS = n&lt;br /&gt;
&lt;br /&gt;
==== Kernel configuration ====&lt;br /&gt;
These options should be enable in your kernel to be able to take full advantage of LXC.&lt;br /&gt;
&lt;br /&gt;
* General setup&lt;br /&gt;
** CONFIG_NAMESPACES&lt;br /&gt;
*** CONFIG_UTS_NS&lt;br /&gt;
*** CONFIG_IPC_NS&lt;br /&gt;
*** CONFIG_PID_NS&lt;br /&gt;
*** CONFIG_NET_NS&lt;br /&gt;
*** CONFIG_USER_NS&lt;br /&gt;
** CONFIG_CGROUPS&lt;br /&gt;
*** CONFIG_CGROUP_DEVICE&lt;br /&gt;
*** CONFIG_CGROUP_SCHED&lt;br /&gt;
*** CONFIG_CGROUP_CPUACCT&lt;br /&gt;
*** CONFIG_CGROUP_MEM_RES_CTLR&lt;br /&gt;
*** CONFIG_CPUSETS (on multiprocessor hosts)&lt;br /&gt;
* Networking support&lt;br /&gt;
** Networking options&lt;br /&gt;
*** CONFIG_VLAN_8021Q&lt;br /&gt;
* Device Drivers&lt;br /&gt;
** Character devices&lt;br /&gt;
*** Unix98 PTY support&lt;br /&gt;
**** CONFIG_DEVPTS_MULTIPLE_INSTANCES&lt;br /&gt;
** Network device support&lt;br /&gt;
*** Network core driver support&lt;br /&gt;
**** CONFIG_VETH&lt;br /&gt;
**** CONFIG_MACVLAN&lt;br /&gt;
&lt;br /&gt;
Once you have lxc installed, you can then check your kernel config with:&lt;br /&gt;
 CONFIG=/path/to/config /usr/sbin/lxc-checkconfig&lt;br /&gt;
&lt;br /&gt;
=== Emerge lxc ===&lt;br /&gt;
&lt;br /&gt;
=== Configure Networking For Container ===&lt;br /&gt;
&lt;br /&gt;
Typically, one uses a bridge to allow containers to connect to the network. This is how to do it under Funtoo Linux:&lt;br /&gt;
&lt;br /&gt;
# create a bridge using the Funtoo network configuration scripts. Name the bridge something like &amp;lt;tt&amp;gt;brwan&amp;lt;/tt&amp;gt; (using &amp;lt;tt&amp;gt;/etc/init.d/netif.brwan&amp;lt;/tt&amp;gt;). Configure your bridge to have an IP address.&lt;br /&gt;
# Make your physical interface, such as &amp;lt;tt&amp;gt;eth0&amp;lt;/tt&amp;gt;, an interface with no IP address (use the Funtoo &amp;lt;tt&amp;gt;interface-noip&amp;lt;/tt&amp;gt; template.)&lt;br /&gt;
# Make &amp;lt;tt&amp;gt;netif.eth0&amp;lt;/tt&amp;gt; a slave of &amp;lt;tt&amp;gt;netif.brwan&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/conf.d/netif.brwan&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Enable your new bridged network and make sure it is functioning properly on the host.&lt;br /&gt;
&lt;br /&gt;
You will now be able to configure LXC to automatically add your container's virtual ethernet interface to the bridge when it starts, which will connect it to your network.&lt;br /&gt;
&lt;br /&gt;
== Setting up a Funtoo Linux LXC Container ==&lt;br /&gt;
&lt;br /&gt;
Here are the steps required to get Funtoo Linux running &amp;lt;i&amp;gt;inside&amp;lt;/i&amp;gt; a container. The steps below show you how to set up a container using an existing Funtoo Linux OpenVZ template. It is now also possible to use [[Metro]] to build an lxc container tarball directly, which will save you manual configuration steps and will provide an &amp;lt;tt&amp;gt;/etc/fstab.lxc&amp;lt;/tt&amp;gt; file that you can use for your host container config. See [[Metro Recipes]] for info on how to use Metro to generate an lxc container.&lt;br /&gt;
&lt;br /&gt;
=== Create and Configure Container Filesystem ===&lt;br /&gt;
&lt;br /&gt;
# Start with a Funtoo OpenVZ template, and unpack it to a directory such as &amp;lt;tt&amp;gt;/lxc/funtoo&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Edit &amp;lt;tt&amp;gt;/lxc/funtoo/etc/rc.conf&amp;lt;/tt&amp;gt; and change &amp;lt;tt&amp;gt;rc_sys=openvz&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;rc_sys=lxc&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Create an empty &amp;lt;tt&amp;gt;/lxc/funtoo/etc/fstab&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
# Ensure &amp;lt;tt&amp;gt;c1&amp;lt;/tt&amp;gt; line is uncommented (enabled) and &amp;lt;tt&amp;gt;c2&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;c6&amp;lt;/tt&amp;gt; lines are disabled in &amp;lt;tt&amp;gt;/lxc/funtoo/etc/inittab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Edit &amp;lt;tt&amp;gt;udev-mount&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;udev-postmount&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;udev-save&amp;lt;/tt&amp;gt; and change the &amp;lt;tt&amp;gt;keyword&amp;lt;/tt&amp;gt; line to have the arguments &amp;lt;tt&amp;gt;-openvz -vserver -lxc&amp;lt;/tt&amp;gt;. (will be fixed in about a week)&lt;br /&gt;
&lt;br /&gt;
That's all you need to get the container filesystem ready to start.&lt;br /&gt;
&lt;br /&gt;
=== Create Container Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Create the following files:&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/config&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{{fancynote|Daniel Robbins needs to update this config to be more in line with http://wiki.progress-linux.org/software/lxc/ -- this config appears to have nice, refined device node permissions and other goodies.}}&lt;br /&gt;
&lt;br /&gt;
Read &amp;quot;man 5 lxc.conf&amp;quot; , to get more information about linux container configuration file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.utsname = funtoo&lt;br /&gt;
lxc.arch = x86_64&lt;br /&gt;
&lt;br /&gt;
# mount configuration&lt;br /&gt;
lxc.mount = /etc/lxc/funtoo/fstab&lt;br /&gt;
lxc.rootfs = /lxc/funtoo&lt;br /&gt;
&lt;br /&gt;
# network configuration&lt;br /&gt;
lxc.network.type = veth&lt;br /&gt;
lxc.network.flags = up&lt;br /&gt;
lxc.network.link = brwan&lt;br /&gt;
lxc.network.ipv4 = &amp;lt;your IPv4 address here, like 1.2.3.4/29&amp;gt;&lt;br /&gt;
lxc.network.hwaddr = &amp;lt;your randomly-generated MAC address here, like a2:97:b6:df:df:28&amp;gt;&lt;br /&gt;
lxc.network.name = eth0&lt;br /&gt;
&lt;br /&gt;
# CPU &amp;amp; Memory Limits&lt;br /&gt;
# kernel/Documentation/cgroups/cpusets.txt  # cores 0,1 of your CPU&lt;br /&gt;
lxc.cgroup.cpuset.cpus = 0,1&lt;br /&gt;
lxc.cgroup.cpu.shares = 1024&lt;br /&gt;
# kernel/Documentation/cgroups/memory.txt&lt;br /&gt;
lxc.cgroup.memory.limit_in_bytes = 1024M&lt;br /&gt;
lxc.cgroup.memory.memsw.limit_in_bytes = 2048M&lt;br /&gt;
&lt;br /&gt;
# TTY configuration&lt;br /&gt;
lxc.tty = 12&lt;br /&gt;
lxc.pts = 128&lt;br /&gt;
&lt;br /&gt;
# Device configuration:&lt;br /&gt;
# Deny access to all devices:&lt;br /&gt;
lxc.cgroup.devices.deny = a &lt;br /&gt;
# Allow only the following devices to be opened:&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm # dev/null&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm # dev/zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm # dev/random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm # dev/urandom&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm # /dev/tty - allows ssh-add/password input&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm # /dev/console - allows lxc-start output&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm # rtc&lt;br /&gt;
&lt;br /&gt;
# TTYs - we create only 3 TTYs: tty0, tty1, tty2 - you can create up to 12 (see lxc.tty = 12)&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:0 rwm # /dev/tty0&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:1 rwm # /dev/tty1&lt;br /&gt;
lxc.cgroup.devices.allow = c 4:2 rwm # /dev/tty2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# pts namespaces&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm # dev/pts/*&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm # dev/pts/ptmx&lt;br /&gt;
&lt;br /&gt;
# restrict capabilities:&lt;br /&gt;
lxc.cap.drop = audit_control&lt;br /&gt;
lxc.cap.drop = audit_write&lt;br /&gt;
lxc.cap.drop = mac_admin&lt;br /&gt;
lxc.cap.drop = mac_override&lt;br /&gt;
lxc.cap.drop = setpcap&lt;br /&gt;
lxc.cap.drop = sys_admin&lt;br /&gt;
lxc.cap.drop = sys_boot&lt;br /&gt;
lxc.cap.drop = sys_module&lt;br /&gt;
lxc.cap.drop = sys_rawio&lt;br /&gt;
lxc.cap.drop = sys_time&lt;br /&gt;
# By default, don't use lxc.cap.drop = mknod. This will allow mknod to create&lt;br /&gt;
# device nodes so build scripts and other things don't fail. Then, we'll&lt;br /&gt;
# rely on the devices.deny settings (default deny) to prevent any created &lt;br /&gt;
# device nodes inside the container from being used to access the host's &lt;br /&gt;
# hardware:&lt;br /&gt;
# lxc.cap.drop = mknod&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Read &amp;quot;man 7 capabilities&amp;quot; to get more information aboout Linux capabilities.&lt;br /&gt;
&lt;br /&gt;
Above, use the following command to generate a random MAC for &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is a very good idea to assign a static MAC address to your container using &amp;lt;tt&amp;gt;lxc.network.hwaddr&amp;lt;/tt&amp;gt;. If you don't, LXC will auto-generate a new random MAC every time your container starts, which may confuse network equipment that expects MAC addresses to remain constant.&lt;br /&gt;
&lt;br /&gt;
It might happen from case to case that you aren't able to start your LXC Container with the above generated MAC address so for all these who run into that problem here is a little script that connects your IP for the container with the MAC address. Just save the following code as &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh&amp;lt;/tt&amp;gt;, make it executable and run it like &amp;lt;tt&amp;gt;/etc/lxc/hwaddr.sh xxx.xxx.xxx.xxx&amp;lt;/tt&amp;gt; where xxx.xxx.xxx.xxx represents your Container IP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
IP=$*&lt;br /&gt;
HA=`printf &amp;quot;02:00:%x:%x:%x:%x&amp;quot; ${IP//./ }`&lt;br /&gt;
echo $HA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;tt&amp;gt;/etc/lxc/funtoo/fstab&amp;lt;/tt&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
none /lxc/funtoo/dev/pts devpts defaults 0 0&lt;br /&gt;
none /lxc/funtoo/proc proc defaults 0 0&lt;br /&gt;
none /lxc/funtoo/sys sysfs defaults 0 0&lt;br /&gt;
none /lxc/funtoo/dev/shm tmpfs nodev,nosuid,noexec,mode=1777,rw 0 0&lt;br /&gt;
none /lxc/funtoo/libexec/rc/init.d tmpfs rw,mode=755 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing and Starting the Container ==&lt;br /&gt;
&lt;br /&gt;
You will probably need to set the root password for the container before you can log in. You can use chroot to do this quickly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chroot /lxc/funtoo&lt;br /&gt;
(chroot) # passwd&lt;br /&gt;
New password: XXXXXXXX&lt;br /&gt;
Retype new password: XXXXXXXX&lt;br /&gt;
passwd: password updated successfully&lt;br /&gt;
# exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the root password is set, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-start -n funtoo -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; option will cause it to run in the background.&lt;br /&gt;
&lt;br /&gt;
To attach to the console:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-console -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to log in and use the container. In addition, the container should now be accessible on the network.&lt;br /&gt;
&lt;br /&gt;
To stop the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lxc-stop -n funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that networking is working from within the container while it is running, and you're good to go!&lt;br /&gt;
&lt;br /&gt;
== LXC Bugs/Missing Features ==&lt;br /&gt;
&lt;br /&gt;
This section is devoted to documenting issues with the current implementation of LXC and its associated tools. We will be gradually expanding this section with detailed descriptions of problems, their status, and proposed solutions.&lt;br /&gt;
&lt;br /&gt;
=== reboot ===&lt;br /&gt;
&lt;br /&gt;
By default, lxc does not support rebooting a container from within. It will simply stop and the host will not know to start it.&lt;br /&gt;
&lt;br /&gt;
=== PID namespaces ===&lt;br /&gt;
&lt;br /&gt;
Process ID namespaces are functional, but the container can still see the CPU utilization of the host via the system load (ie. in &amp;lt;tt&amp;gt;top&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== /dev/pts newinstance ===&lt;br /&gt;
&lt;br /&gt;
* Some changes may be required to the host to properly implement &amp;quot;newinstance&amp;quot; &amp;lt;tt&amp;gt;/dev/pts&amp;lt;/tt&amp;gt;. See [https://bugzilla.redhat.com/show_bug.cgi?id=501718 This Red Hat bug].&lt;br /&gt;
&lt;br /&gt;
=== lxc-create and lxc-destroy ===&lt;br /&gt;
&lt;br /&gt;
* LXC's shell scripts are badly designed and are sure way to destruction, avoid using lxc-create and lxc-destroy.&lt;br /&gt;
&lt;br /&gt;
=== network initialization and cleanup ===&lt;br /&gt;
&lt;br /&gt;
* If used network.type = phys after lxc-stop the interface will be renamed to value from lxc.network.link. It supposed to be fixed in 0.7.4, happens still on 0.7.5 - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01760.html&lt;br /&gt;
&lt;br /&gt;
* Re-starting a container can result in a failure as network resource are tied up from the already-defunct instance: [http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg00824.html]&lt;br /&gt;
&lt;br /&gt;
=== lxc-halt ===&lt;br /&gt;
&lt;br /&gt;
* Missing tool to graceful shutdown container. 'lxc-halt' should be written and be posix sh-compatible, using lxc-execute to run halt in container.&lt;br /&gt;
&lt;br /&gt;
=== funtoo ===&lt;br /&gt;
&lt;br /&gt;
* Our udev should be updated to contain &amp;lt;tt&amp;gt;-lxc&amp;lt;/tt&amp;gt; in scripts. (This has been done as of 02-Nov-2011, so should be resolved. But not fixed in our openvz templates, so need to regen them in a few days.)&lt;br /&gt;
* Our openrc should be patched to handle the case where it cannot mount tmpfs, and gracefully handle this situation somehow. (Work-around in our docs above, which is to mount tmpfs to &amp;lt;tt&amp;gt;/libexec/rc/init.d&amp;lt;/tt&amp;gt; using the container-specific &amp;lt;tt&amp;gt;fstab&amp;lt;/tt&amp;gt; file (on the host.)&lt;br /&gt;
* Emerging udev within a container can/will fail when realdev is run, if a device node cannot be created (such as /dev/console) if there are no mknod capabilities within the container. This should be fixed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 7 capabilities&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;man 5 lxc.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* There are a number of additional lxc features that can be enabled via patches: [http://lxc.sourceforge.net/patches/linux/3.0.0/3.0.0-lxc1/]&lt;br /&gt;
* [https://wiki.ubuntu.com/UserNamespace Ubuntu User Namespaces page]&lt;br /&gt;
* lxc-gentoo setup script [https://github.com/globalcitizen/lxc-gentoo on GitHub]&lt;br /&gt;
&lt;br /&gt;
* '''IBM developerWorks'''&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-containers/index.html LXC: Linux Container Tools]&lt;br /&gt;
** [http://www.ibm.com/developerworks/linux/library/l-lxc-security/ Secure Linux Containers Cookbook]&lt;br /&gt;
&lt;br /&gt;
* '''Linux Weekly News'''&lt;br /&gt;
** [http://lwn.net/Articles/244531/ Smack for simplified access control]&lt;br /&gt;
&lt;br /&gt;
[[Category:Labs]]&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Forking_An_Ebuild</id>
		<title>Forking An Ebuild</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Forking_An_Ebuild"/>
				<updated>2013-01-21T21:18:59Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Often, a Funtoo developer needs to fork an upstream ebuild. This is necessary when we want to apply fixes to it. This page will explain the concepts of forking and how this works in the context of Funtoo.&lt;br /&gt;
&lt;br /&gt;
== Portage Tree Generation ==&lt;br /&gt;
&lt;br /&gt;
Funtoo Linux generates its Portage tree using a special script that essentially takes a Gentoo tree as its starting point, and then applies various modifications to it. The modifications involve adding packages from various overlays, including our [[Overlay:Funtoo-overlay]]. Some packages added are brand new, while other packages are our special forked versions that replace existing packages. &lt;br /&gt;
&lt;br /&gt;
In the vast majority of cases, when we fork a package, we take full responsibility for all ebuilds associated with that package, meaning that we have a full copy of the &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt; directory in one of our overlays.&lt;br /&gt;
&lt;br /&gt;
If you're interested in seeing the actual script that does all these things, take a look at the following files:&lt;br /&gt;
&lt;br /&gt;
; http://git.funtoo.org/funtoo-overlay/tree/funtoo/scripts/current-update.sh: cronned script that calls &amp;lt;tt&amp;gt;merge.py&amp;lt;/tt&amp;gt;.&lt;br /&gt;
;http://git.funtoo.org/funtoo-overlay/tree/funtoo/scripts/merge.py: python script that does the heavy lifting of combining Gentoo tree with various overlays, including our flora and funtoo-overlay. When we want to change what overlays we merge, what packages we exclude as a matter of policy (such as stale packages in some overlays), we make changes to this file.&lt;br /&gt;
; http://git.funtoo.org/funtoo-overlay/tree/funtoo/scripts/merge_utils.py: python module that contains classes and methods that implement the merging functionality.&lt;br /&gt;
&lt;br /&gt;
== Forking an Ebuild ==&lt;br /&gt;
&lt;br /&gt;
In general, we fork ebuilds from Gentoo that we want to modify in some way. Before you fork an ebuild, it's important to understand that in general we fork entire packages, not just a single ebuild. This means that if you want to make some changes to &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt;, you are going to fork all &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt; ebuilds, and then Funtoo will be responsible for continuing to maintain these ebuilds until the package is unforked. Here are the steps we would use to fork &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
# Find &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt; in you regular Portage tree. Make sure you have run &amp;lt;tt&amp;gt;emerge --sync&amp;lt;/tt&amp;gt; recently to ensure it is up-to-date. If you want to fork from very recent changes that are not yet in our tree, you may need to grab the most recent Gentoo Portage tree to serve as your source for &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt; (this typically isn't necessary.)&lt;br /&gt;
# Copy the &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt; directory in its entirety to &amp;lt;tt&amp;gt;funtoo-overlay/sys-foo/bar&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Make any necessary modifications to &amp;lt;tt&amp;gt;funtoo-overlay/sys-foo/bar&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Perform some funtoo-ification steps prior to commit.&lt;br /&gt;
# Add and commit the changes to funtoo-overlay.&lt;br /&gt;
# Push changes to funtoo-overlay.&lt;br /&gt;
&lt;br /&gt;
At this point, the forked &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt; package will be part of funtoo-overlay. The next time our unified Portage tree is generated by &amp;lt;tt&amp;gt;merge.py&amp;lt;/tt&amp;gt; (the one that users have in their &amp;lt;tt&amp;gt;/usr/portage&amp;lt;/tt&amp;gt; and is updated via &amp;lt;tt&amp;gt;emerge --sync&amp;lt;/tt&amp;gt;), your forked ebuild will be used in place of the Gentoo ebuild. Why is this? It is because our &amp;lt;tt&amp;gt;merge.py&amp;lt;/tt&amp;gt; script has been defined with a policy that any ebuilds in funtoo-overlay will replace any existing Gentoo ebuilds if they exist. The mechanism of replacement is that our &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt; directory will be used in place of Gentoo's &amp;lt;tt&amp;gt;sys-foo/bar&amp;lt;/tt&amp;gt; directory. So this is how the forking process works.&lt;br /&gt;
&lt;br /&gt;
== Funtoo-ification ==&lt;br /&gt;
&lt;br /&gt;
When we fork a package from Gentoo, we perform the following tweaks to the package directory before committing:&lt;br /&gt;
&lt;br /&gt;
# Removal of &amp;lt;tt&amp;gt;ChangeLog&amp;lt;/tt&amp;gt;.&lt;br /&gt;
# Run &amp;lt;tt&amp;gt;ebuild foo-1.0.ebuild digest&amp;lt;/tt&amp;gt; before committing. This will cause the &amp;lt;tt&amp;gt;Manifest&amp;lt;/tt&amp;gt; file to be regenerated. Gentoo has a lot more entries in this file than we do, since we use mini-Manfiests that only include DIST listings (for distfiles only.) We want to commit our mini-Manifest (still called &amp;lt;tt&amp;gt;Manifest&amp;lt;/tt&amp;gt;, just with less entries in it) rather than the one that came from Gentoo.&lt;br /&gt;
# Edit the top of each ebuild, and remove all &amp;lt;tt&amp;gt;Copyright&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$Header:&amp;lt;/tt&amp;gt; lines at the top of the file. We have a LICENSE.txt and COPYRIGHT.txt file in the root of our Portage tree, which is easier to maintain than keeping all the years up-to-date in each ebuild. Also, the &amp;lt;tt&amp;gt;$Header:&amp;lt;/tt&amp;gt; line is there for the CVS version control system in Gentoo which Funtoo does not use. ''The only comment that should remain on the top of the ebuild is the one stating that it is distributed under the GPLv2.''.&lt;br /&gt;
&lt;br /&gt;
Here are a few additional changes that you are allowed to make to any forked ebuilds:&lt;br /&gt;
&lt;br /&gt;
# Line length greater than 80 characters. Gentoo enforces an 80-character line length limit. We don't.&lt;br /&gt;
# &amp;lt;tt&amp;gt;KEYWORDS&amp;lt;/tt&amp;gt; of &amp;lt;tt&amp;gt;*&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;~*&amp;lt;/tt&amp;gt;. Gentoo does not allow these shortcuts. We do. They allow you to say &amp;quot;all arches&amp;quot; and &amp;quot;all unstable arches&amp;quot; in a concise way. Gentoo doesn't allow these shortcuts because it's Gentoo's policy to have each arch team manually approve each package. We do not have this policy so we can use the shortcuts.&lt;br /&gt;
# Use of &amp;lt;tt&amp;gt;4-python&amp;lt;/tt&amp;gt; EAPI. We allow the use of this EAPI for enhanced python functionality.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/ZFS_Fun</id>
		<title>ZFS Fun</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/ZFS_Fun"/>
				<updated>2013-01-21T21:17:06Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
 &lt;br /&gt;
== ZFS features and limitations ==&lt;br /&gt;
&lt;br /&gt;
ZFS offers an impressive amount of features even putting aside its hybrid nature (both a filesystem and a volume manager -- zvol) covered in detail on [http://en.wikipedia.org/wiki/ZFS Wikipedia]. One of the most fundamental points to keep in mind about ZFS is it '''targets a legendary reliability in terms of preserving data integrity'''. ZFS uses several techniques to detect and repair (self-healing) corrupted data, simply speaking it makes an aggressive use of checksums and relies on data redundancy, the price pay is it requires a bit more CPU processing power than traditional filesystems and RAID solution. However, the [http://en.wikipedia.org/wiki/ZFS Wikipedia article about ZFS] also mention it is strongly discouraged to use ZFS over classic RAID arrays as it can not control the data redundancy,thus ruining most of its benefits.&lt;br /&gt;
&lt;br /&gt;
In short, ZFS has the following features (not exhaustive):&lt;br /&gt;
&lt;br /&gt;
* Storage pool (if you are used to BTRFS volumes should be familiar)&lt;br /&gt;
* Plenty of space:&lt;br /&gt;
** 256 zettabytes per storage pool (2^64 storages pools max in a system).&lt;br /&gt;
** 16 exabytes max for a single file&lt;br /&gt;
** 2^48 entries max per directory&lt;br /&gt;
* Virtual block-devices support support over a ZFS pool (zvol) - (extremely cool when jointly used  over a RAID-Z volume)&lt;br /&gt;
* Read-only Snapshot support (it is possible to get a read-write copy of them, those are named clones)&lt;br /&gt;
* Encryption support (supported only at ZFS version 30 and upper, ZFS version 31 is shipped with Oracle Solaris 11 so that version is mandatory if you plan to encrypt your ZFS datasets/pools)&lt;br /&gt;
* Built-in''' RAID-5-like-over-steroid capabilities known as [http://en.wikipedia.org/wiki/Non-standard_RAID_levels#RAID-Z RAID-Z] and RAID-6-like-over-steroid capabilities known as RAID-Z2'''. RAID-Z3 (triple parity) also exists.&lt;br /&gt;
* Copy-on-Write transactional filesystem &lt;br /&gt;
* Meta-attributes support (properties) allowing you to you easily drive the show like &amp;quot;That directory is encrypted&amp;quot;, &amp;quot;that directory is limited to 5GiB&amp;quot;, &amp;quot;That directory is exported via NFS&amp;quot; and so on. Depending on what you define, ZFS takes the appropriates actions!&lt;br /&gt;
* Dynamic striping to optimize data throughput &lt;br /&gt;
* Variable block length  &lt;br /&gt;
* Data duplication &lt;br /&gt;
* Automatic pool re-silvering &lt;br /&gt;
* Transparent data compression / encryption (later requires Solaris 11)&lt;br /&gt;
&lt;br /&gt;
Most notable limitations are:&lt;br /&gt;
&lt;br /&gt;
* Lack a features ZFS developers knows as &amp;quot;Block Pointer rewrite functionality&amp;quot; (planned to be developed), without it ZFS suffers of currently not being able to:&lt;br /&gt;
** Pool defragmentation (COW techniques used in ZFS mitigates the problem) &lt;br /&gt;
** Pool resizing &lt;br /&gt;
** Data compression (re-applying)&lt;br /&gt;
** Adding an additional device in a RAID-Z/Z2/Z3 pool to increase it size (however, it is possible to replace in sequence each one of the disks composing a RAID-Z/Z2/Z3)&lt;br /&gt;
* '''NOT A CLUSTERED FILESYSTEM''' like Lustre, GFS or OCFS2&lt;br /&gt;
* No data healing if used on a single device (corruption can still be detected), workaround if to force a data duplication on the drive&lt;br /&gt;
* No support of TRIMming (SSD devices)&lt;br /&gt;
&lt;br /&gt;
== ZFS on well known operating systems ==&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
Despite the source code of ZFS is open, its license (Sun CDDL) is incompatible with the license governing the Linux kernel (GNU GPL v2) thus preventing its direct integration. However a couple of ports exists, but suffers of maturity and lack of features. As of writing (September 2011) two known implementations exists:&lt;br /&gt;
&lt;br /&gt;
* [http://zfs-fuse.net ZFS-fuse]: a totally userland implementation relying on FUSE. Funtoo provides the version 0.7.0 in its portage tree. Worth mentioning at its subject that:&lt;br /&gt;
** It supports zpool version 23&lt;br /&gt;
** It has improved robustness and stability&lt;br /&gt;
** It does not support zvols (feature not planned in a near future according project roadmap&lt;br /&gt;
&lt;br /&gt;
* [http://zfsonlinux.org ZFS on Linux]: a native implementation of ZFS in kernel mode. The project claims to have ''&amp;quot;a functional and stable SPA, DMU, ZVOL, and Posix Layer (ZPL)&amp;quot;''. Current upstream version is 0.6.0-rc5 (can mount ZFS filesystems and support zpool version 28), however neither Gentoo and Funtoo have ebuilds for this port (yet). As ZFS on Linux is an out-of-tree Linux kernel implementation, patches must be waited after each Linux kernel release. As of september 2011, the project claims to have '''support for Linux 2.6.26 up to Linux 3.0.0''', Linux 3.1 series kernels are not officially supported and ZFS on Linux is far from being mature and usable on production systems. It suffers from a couple of major issues like:&lt;br /&gt;
** &amp;lt;s&amp;gt;Crash when used with a preemptable kernel (see [https://github.com/zfsonlinux/zfs/issues/83 issue 83])&amp;lt;/s&amp;gt; Fixed Aug 27, 2012 &lt;br /&gt;
** &amp;lt;s&amp;gt;Deadlocks can happen with some debug options (see [https://github.com/zfsonlinux/zfs/issues/167 issue 167])&amp;lt;/s&amp;gt; Fixed Oct 19, 2011&lt;br /&gt;
&lt;br /&gt;
=== Solaris/OpenIndiana ===&lt;br /&gt;
&lt;br /&gt;
* '''Oracle Solaris:''' remains the de facto reference platform for ZFS implementation: ZFS on this platform is now considered as mature and usable on production systems. Solaris 11 uses ZFS even for its &amp;quot;system&amp;quot; pool (aka ''rpool''). A great advantage of this: it is now quite easy to revert the effect of a patch at the condition a snapshot has been taken just before applying it. In the &amp;quot;old good&amp;quot; times of Solaris 10 and before, reverting a patch was possible but could be tricky and complex when possible. ZFS is far from being new in Solaris as it takes its roots in 2005 to be, then, integrated in Solaris 10 6/06 introduced in June 2006.&lt;br /&gt;
&lt;br /&gt;
* '''[http://openindiana.org OpenIndiana]:''' is based on the Illuminos kernel (a derivative of the now defunct OpenSolaris) which aims to provide absolute binary compatibility with Sun/Oracle Solaris. Worth mentioning that Solaris kernel and the [https://www.illumos.org Illumos kernel] were both sharing the same code base, however, they now follows a different path since Oracle announced the discontinuation of OpenSolaris (August 13th 2010). Like Oracle Solaris, OpenIndiana uses ZFS for its system pool. The illumos kernel ZFS support lags a bit behind Oracle: it  supports zpool version 28 where as Oracle Solaris 11 has zpool version 31 support, data encryption being supported at zpool version 30.&lt;br /&gt;
&lt;br /&gt;
=== *BSD ===&lt;br /&gt;
&lt;br /&gt;
* '''FreeBSD''': ZFS is present in FreeBSD since FreeBSD 7 (zpool version 6) and FreeBSD can boot on a ZFS volume (zfsboot). ZFS support has been vastly enhanced in FreeBSD 8.x (8.2 supports zpool version 15, version 8.3 will support version 28) and FreeBSD 9 (supporting zpool version 28). ZFS in FreeBSD is now considered as fully functional and mature. FreeBSD derivatives such as the popular [http://www.freenas.org FreeNAS] takes befenits of ZFS and integrated it in their tools. In the case of that latter,  it have, for example, supports for zvol though its Web management interface (FreeNAS &amp;gt;= 8.0.1).&lt;br /&gt;
&lt;br /&gt;
* '''NetBSD''': ZFS has been started to be ported as a GSoC project in 2007 and is present in the NetBSD mainstream since 2009 (zpool version 13).&lt;br /&gt;
&lt;br /&gt;
* '''OpenBSD''': No ZFS support yet and not planned until Oracle changes some policies according to the project FAQ.&lt;br /&gt;
&lt;br /&gt;
== ZFS alternatives ==&lt;br /&gt;
&lt;br /&gt;
* WAFL seems to have severe limitation [http://unixconsult.org/wafl/ZFS%20vs%20WAFL.html] (document is not dated), also an interesting article lies [http://blogs.netapp.com/dave/2008/12/is-wafl-a-files.html here]&lt;br /&gt;
* BTRFS is advancing every week but it still lacks such features like the capability of emulating a virtual block device over a storage pool (zvol) and it has a built-in support for RAID-0/1 only. At date of writing, it is still experimental where as ZFS is used on big production servers.  &lt;br /&gt;
* VxFS has also been targeted by comparisons like [http://blogs.oracle.com/dom/entry/zfs_v_vxfs_iozone this one] (a bit [http://www.symantec.com/connect/blogs/suns-comparision-vxfs-and-zfs-scalability-flawed controversial]). VxFS has been known in the industry since 1993 and is known for its legendary flexibility. Symantec acquired VxFS and proposed a basic version (no clustering for example) of it under the same [http://www.symantec.com/enterprise/sfbasic/index.jsp Veritas Storage Foundation Basic]&lt;br /&gt;
* An interesting discussion about modern filesystems can be found on [http://www.osnews.com/story/19665/Solaris_Filesystem_Choices OSNews.com]&lt;br /&gt;
&lt;br /&gt;
== ZFS vs BTRFS ==&lt;br /&gt;
&lt;br /&gt;
BTRFS and ZFS are sibbling in their concepts and of course have differences:&lt;br /&gt;
* both are transactional filesystems (in BTRFS a a transaction is a sequence of low level operations) &lt;br /&gt;
* both implement for example the pool concept (called a &amp;quot;volume&amp;quot; in BTRFS)&lt;br /&gt;
* both can do snapshots although in ZFS a snapshot is a read only thing and its attributes can't be modified. BTRFS on the other hand has writable snapshots (known as clones in ZFS)&lt;br /&gt;
* both can organize their storage pool in several logical divisions (called datasets in ZFS and subvolumes in BTRFS).&lt;br /&gt;
* As their equivalent in BTRFS (subvolumes), ZFS datasets appears as directories &lt;br /&gt;
* Where as a ZFS snapshot is &amp;quot;hidden&amp;quot; in a sub-directory (named .zfs), BTRFS snapshots appears as visible directories&lt;br /&gt;
* While ZFS manages rollback in a transparent manner (the filesystem knows where and how to rollback the data), rollingback data in BTRFS requires a bit more work as the system administrator must umount/remount a BTRFS subvolume.&lt;br /&gt;
* ZFS has a kind of sophisticated RAID-5 called RAID-Z (and now RAID-Z2 ~ RAID-6), similar capabilities are planned for BTRFS but not yet available as of september 2011&lt;br /&gt;
* A ZFS filesytem can be snapshotted and sent through the network, BTRFS has not yet reach that integration level&lt;br /&gt;
* Whereas ZFS makes an aggressive use of properties to govern the behaviour of the different datasets (quotas, sharing over NFS, encryption, compression and so on), BTRFS does not use this notion or in a much light manner and only through the ''mount'' command.&lt;br /&gt;
* '''ZFS has no journal (!)''', this is not a design flaw but an interesting intrinsic feature :) See page 7 of [http://hub.opensolaris.org/bin/download/Community+Group+zfs/docs/zfslast.pdf ''&amp;quot;ZFS The last word on filesystems&amp;quot;'']. Also worth mentioning that BTRFS still lacks a viable filesystem checking tool (announced in august 2011) and sometimes crashes when an invalid log is encountered. BTRFS tools present in experimental branches can however mitigate the problem by allowing the system administrator to clear the BTRFS log in case of a disaster happen (see our article [http://www.funtoo.org/wiki/BTRFS_Fun#Recovering_an_apparent_dead_BTRFS_filesystem BTRFS Fun]).&lt;br /&gt;
&lt;br /&gt;
= ZFS resource naming restrictions =&lt;br /&gt;
&lt;br /&gt;
Before going further, you must be aware of restrictions concerning the names you can use on a ZFS filesystem. The general rule is: you can can use all of the alphanumeric characters plus the following specials are allowed:&lt;br /&gt;
* Underscore (_)&lt;br /&gt;
* Hyphen (-)&lt;br /&gt;
* Colon (:)&lt;br /&gt;
* Period (.)&lt;br /&gt;
&lt;br /&gt;
The name used to designate a ZFS pool has no particular restriction except:&lt;br /&gt;
* it can't use one the reserved words in particular:&lt;br /&gt;
** ''mirror''&lt;br /&gt;
** ''raidz'' (''raidz2'', ''raidz3'' and so on)&lt;br /&gt;
** ''spare''&lt;br /&gt;
** ''cache''&lt;br /&gt;
** ''log''&lt;br /&gt;
* names must begin with an alphanumeric character (same for ZFS datasets).&lt;br /&gt;
&lt;br /&gt;
= Playing with ZFS  =&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Kernel with FUSE stuff enabled&lt;br /&gt;
* sys-fs/zfs-fuse installed&lt;br /&gt;
* '''/etc/init.d/zfs''' started (automatically detects and mounts pools)&lt;br /&gt;
* Disk size of 64 Mbytes as a bare minimum (128 Mbytes is the minimum size of a pool). Multiple disk will be simulated through the use of several raw images accessed via the Linux loopback devices.&lt;br /&gt;
* At least 512 MB of RAM&lt;br /&gt;
&lt;br /&gt;
== Your first ZFS pool ==&lt;br /&gt;
&lt;br /&gt;
To start with, four raw disks (2 GB each) are created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for i in 0 1 2 3; do dd if=/dev/zero of=/tmp/zfs-test-disk0${i}.img bs=2G count=1; done&lt;br /&gt;
0+1 records in&lt;br /&gt;
0+1 records out&lt;br /&gt;
2147479552 bytes (2.1 GB) copied, 40.3722 s, 53.2 MB/s&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let's see what loopback devices are in use and which is the first free:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# losetup -a&lt;br /&gt;
# losetup -f&lt;br /&gt;
/dev/loop0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example nothing is used and the first available loopback device is /dev/loop0. Now associate all of the disks with a loopback device (/tmp/zfs-test-disk00.img -&amp;gt; /dev/loop/0, /tmp/zfs-test-disk01.img -&amp;gt; /dev/loop/1 and so on):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for i in 0 1 2 3; do losetup /dev/loop${i} /tmp/zfs-test-disk0${i}.img; done&lt;br /&gt;
# losetup -a&lt;br /&gt;
/dev/loop0: [000c]:781455 (/tmp/zfs-test-disk00.img)&lt;br /&gt;
/dev/loop1: [000c]:806903 (/tmp/zfs-test-disk01.img)&lt;br /&gt;
/dev/loop2: [000c]:807274 (/tmp/zfs-test-disk02.img)&lt;br /&gt;
/dev/loop3: [000c]:781298 (/tmp/zfs-test-disk03.img)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pool creation ===&lt;br /&gt;
&lt;br /&gt;
It is now time to create our first ZFS data pool and this is accomplished by one of the two commands you have to retain: zfspool. For now, we will ask it to do a simple job: get all of the just created devices and create an aggregated pool:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs create myfirstpool /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3&lt;br /&gt;
# mount&lt;br /&gt;
...&lt;br /&gt;
kstat on /zfs-kstat type fuse (rw,nosuid,nodev,allow_other)&lt;br /&gt;
myfirstpool on /myfirstpool type fuse (rw,allow_other,default_permissions)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the pool has also been mounted on /myfirstpool! Forget kstat for now, it is mounted automatically by zfs-fuse and countains some performance statistics. Oh by the way, we have used block devices (loopback devices are block devices) to create our ZFS pool, however ZFS can also deal directly with files and the taxonomy used in the ZFS world retains the term '''vdev''' (virtual device). Let's be curious a bit and see what df reports:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# df -h&lt;br /&gt;
# myfirstpool                          7.9G   21K  7.9G   1% /myfirstpool&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cool! About 8GB are reported, this is barely the sum of our four ''vdevs'' minus some metadata. What can we do with 8 GB of free storage space? Copy some files in it of course! &lt;br /&gt;
&lt;br /&gt;
=== Some file operations ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp -a  /usr/src/linux-3.1-rc4 /myfirstpool&lt;br /&gt;
# df -h&lt;br /&gt;
myfirstpool                          7.9G  662M  7.2G   9% /myfirstpool&lt;br /&gt;
# cd /myfirstpool&lt;br /&gt;
# ls -l /myfirstpool&lt;br /&gt;
total 3&lt;br /&gt;
drwxrwxr-x 24 root root 56 Aug 29 08:41 linux-3.1-rc4&lt;br /&gt;
# ls -l /myfirstpool/linux-3.1-rc4&lt;br /&gt;
total 29&lt;br /&gt;
-rw-rw-r--  1 root root    18693 Aug 29 00:16 COPYING&lt;br /&gt;
-rw-rw-r--  1 root root    94790 Aug 29 00:16 CREDITS&lt;br /&gt;
drwxrwxr-x 94 root root      222 Aug 29 00:16 Documentation&lt;br /&gt;
-rw-rw-r--  1 root root     2464 Aug 29 00:16 Kbuild&lt;br /&gt;
-rw-rw-r--  1 root root      252 Aug 29 00:16 Kconfig&lt;br /&gt;
-rw-rw-r--  1 root root   200918 Aug 29 00:16 MAINTAINERS&lt;br /&gt;
-rw-rw-r--  1 root root    53537 Aug 29 00:16 Makefile&lt;br /&gt;
-rw-r--r--  1 root root   364907 Aug 29 08:41 Module.symvers&lt;br /&gt;
-rw-rw-r--  1 root root    17459 Aug 29 00:16 README&lt;br /&gt;
....&lt;br /&gt;
drwxrwxr-x 22 root root       41 Aug 29 08:41 sound&lt;br /&gt;
drwxrwxr-x  9 root root        9 Aug 29 00:16 tools&lt;br /&gt;
drwxrwxr-x  2 root root       11 Aug 29 08:38 usr&lt;br /&gt;
drwxrwxr-x  3 root root        3 Aug 29 00:16 virt&lt;br /&gt;
-rwxr-xr-x  1 root root 13126551 Aug 29 08:41 vmlinux&lt;br /&gt;
-rw-r--r--  1 root root 14771911 Aug 29 08:41 vmlinux.o&lt;br /&gt;
# make clean&lt;br /&gt;
# df -h&lt;br /&gt;
Filesystem                           Size  Used Avail Use% Mounted on&lt;br /&gt;
...&lt;br /&gt;
myfirstpool                          7.9G  444M  7.4G   6% /myfirstpool&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In fact nothing magic, a ZFS pool is acting just like any other existing filesystem :)&lt;br /&gt;
&lt;br /&gt;
=== Unmounting/remounting the pool ===&lt;br /&gt;
&lt;br /&gt;
If ZFS behaves just like any other filesystem, can we unmount it?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# umount /myfirstpool&lt;br /&gt;
# mount | grep myfirstpool&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No more /myfirstpool in our light of sight. So yes, it is possible to unmount a ZFS pool just like with any other filesystem. But... How can we remount it then? Simple! First check the list of all ZFS pools known by the system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zpool list&lt;br /&gt;
NAME          SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT&lt;br /&gt;
myfirstpool  7.94G   444M  7.50G     5%  1.00x  ONLINE  -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then mount it again:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zpool list&lt;br /&gt;
NAME          SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT&lt;br /&gt;
myfirstpool  7.94G   444M  7.50G     5%  1.00x  ONLINE  -&lt;br /&gt;
# zfs mount myfirstpool&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Oh! Did you noticed? We used the '''zfs''' command instead of the '''zpool''' command. You will understand the reason of using '''zfs''' instead of '''zpool''' a bit later, for now just remember that '''zfs''' and zpool are the only two commands used to interact with the ZFS universe. Also note that '''zfs mount...''' is the one and only way to remount a ZFS pool in the VFS arborescence so you can't be confused or do errors.&lt;br /&gt;
&lt;br /&gt;
{{fancynote|The missing leading / ahead of myfirstpool '''is not a typo'''. When a pool is created, ZFS writes in the pool metadata where it must be mounted. Unless overridden, it is assumed that the pool is to be mounted directly under the VFS root in a mountpoint which has the same name of the pool.}}&lt;br /&gt;
&lt;br /&gt;
Let's check what happened:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mount | grep myfirstpool&lt;br /&gt;
myfirstpool on /myfirstpool type fuse (rw,allow_other,default_permissions)&lt;br /&gt;
# ls -l /myfirstpool&lt;br /&gt;
total 3&lt;br /&gt;
drwxrwxr-x 23 root root 33 Sep  4 18:18 linux-3.1-rc4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Everything is back again!&lt;br /&gt;
&lt;br /&gt;
== ZFS datasets ==&lt;br /&gt;
&lt;br /&gt;
Just like your house is a kind of big container subdivided in many others container (rooms), a ZFS pool can be divided in several logical containers known as ''datasets''. Basically, the role of a dataset is to fullfill the so well known adage ''divide and conquer'' as they define the frontiers where all ZFS operations take place: it is '''only''' possible, for example, to take a snapshot/do a rollback of a dataset '''taken at whole'''. &lt;br /&gt;
&lt;br /&gt;
=== Creating and destroying datasets ===&lt;br /&gt;
&lt;br /&gt;
Creating a dataset in a pool is pretty easy to achieve: you invoke the '''zfs''' command, you give it the name of the pool to divide and the name of the dataset to create. To create three datasets named ''myfirstDS, mysecondDS, mythirdDS'' in ''myfirstpool''(again the missing / ahead of ''myfirstpool'' is '''not''' a typo) :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs create myfirstpool/myfirstDS&lt;br /&gt;
# zfs create myfirstpool/mysecondDS&lt;br /&gt;
# zfs create myfirstpool/mythirdDS&lt;br /&gt;
# ls -l /myfirstpool&lt;br /&gt;
total 7&lt;br /&gt;
drwxrwxr-x 23 root root 33 Sep  4 18:18 linux-3.1-rc4&lt;br /&gt;
drwxr-xr-x  2 root root  2 Sep  4 23:34 myfirstDS&lt;br /&gt;
drwxr-xr-x  2 root root  2 Sep  4 23:34 mysecondDS&lt;br /&gt;
drwxr-xr-x  2 root root  2 Sep  4 23:34 mythirdDS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Datasets are appearing just as if they were regular directories. Are they? Try to remove one of those:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rmdir /myfirstpool/myfirstDS&lt;br /&gt;
rmdir: failed to remove `/myfirstpool/myfirstDS': Device or resource busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This behavior is absolutely normal, datasets are special entities and must be managed via ZFS commands. Trouble: how a regular directory with files opened by a running process can be distinguished from a ZFS dataset? Both looks similar! Here again, the '''zfs''' command rescues us:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs list&lt;br /&gt;
NAME                     USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
myfirstpool              444M  7.38G   444M  /myfirstpool&lt;br /&gt;
myfirstpool/myfirstDS     21K  7.38G    21K  /myfirstpool/myfirstDS&lt;br /&gt;
myfirstpool/mysecondDS    21K  7.38G    21K  /myfirstpool/mysecondDS&lt;br /&gt;
myfirstpool/mythirdDS     21K  7.38G    21K  /myfirstpool/mythirdDS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Not obvious but '''zfs list''' also reveals you a great secret: '''we lied you''' in the previous paragraphs. It it not possible to mount a ZFS pool in the VFS arborescence as '''only''' datasets can be mounted. So where is the prank? Our ''myfirstpool'' had been mounted in the VFS and you never defined any datasets in it. How is that possible? Is there some ZFS black magic lying behind? No. When you created the ZFS pool ''myfirstpool'', a special dataset had also been created in the pool automatically for you: the ''root dataset''. When you typed '''zfs mount mypool''',  you had in fact interact with this root dataset and not with the pool in itself. The operation was transparent for you and you never noticed its presence although using the zfs command instead of zpool could have given you a hint about what lies under the hood. You see that root dataset in the first line of what zfs list reported in the example above. &lt;br /&gt;
&lt;br /&gt;
So the root dataset (myfirstpool) is mounted on /myfirstpool, myfirstDS is then mounted inside (/myfirstpool/myfirstDS) ditto for mysecondDS and mythirdDS. ''Mounted'' is the exact term because if we have a look at what the '''mount''' command reports we can see that those datasets have been '''''effectively''''' mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mount&lt;br /&gt;
rootfs on / type rootfs (rw)&lt;br /&gt;
...&lt;br /&gt;
myfirstpool on /myfirstpool type fuse (rw,allow_other,default_permissions)&lt;br /&gt;
myfirstpool/myfirstDS on /myfirstpool/myfirstDS type fuse (rw,allow_other,default_permissions)&lt;br /&gt;
myfirstpool/mysecondDS on /myfirstpool/mysecondDS type fuse (rw,allow_other,default_permissions)&lt;br /&gt;
myfirstpool/mythirdDS on /myfirstpool/mythirdDS type fuse (rw,allow_other,default_permissions)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we did before, we can copy some files in the newly created datasets just like they were regular directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp -a /usr/portage /myfirstpool/mythirdDS&lt;br /&gt;
# ls -l /myfirstpool/mythirdDS/*&lt;br /&gt;
total 438&lt;br /&gt;
drwxr-xr-x   45 root root      46 Aug 31 07:37 app-accessibility&lt;br /&gt;
drwxr-xr-x  202 root root     203 Sep  2 07:21 app-admin&lt;br /&gt;
drwxr-xr-x    3 root root       4 Aug 18 18:13 app-antivirus&lt;br /&gt;
drwxr-xr-x   93 root root      94 Aug 18 18:13 app-arch&lt;br /&gt;
drwxr-xr-x   38 root root      39 Aug 18 18:13 app-backup&lt;br /&gt;
drwxr-xr-x   30 root root      31 Aug 18 18:13 app-benchmarks&lt;br /&gt;
drwxr-xr-x   66 root root      67 Aug 18 18:13 app-cdr&lt;br /&gt;
drwxr-xr-x   96 root root      97 Aug 18 18:13 app-crypt&lt;br /&gt;
drwxr-xr-x  358 root root     359 Aug 18 18:13 app-dicts&lt;br /&gt;
...&lt;br /&gt;
# df -h | grep DS                &lt;br /&gt;
myfirstpool/myfirstDS                5.6G   21K  5.6G   1% /myfirstpool/myfirstDS&lt;br /&gt;
myfirstpool/mysecondDS               5.6G   21K  5.6G   1% /myfirstpool/mysecondDS&lt;br /&gt;
myfirstpool/mythirdDS                7.4G  1.9G  5.6G  25% /myfirstpool/mythirdDS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice what '''df''' returns: our four datasets shares (don't forget the root dataset!) shares the same storage capacity. Logical indeed: as they are all contained in the same pool they cannot exceed its own storage capacity. Is it possible to cap the maximum capacity of a dataset? Yes, for now just retain that datasets:&lt;br /&gt;
# are logical containers where ZFS operations take place&lt;br /&gt;
# are concerned at whole by ZFS operations (again: you cannot snapshot/rollback a particular directory located in a dataset, '''you can only operate at the dataset level''')&lt;br /&gt;
&lt;br /&gt;
We have three datasets, but the third is pretty useless and contains a lot of garbage. Is it possible to remove it with a simple '''rm -rf'''? Let's try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rm -rf /myfirstpool/mythirdDS&lt;br /&gt;
rm: cannot remove `/myfirstpool/mythirdDS': Device or resource busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is perfectly normal, remember that datasets are special entities that requires special care and they are not deletable through regular shell commands. However it is possible to destroy them and here again, the '''zfs''' command comes at our rescue:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs destroy myfirstpool/mythirdDS&lt;br /&gt;
# zfs list&lt;br /&gt;
NAME                     USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
myfirstpool              444M  7.38G   444M  /myfirstpool&lt;br /&gt;
myfirstpool/myfirstDS     21K  7.38G    21K  /myfirstpool/myfirstDS&lt;br /&gt;
myfirstpool/mysecondDS    21K  7.38G    21K  /myfirstpool/mysecondDS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voila''! No more third dataset. :)&lt;br /&gt;
&lt;br /&gt;
A bit more subtle case: let's mythirdDS and put another nested one in it then try to destroy mythirdDS again:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs create myfirstpool/mythirdDS&lt;br /&gt;
# zfs create myfirstpool/mythirdDS/nestedSD&lt;br /&gt;
# zfs list&lt;br /&gt;
NAME                             USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
myfirstpool                      444M  7.38G   444M  /myfirstpool&lt;br /&gt;
myfirstpool/myfirstDS             21K  7.38G    21K  /myfirstpool/myfirstDS&lt;br /&gt;
myfirstpool/mysecondDS            21K  7.38G    21K  /myfirstpool/mysecondDS&lt;br /&gt;
myfirstpool/mythirdDS             42K  7.38G    21K  /myfirstpool/mythirdDS&lt;br /&gt;
myfirstpool/mythirdDS/nestedDS    21K  7.38G    21K  /myfirstpool/mythirdDS/nestedDS&lt;br /&gt;
# zfs destroy myfirstpool/mythirdDS&lt;br /&gt;
cannot destroy 'myfirstpool/mythirdDS': filesystem has children&lt;br /&gt;
use '-r' to destroy the following datasets:&lt;br /&gt;
myfirstpool/mythirdDS/nestedDS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''zfs''' tells us it has found some others datasets located in ''mythirdDS'' and, thus, is unable to delete it without you consent to make a recursive destruction (-r parameter). Before trying to destroy the dataset again let's create some more nested datasets plus a couple of directories inside ''mythirdDS'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs create myfirstpool/mythirdDS/nestedSD&lt;br /&gt;
# zfs create myfirstpool/mythirdDS/nestedSD2&lt;br /&gt;
# zfs create myfirstpool/mythirdDS/nestedSD3&lt;br /&gt;
# mkdir /myfirstpool/mythirdDS/dir1&lt;br /&gt;
# mkdir /myfirstpool/mythirdDS/dir2&lt;br /&gt;
# mkdir /myfirstpool/mythirdDS/dir3&lt;br /&gt;
# zfs list&lt;br /&gt;
NAME                                USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
myfirstpool                         444M  7.38G   444M  /myfirstpool&lt;br /&gt;
myfirstpool/myfirstDS                21K  7.38G    21K  /myfirstpool/myfirstDS&lt;br /&gt;
myfirstpool/mysecondDS               21K  7.38G    21K  /myfirstpool/mysecondDS&lt;br /&gt;
myfirstpool/mythirdDS                84K  7.38G    21K  /myfirstpool/mythirdDS&lt;br /&gt;
myfirstpool/mythirdDS/mynestedDS     21K  7.38G    21K  /myfirstpool/mythirdDS/mynestedDS&lt;br /&gt;
myfirstpool/mythirdDS/mynestedDS2    21K  7.38G    21K  /myfirstpool/mythirdDS/mynestedDS2&lt;br /&gt;
myfirstpool/mythirdDS/mynestedDS3    21K  7.38G    21K  /myfirstpool/mythirdDS/mynestedDS3&lt;br /&gt;
# zfs destroy -r myfirstpool/mythirdDS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now what happens if we try to destroy mythird again this time with '-r'?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs destroy -r myfirstpool/mythirdDS        &lt;br /&gt;
cannot destroy 'myfirstpool/mythirdDS/mynestedDS': dataset is busy&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is not as exactly normal as it should and seems to be a bug in zfs-fuse, the expected behavior is to automatically unmount any dataset contained inside ''mythirdDS'' then destroy it including ''mythirdDS'' itself. The same kind of operation on a Solaris machine with a similar dataset structure gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs list&lt;br /&gt;
NAME                              USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
....&lt;br /&gt;
rpool1/swap                      4.04G  23.2G   123M  -&lt;br /&gt;
testpool/test                    55.4K  3.76T  55.4K  /testpool/test&lt;br /&gt;
testpool/test/ds1                44.9K  3.76T  44.9K  /testpool/test/ds1&lt;br /&gt;
testpool/test/ds2                44.9K  3.76T  44.9K  /testpool/test/ds2&lt;br /&gt;
testpool/test/ds3                44.9K  3.76T  44.9K  /testpool/test/ds3&lt;br /&gt;
testpool/test2                   44.9K  3.76T  44.9K  /testpool/test2&lt;br /&gt;
# mkdir /testpool/test/dir1&lt;br /&gt;
# mkdir /testpool/test/dir2&lt;br /&gt;
# mkdir /testpool/test/dir1&lt;br /&gt;
# zfs destroy -r testpool/test&lt;br /&gt;
# zfs list&lt;br /&gt;
NAME                              USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
....&lt;br /&gt;
rpool1/swap                      4.04G  23.2G   123M  -&lt;br /&gt;
testpool/test2                   44.9K  3.76T  44.9K  /testpool/test2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To go back on ZFS Fuse, just do a few attempts and ''mythirdDS'' should vanish (you may also have to do an explicit '''zfs destroy mythirdDS''' at the end).&lt;br /&gt;
&lt;br /&gt;
=== Snapshotting and rolling back a dataset ===&lt;br /&gt;
&lt;br /&gt;
This is, by far, one of the coolest feature of ZFS: you can litterally take a photograph of a dataset, do whatever you want with the dataset then restore it in the '''exact''' same state just as if nothing had ever happened in the middle. To start with, let's copy some files in ''mysecondDS'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp -a /usr/portage /myfirstpool/mysecondDS&lt;br /&gt;
# ls /myfirstpool/mysecondDS/portage&lt;br /&gt;
total 200&lt;br /&gt;
drwxr-xr-x   45 root root      46 Aug 31 07:37 app-accessibility&lt;br /&gt;
drwxr-xr-x  202 root root     203 Sep  2 07:21 app-admin&lt;br /&gt;
drwxr-xr-x    3 root root       4 Aug 18 18:13 app-antivirus&lt;br /&gt;
drwxr-xr-x   93 root root      94 Aug 18 18:13 app-arch&lt;br /&gt;
...&lt;br /&gt;
drwxr-xr-x   57 root root      58 Aug 22 08:56 x11-wm&lt;br /&gt;
drwxr-xr-x   16 root root      17 Aug 18 18:13 xfce-base&lt;br /&gt;
drwxr-xr-x   54 root root      55 Aug 18 18:13 xfce-extra&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let's take a snapshot of ''mysecondDS''. Because we manipulate a dataset and not the pool, we rely on the '''zfs''' command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs snapshot myfirstpool/mysecondDS@Charlie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{fancynote|The syntax is always ''pool/dataset@snapshot-name'', the name of the snapshot is left at your discretion however '''you must use an at sign (@)''' to separate the snapshot name from the rest of the path.}}&lt;br /&gt;
&lt;br /&gt;
After running that command, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ls -la /myfirstpool/mysecondDS&lt;br /&gt;
total 9&lt;br /&gt;
drwxr-xr-x   3 root root   3 Sep  5 16:49 .&lt;br /&gt;
drwxr-xr-x   6 root root   6 Sep  5 15:43 ..&lt;br /&gt;
drwxr-xr-x 164 root root 169 Aug 18 18:25 portage&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You were not thinking you would see something like ''@Charlie'' or ''Charlie'' lying in /myfirstpool/mysecondDS were you? Of course not, this is obvious ;-) Can '''zfs''' be of any help this time? It has rescued us several times in the past:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs list &lt;br /&gt;
NAME                               USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
myfirstpool                       2.27G  5.54G   444M  /myfirstpool&lt;br /&gt;
myfirstpool/myfirstDS               21K  5.54G    21K  /myfirstpool/myfirstDS&lt;br /&gt;
myfirstpool/mysecondDS            1.84G  5.54G  1.84G  /myfirstpool/mysecondDS&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''So where the heck'' is Charlie? And how on earth can we use it if '''*nothing*''' is visible to us. Again the answer is: '''zfs'''! This time we invoke it with the -t parameter set to 'all' meaning &amp;quot;list all dataset '''including snapshots'''&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs list &lt;br /&gt;
NAME                               USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
myfirstpool                       2.27G  5.54G   444M  /myfirstpool&lt;br /&gt;
myfirstpool/myfirstDS               21K  5.54G    21K  /myfirstpool/myfirstDS&lt;br /&gt;
myfirstpool/mysecondDS            1.84G  5.54G  1.84G  /myfirstpool/mysecondDS&lt;br /&gt;
myfirstpool/mysecondDS@Charlie      37K      -  1.84G  -&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that ''Charlie'' is not mounted and although ''mysecondDS'' holds near 2GB of data, ''Charlie'' takes only a couple of kilobytes in the dataset. This is the consequence of ZFS being a Copy-on-write filesystem, duplicating all of the data blocks is not required. They will be duplicated only when needed: when ZFS sense a change in a data block, it will create a copy of it thus leaving intact the datablock pointed by a snapshot. At the time they are taken, snapshots occupy very little space in the datasets however as the time goes on they tend to &amp;quot;stick&amp;quot;more and more data blocks to be in use. It is wise to delete snapshots when become not needed anymore.&lt;br /&gt;
&lt;br /&gt;
{{fancynote|'''OpenIndiana''' and '''Oracle Solaris''' supports an interesting feature not available in ZFS Fuse: a kind of secret door in the form of a virtual directory named ''.zfs'' (notice the dot ahead). &amp;quot;secret door&amp;quot; because it is really secret! You cannot see it ''even'' with''' ls -la''', however ''.zfs'' is present in just any of your datasets and holds some very interesting clues:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs list -t all&lt;br /&gt;
...&lt;br /&gt;
testpool/test2                     205K  3.76T  70.3K  /testpool/test2&lt;br /&gt;
testpool/test2@snap1                  0      -  70.3K  -&lt;br /&gt;
# cd /testpool/test2&lt;br /&gt;
# ls -la&lt;br /&gt;
total 22&lt;br /&gt;
drwxr-xr-x  11 root root 11 2011-09-05 17:34 .&lt;br /&gt;
drwxr-xr-x   6 root root  6 2011-09-05 16:13 ..&lt;br /&gt;
drwxr-xr-x   2 root root  2 2011-09-05 17:34 .sometest&lt;br /&gt;
drwxr-xr-x   2 root root  2 2011-09-05 17:34 .xyz&lt;br /&gt;
drwxr-xr-x   2 root root  2 2011-09-05 16:13 dir1&lt;br /&gt;
drwxr-xr-x   2 root root  2 2011-09-05 16:13 dir2&lt;br /&gt;
...&lt;br /&gt;
# cd /testpool/test2/.zfs&lt;br /&gt;
# pwd&lt;br /&gt;
/testpool/test2/.zfs&lt;br /&gt;
# ls -l&lt;br /&gt;
ls -l&lt;br /&gt;
total 2&lt;br /&gt;
dr-xr-xr-x 2 root root 2 2011-09-05 16:13 shares&lt;br /&gt;
dr-xr-xr-x 3 root root 3 2011-09-05 17:19 snapshot&lt;br /&gt;
# cd snapshot&lt;br /&gt;
# ls -l&lt;br /&gt;
total 2&lt;br /&gt;
drwxr-xr-x 9 root root 9 2011-09-05 17:19 snap1&lt;br /&gt;
# cd snap1&lt;br /&gt;
# ls -l&lt;br /&gt;
total 22&lt;br /&gt;
drwxr-xr-x  11 root root 11 2011-09-05 17:34 .&lt;br /&gt;
drwxr-xr-x   6 root root  6 2011-09-05 16:13 ..&lt;br /&gt;
drwxr-xr-x   2 root root  2 2011-09-05 17:34 .sometest&lt;br /&gt;
drwxr-xr-x   2 root root  2 2011-09-05 17:34 .xyz&lt;br /&gt;
drwxr-xr-x   2 root root  2 2011-09-05 16:13 dir1&lt;br /&gt;
drwxr-xr-x   2 root root  2 2011-09-05 16:13 dir2&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Despite you cannot change the snapshot contents, you can access it without having to roll it back to examine its contents. Extremely nifty design choice from the ZFS designers! &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now we have found Charlie, let's do some changes in the ''mysecondDS'': &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rm -rf /myfirstpool/mysecondDS/portage&lt;br /&gt;
# echo &amp;quot;Hello, world&amp;quot; &amp;gt;  /myfirstpool/mysecondDS/hello.txt&lt;br /&gt;
# ls -l  /myfirstpool/mysecondDS&lt;br /&gt;
total 1&lt;br /&gt;
-rw-r--r-- 1 root root 13 Sep  5 18:07 hello.txt&lt;br /&gt;
# cat /myfirstpool/mysecondDS/hello.txt&lt;br /&gt;
Hello, world&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whooops...removing portage was not the best idea to have and we do not bother about hello.txt. We will have to move back at checkpoint Charlie!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs rollback myfirstpool/mysecondDS@Charlie&lt;br /&gt;
# ls -l /myfirstpool/mysecondDS&lt;br /&gt;
total 6&lt;br /&gt;
drwxr-xr-x 164 root root 169 Aug 18 18:25 portage&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, ZFS handled everything for you and you now have the contents of ''mysecondDS'' exactly as it was at the time the snapshot ''Charlie'' was taken. Not more complicated than that. Hang on you hat, we have not finished.&lt;br /&gt;
&lt;br /&gt;
=== Dealing with several snapshots (time-traveling machine) ===&lt;br /&gt;
&lt;br /&gt;
So far we only used a single snapshot just to keep things simple. However a dataset can hold several snapshots and moreover you can do a delta between two snapshots and nothing is really much more complicated than you have seen so far. &lt;br /&gt;
&lt;br /&gt;
Let's consider myfirstDS this time. This dataset should be empty as we did nothing in it so far:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ls -la /myfirstpool/myfirstDS&lt;br /&gt;
total 3&lt;br /&gt;
drwxr-xr-x 2 root root 2 Sep  4 23:34 .&lt;br /&gt;
drwxr-xr-x 6 root root 6 Sep  5 15:43 ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now generate some contents, take a snapshot (snapshot-1), add more content, take a snapshot again (snapshot-2), do some more modifications and take a third snapshot (snapshot-3):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;Hello, world&amp;quot; &amp;gt;  /myfirstpool/myfirstDS/hello.txt&lt;br /&gt;
# cp /usr/src/linux-3.1-rc4.tar.bz2 /myfirstpool/myfirstDS&lt;br /&gt;
# ls -l /myfirstpool/myfirstDS&lt;br /&gt;
# ls -l /myfirstpool/myfirstDS&lt;br /&gt;
total 75580&lt;br /&gt;
-rw-r--r-- 1 root root       13 Sep  5 22:38 hello.txt&lt;br /&gt;
-rw-r--r-- 1 root root 77220912 Sep  5 22:38 linux-3.1-rc4.tar.bz2&lt;br /&gt;
# zfs snapshot myfirstpool/myfirstDS@snapshot-1&lt;br /&gt;
# echo &amp;quot;Goodbye, world&amp;quot; &amp;gt;  /myfirstpool/myfirstDS/goodbye.txt&lt;br /&gt;
# echo &amp;quot;Are you there?&amp;quot; &amp;gt;&amp;gt; /myfirstpool/myfirstDS/hello.txt&lt;br /&gt;
# cp /usr/src/linux-3.0.tar.bz2 /myfirstpool/myfirstDS&lt;br /&gt;
# rm /myfirstpool/myfirstDS/linux-3.1-rc4.tar.bz2&lt;br /&gt;
# zfs snapshot myfirstpool/myfirstDS@snapshot-2&lt;br /&gt;
# echo &amp;quot;Still there?&amp;quot; &amp;gt;&amp;gt; /myfirstpool/myfirstDS/goodbye.txt&lt;br /&gt;
# rm /myfirstpool/myfirstDS/hello.txt&lt;br /&gt;
# cp /proc/config.gz /myfirstpool/myfirstDS&lt;br /&gt;
# zfs snapshot myfirstpool/myfirstDS@snapshot-3&lt;br /&gt;
# zfs list -t all&lt;br /&gt;
# zfs list -t all&lt;br /&gt;
NAME                               USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
myfirstpool                       2.41G  5.40G   444M  /myfirstpool&lt;br /&gt;
myfirstpool/myfirstDS              147M  5.40G  73.3M  /myfirstpool/myfirstDS&lt;br /&gt;
myfirstpool/myfirstDS@snapshot-1  73.8M      -  73.8M  -&lt;br /&gt;
myfirstpool/myfirstDS@snapshot-2    20K      -  73.3M  -&lt;br /&gt;
myfirstpool/myfirstDS@snapshot-3      0      -  73.3M  -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wow, nice demonstration on how a Copy-on-Write filesystem like ZFS works: what do we observe? First it is quite obvious to see that ''snapshot-1'' is quite big. Is is possible that having a so big snapshot to be the consequence of removing /myfirstDS/linux-3.1-rc4.tar.bz2? Absolutely. Remember that a snapshot is a photograph of what a dataset contains at a given time, deleted information and unmodified original information is retained by the snapshot even you delete it from the dataset or bring in some changes to it. If you look again at the command history between snapshot-2 and snapshot-3, you will notice that we removed a small file and changed another small file a bit thus having a little information delta between what the dataset content at this time and what it also actually contains leading to a very small snapshot at the end. The third dataset is the exact copy of what the current dataset contains thus its size is very close to zero (truncated to zero on what you see).&lt;br /&gt;
&lt;br /&gt;
$100 question: &amp;quot;How can I see what changed between snapshots?&amp;quot;. Answer: ''yes, you can!'' Nuance is: ZFS Fuse does not support it yet :( Nevertheless here is what snapshots diffing looks like on an OpenIndiana/Solaris machine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs create testpool/test2&lt;br /&gt;
# cd /testpool/test2&lt;br /&gt;
# wget http://www.kernel.org/pub/linux/kernel/v3.0/testing/patch-3.1-rc4.bz2&lt;br /&gt;
# echo &amp;quot;Hello,world&amp;quot; &amp;gt; hello.txt&lt;br /&gt;
# zfs snapshot testpool/test2@s1&lt;br /&gt;
&lt;br /&gt;
# rm patch-3.1-rc4.bz2&lt;br /&gt;
# echo 'Goodbye!' &amp;gt; goodbye.txt&lt;br /&gt;
# echo 'Still there?' &amp;gt;&amp;gt; hello.txt&lt;br /&gt;
# zfs snapshot testpool/test2@s2&lt;br /&gt;
&lt;br /&gt;
# echo 'Hello, again' &amp;gt;&amp;gt; hello.txt&lt;br /&gt;
# ln -s goodbye.txt goodbye2.txt&lt;br /&gt;
# mv hello.txt hello-new.txt&lt;br /&gt;
# zfs snapshot testpool/test2@s3&lt;br /&gt;
&lt;br /&gt;
# zfs list -t all | grep test2&lt;br /&gt;
testpool/test2                    8.49M  3.76T  47.9K  /testpool/test2&lt;br /&gt;
testpool/test2@s1                 8.41M      -  8.42M     -&lt;br /&gt;
testpool/test2@s2                 29.2K      -  46.4K     -&lt;br /&gt;
testpool/test2@s3                     0      -  47.9K     -&lt;br /&gt;
 &lt;br /&gt;
# zfs diff testpool/test2@s1 testpool/test2@s2&lt;br /&gt;
M       /testpool/test2/&lt;br /&gt;
-       /testpool/test2/patch-3.1-rc4.bz2&lt;br /&gt;
M       /testpool/test2/hello.txt&lt;br /&gt;
+       /testpool/test2/goodbye.txt&lt;br /&gt;
&lt;br /&gt;
# zfs diff testpool/test2@s2 testpool/test2@s3&lt;br /&gt;
M       /testpool/test2/&lt;br /&gt;
R       /testpool/test2/hello.txt -&amp;gt; /testpool/test2/hello-new.txt&lt;br /&gt;
+       /testpool/test2/goodbye2.txt &lt;br /&gt;
&lt;br /&gt;
# zfs diff testpool/test2@s1 testpool/test2@s3&lt;br /&gt;
M       /testpool/test2/&lt;br /&gt;
-       /testpool/test2/patch-3.1-rc4.bz2&lt;br /&gt;
R       /testpool/test2/hello.txt -&amp;gt; /testpool/test2/hello-new.txt&lt;br /&gt;
+       /testpool/test2/goodbye.txt&lt;br /&gt;
+       /testpool/test2/goodbye2.txt&lt;br /&gt;
&lt;br /&gt;
# zfs diff testpool/test2@s3 san/test2@s1&lt;br /&gt;
Unable to obtain diffs: &lt;br /&gt;
   Not an earlier snapshot from the same fs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where M,R,+,- stands for:&lt;br /&gt;
&lt;br /&gt;
* M: item has been modified&lt;br /&gt;
* R: item has been renamed&lt;br /&gt;
* +: item has been added&lt;br /&gt;
* -: item has been removed&lt;br /&gt;
&lt;br /&gt;
Observe the output of each diff and draw you own conclusion on what we did at each step and what appears in the diff. It is not possible to get a detailed diff similar to what Git and others gives but you have the big picture of what changed between snapshots.  &lt;br /&gt;
&lt;br /&gt;
If ZFS-Fuse does not implements (yet) a snapshot diffing capability, it can deal with several snapshots and is able to jump across several steps backwards. Suppose we want ''myfirstDS'' to go back exactly is was when we took the dataset photograph named ''snapshot-1'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs rollback myfirstpool/myfirstDS@snapshot-1 &lt;br /&gt;
cannot rollback to 'myfirstpool/myfirstDS@snapshot-1': more recent snapshots exist&lt;br /&gt;
use '-r' to force deletion of the following snapshots:&lt;br /&gt;
myfirstpool/myfirstDS@snapshot-3&lt;br /&gt;
myfirstpool/myfirstDS@snapshot-2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is not a bug, this is absolutely normal. The '''zfs''' command asks you to give it the explicit permission to remove the two others snapshots as they becomes useless (restoring them would be an absolute no sense) once snapshot-1 is restored. Second attempt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs rollback myfirstpool/myfirstDS@snapshot-1&lt;br /&gt;
# ls -l /myfirstpool/myfirstDS&lt;br /&gt;
total 75580&lt;br /&gt;
-rw-r--r-- 1 root root       13 Sep  5 22:38 hello.txt&lt;br /&gt;
-rw-r--r-- 1 root root 77220912 Sep  5 22:38 linux-3.1-rc4.tar.bz2&lt;br /&gt;
# zfs list -t all&lt;br /&gt;
                                                        &lt;br /&gt;
NAME                               USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
myfirstpool                       2.34G  5.47G   444M  /myfirstpool&lt;br /&gt;
myfirstpool/myfirstDS             73.8M  5.47G  73.8M  /myfirstpool/myfirstDS&lt;br /&gt;
myfirstpool/myfirstDS@snapshot-1      0      -  73.8M  -&lt;br /&gt;
myfirstpool/mysecondDS            1.84G  5.47G  1.84G  /myfirstpool/mysecondDS&lt;br /&gt;
myfirstpool/mysecondDS@snapshot1    37K      -  1.84G  -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''myfirstDS'' effectively returned to its state when ''snapshot-2'' was taken and the snapshots ''snapshot-2'' and ''snapshot-3'' vanished.&lt;br /&gt;
&lt;br /&gt;
{{fancynote|You can leap several steps backward at the cost of '''loosing''' your subsequent modifications forever. }}&lt;br /&gt;
&lt;br /&gt;
=== Streaming datasets over the network ===&lt;br /&gt;
&lt;br /&gt;
{{fancyimportant|'''Nothing in an infrastructure is as much critical as having reliable backups of the data''' used by an organization. Whereas a server can be remounted from scratch, the data it contains is very likely to be lost '''forever''' whenever a disaster occurs. Of course, as the data is the blood of an organization business processes, its '''integrity''' and '''confidentiality''' must be preserved in all cases. }}&lt;br /&gt;
&lt;br /&gt;
You find ZFS snaphots useful? Well, you have seen just a small part of their potential. As a snapshot is a photograph  of what a dataset contains frozen in the time, snapshots can be seen as being no more than a data backup. Like any backup, they must not stay on the local machine but must be put elsewhere and the common good sense tells to keep backups in a safe place, making them travel through a secure channel. By &amp;quot;secure channel&amp;quot; we intend something like a trusted person in your organization whose job consists of bringing a box of tapes off-site in a secure location but we also intend a secure communication channel like an SSH tunnel over two hosts without any human intervention.&lt;br /&gt;
&lt;br /&gt;
ZSH designers had the same vision and made possible for a dataset to be able to be sent over a network. How is that possible? Simple: the process involves two peers who can use through a communication channel like the one established by '''netcat''' (OpenSSH supports a similar functionality but with an encrypted communication channel).  For the sake of the demonstration, we will use two Solaris boxes at each end-point. &lt;br /&gt;
&lt;br /&gt;
How stream some ZFS bits over the network? Here again, '''zfs''' is the answer. A nifty move from the designers was to use ''stdin'' and ''stdout'' as transmission/reception channels thus allowing great a flexibility in processing the ZFS stream. You can envisage, for instance, to compress your stream then crypt it then encode it in base64 then sign it and so on. It sounds a bit overkill but it is possible and in the general case you can use any tool that swallow the data from ''stdin'' and spit it through ''stdout'' in your plumbing.&lt;br /&gt;
&lt;br /&gt;
{{fancynote|The rest of this section has been done entirely on two Solaris 11 machines.}}&lt;br /&gt;
&lt;br /&gt;
1. Sender side:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
# zfs create testpool2/zfsstreamtest&lt;br /&gt;
# echo 'Hello, world!' &amp;gt; /testpool2/zfsstreamtest/hello.txt&lt;br /&gt;
# echo 'Goodbye, world' &amp;gt; /testpool2/zfsstreamtest/goodbye.txt&lt;br /&gt;
# zfs snapshot zfs testpool2/zfsstreamtest@s1&lt;br /&gt;
# zfs list -t snapshot&lt;br /&gt;
NAME                               USED  AVAIL  REFER  MOUNTPOINT&lt;br /&gt;
testpool2/zfsstreamtest@s1            0      -    32K           -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Receiver side (the dataset ''zfs-stream-test'' will be created and should not be present):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# nc -l -p 7000 | zfs receive testpool/zfs-stream-test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point the receiver is waiting after some data.&lt;br /&gt;
&lt;br /&gt;
3. Sender side:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs send testpool2/zfsstreamtest@s1 | nc 192.168.aaa.bbb.ccc 7000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Receiver side:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs list -t snapshot&lt;br /&gt;
NAME                          USED  AVAIL  REFER &lt;br /&gt;
...&lt;br /&gt;
testpool2/zfs-stream-test@s1       0      -  46.4K  -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we did not set an explicit snapshot name the the second step but it could have been possible to choose anything else but the default which is the name of the snapshot sent over the network. In that case the dataset which will contain the snapshot needs to be created first:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# nc -l -p 7000 | zfs receive testpool/zfs-stream-test@mysnapshot01&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once received you would get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs list -t snapshot&lt;br /&gt;
NAME                                      USED  AVAIL  REFER &lt;br /&gt;
...&lt;br /&gt;
testpool2/zfs-stream-test@mysnapshot01       0      -  46.4K  -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Just for the sake of the curiosity let's do a rollback on the receiver side:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs rollback testpool2/zfsstreamtest@s1&lt;br /&gt;
# ls -l /testpool2/zfs-stream-test&lt;br /&gt;
total 2&lt;br /&gt;
-rw-r--r-- 1 root root 15 2011-09-06 23:54 goodbye.txt&lt;br /&gt;
-rw-r--r-- 1 root root 13 2011-09-06 23:53 hello.txt&lt;br /&gt;
# cat /testpool2/zfs-stream-test/hello.txt&lt;br /&gt;
Hello, world&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because ZFS streaming operates using the starnd input and output (''stdin'' / ''stdout'') you can build a bit more complex pipeline like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs send testpool2/zfsstreamtest@s1 | gzip | nc 192.168.aaa.bbb.ccc 7000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The above example was using two hosts but a simpler setup is also possible: you are not required to send you data over the network with '''netcat''', you can store it to a regular file then mail it or store it on a USB key. By the way: we have not finished! We took only a simple case here: it is absolutely possible to do the exact same operation with the difference between snapshots (incremental). Just like an incremental backup takes only what has changed, ZFS can determine the difference between two snapshots and streaming instead of streaming a snapshot taken at whole. Although ZFS can detect and act on differentials, it does not operate (yet) at the block level: if only a few bytes of a very big file have changed, the whole file will be taken into consideration (operating at data block level is possible with some tools like the well-known '''rsync''').&lt;br /&gt;
&lt;br /&gt;
Consider the following:&lt;br /&gt;
&lt;br /&gt;
* A dataset snapshot (S1) contains two files:&lt;br /&gt;
** A -&amp;gt; 10 MB&lt;br /&gt;
** B -&amp;gt; 4 GB&lt;br /&gt;
* A bit later some files (named C, D and E) are added to the dataset and another snapshot is (S2) taken. S2 contains:&lt;br /&gt;
** A -&amp;gt; 10 MB&lt;br /&gt;
** B -&amp;gt; 4 GB&lt;br /&gt;
** C -&amp;gt; 3 MB&lt;br /&gt;
** D -&amp;gt; 500 KB&lt;br /&gt;
** E -&amp;gt; 1GB&lt;br /&gt;
&lt;br /&gt;
With a full transfer of S2 A,B,C,D and E would be streamed whereas an incremental transfert (S2-S1), zfs would only process C, D and E. The next $100 question:''&amp;quot;How can we stream a difference of snapshot? '''zfs''' again?&amp;quot;'' Yes! This time with a subtle difference: a special option specified on the command line telling it must use a difference rather than a full snapshot. Assuming a few more files are added in ''testpool2/zfsstreamtest'' dataset and a snapshot (s2) is has been taken, the delta between s2 and s1 (s2-s1) giving s3 can be send like this (on the receiver side the same as shown above is used, nothing special is required alos notice the presence of the -i option):&lt;br /&gt;
&lt;br /&gt;
* Sender:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs send -i testpool2/zfsstreamtest@s1 testpool2/zfsstreamtest@s2 | nc 192.168.aaa.bbb.ccc 7000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Receiver:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# nc -l -p 7000 | zfs receive testpool/zfs-stream-test&lt;br /&gt;
# zfs list -t snapshot&lt;br /&gt;
testpool/zfs-stream-test@s1       28.4K      -  46.4K  -&lt;br /&gt;
testpool/zfs-stream-test@s2           0      -  47.1K  -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that although we did not specified any snapshot name to use on the receiver side, ZFS used by default the name of the second snapshot involved in the delta (''s2'' here).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$200 question: suppose we delete all of the received snapshots so far on the receiver side and we try to send the difference between s2 and s1, what would happen? ZFS will protest on the receiver side although no error message will be visible on the sender side:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cannot receive incremental stream: destination testpool/zfs-stream-test has been modified&lt;br /&gt;
since most recent snapshot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is even worse if we remove the dataset used to receive the data:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cannot receive incremental stream: destination 'testpool/zfs-stream-test' does not exist&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{fancyimportant|ZFS streaming over a network has '''no underlying protocol''', therefore the sender just assumes the data has been successfully received and processed. It '''does not care''' whether a processing error occurs.}}&lt;br /&gt;
&lt;br /&gt;
=== Govern a dataset by attributes ===&lt;br /&gt;
&lt;br /&gt;
So far, most of a filesystem capabilities were driven by separate and scarced command line line tools (e.g. tune2fs, edquota, rquota, quotacheck...) which all have their own ways to handle tasks and can go through tricky ways sometimes especially the quota-related management utilities. Moreover, there was no easy way to handle a limitations on a directory rather than putting it a a dedicated partition or logical volume implying downtimes when additional space was to be added. Quota management is however one of the many facets disk space management includes. &lt;br /&gt;
&lt;br /&gt;
In the ZFS world, many aspects are now managed by simply setting/clearing a property attached to a ZFS dataset through the now so well-known command '''zfs'''.You can, for example:&lt;br /&gt;
&lt;br /&gt;
* put a size limit on a dataset&lt;br /&gt;
* reserve a space for dataset (that space is ''guaranteed'' to be available in the future although not being allocated at the time the reservation is made)&lt;br /&gt;
* control if new files are encrypted and/or compressed&lt;br /&gt;
* define a quota per user or group of users&lt;br /&gt;
* control checksum usage  =&amp;gt; '''never turn that property off unless having very good reasons you are likely to never have''' (no checksums = no silent data corruption detection)&lt;br /&gt;
* share a dataset by NFS/CIFS&lt;br /&gt;
* control automatic data deduplication&lt;br /&gt;
&lt;br /&gt;
Not all of a dataset properties are settable, some of them are set and managed by the operating system in the background for you and thus cannot be modified.&lt;br /&gt;
&lt;br /&gt;
{{fancynote|Solaris/OpenIndiana users: ZFS has a tight integration with the NFS/CIFS server, thus it is possible to share a zfs dataset by setting adequate attributes. ZFS on Linux (native kernel mode port) also has a tight integration with the built-in Linux NFS server, the same for ZFS fuse although still experimental. Under FreeBSD ZFS integration has been done both with NFS and Samba (CIFS).}}&lt;br /&gt;
&lt;br /&gt;
Like any other action concerning datasets, properties are sets and unset via the zfs command. On our Funtoo box running zfs-Fuse we can, for example, start by seeing the value of all properties for the dataset ''myfirstpool/myfirstDS'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs get all myfirstpool/myfirstDS&lt;br /&gt;
 zfs get all myfirstpool/myfirstDS &lt;br /&gt;
NAME                   PROPERTY              VALUE                   SOURCE&lt;br /&gt;
myfirstpool/myfirstDS  type                  filesystem              -&lt;br /&gt;
myfirstpool/myfirstDS  creation              Sun Sep  4 23:34 2011   -&lt;br /&gt;
myfirstpool/myfirstDS  used                  73.8M                   -&lt;br /&gt;
myfirstpool/myfirstDS  available             5.47G                   -&lt;br /&gt;
myfirstpool/myfirstDS  referenced            73.8M                   -&lt;br /&gt;
myfirstpool/myfirstDS  compressratio         1.00x                   -&lt;br /&gt;
myfirstpool/myfirstDS  mounted               yes                     -&lt;br /&gt;
myfirstpool/myfirstDS  quota                 none                    default&lt;br /&gt;
myfirstpool/myfirstDS  reservation           none                    default&lt;br /&gt;
myfirstpool/myfirstDS  recordsize            128K                    default&lt;br /&gt;
myfirstpool/myfirstDS  mountpoint            /myfirstpool/myfirstDS  default&lt;br /&gt;
myfirstpool/myfirstDS  sharenfs              off                     default&lt;br /&gt;
myfirstpool/myfirstDS  checksum              on                      default&lt;br /&gt;
myfirstpool/myfirstDS  compression           off                     default&lt;br /&gt;
myfirstpool/myfirstDS  atime                 on                      default&lt;br /&gt;
myfirstpool/myfirstDS  devices               on                      default&lt;br /&gt;
myfirstpool/myfirstDS  exec                  on                      default&lt;br /&gt;
myfirstpool/myfirstDS  setuid                on                      default&lt;br /&gt;
myfirstpool/myfirstDS  readonly              off                     default&lt;br /&gt;
myfirstpool/myfirstDS  zoned                 off                     default&lt;br /&gt;
myfirstpool/myfirstDS  snapdir               hidden                  default&lt;br /&gt;
myfirstpool/myfirstDS  aclmode               groupmask               default&lt;br /&gt;
myfirstpool/myfirstDS  aclinherit            restricted              default&lt;br /&gt;
myfirstpool/myfirstDS  canmount              on                      default&lt;br /&gt;
myfirstpool/myfirstDS  xattr                 on                      default&lt;br /&gt;
myfirstpool/myfirstDS  copies                1                       default&lt;br /&gt;
myfirstpool/myfirstDS  version               4                       -&lt;br /&gt;
myfirstpool/myfirstDS  utf8only              off                     -&lt;br /&gt;
myfirstpool/myfirstDS  normalization         none                    -&lt;br /&gt;
myfirstpool/myfirstDS  casesensitivity       sensitive               -&lt;br /&gt;
myfirstpool/myfirstDS  vscan                 off                     default&lt;br /&gt;
myfirstpool/myfirstDS  nbmand                off                     default&lt;br /&gt;
myfirstpool/myfirstDS  sharesmb              off                     default&lt;br /&gt;
myfirstpool/myfirstDS  refquota              none                    default&lt;br /&gt;
myfirstpool/myfirstDS  refreservation        none                    default&lt;br /&gt;
myfirstpool/myfirstDS  primarycache          all                     default&lt;br /&gt;
myfirstpool/myfirstDS  secondarycache        all                     default&lt;br /&gt;
myfirstpool/myfirstDS  usedbysnapshots       18K                     -&lt;br /&gt;
myfirstpool/myfirstDS  usedbydataset         73.8M                   -&lt;br /&gt;
myfirstpool/myfirstDS  usedbychildren        0                       -&lt;br /&gt;
myfirstpool/myfirstDS  usedbyrefreservation  0                       -&lt;br /&gt;
myfirstpool/myfirstDS  logbias               latency                 default&lt;br /&gt;
myfirstpool/myfirstDS  dedup                 off                     default&lt;br /&gt;
myfirstpool/myfirstDS  mlslabel              off                     -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How can we set a limit that prevents ''myfirstpool/myfirstDS'' to not use more than 1 GB of space in the pool? Simple, just set the ''quota'' property:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs set quota=1G myfirstpool/myfirstDS&lt;br /&gt;
# zfs get quota myfirstpool/myfirstDS&lt;br /&gt;
NAME                   PROPERTY  VALUE  SOURCE&lt;br /&gt;
myfirstpool/myfirstDS  quota     1G     local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
May be something poked your curiosity: ''what &amp;quot;SOURCE&amp;quot; means?'' &amp;quot;SOURCE&amp;quot; describes how the property has been determined for the dataset and can have several values:&lt;br /&gt;
* '''local''': the property has been explicitly set for this dataset&lt;br /&gt;
* '''default''': a default value has been assigned by the operating system if not explicitely set by the system adminsitrator (e.g SUID allowed or not in the above example). &lt;br /&gt;
* '''dash (-)''': not modifiable intrinsic property (e.g. dataset creation time, whether the dataset is currently mounted or not, dataset space usage in the pool, average compression ratio...)&lt;br /&gt;
&lt;br /&gt;
Before copying some files in the dataset, let's fix a binary (on/off) property:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# zfs set compression=on myfirstpool/myfirstDS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try to put more than 1GB of data in the dataset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# dd if=/dev/zero of=/myfirstpool/myfirstDS/one-GB-test bs=2G count=1&lt;br /&gt;
dd: writing `/myfirstpool/myfirstDS/one-GB-test': Disk quota exceeded&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Permission delegation ===&lt;br /&gt;
&lt;br /&gt;
ZFS brings a feature known as delegated administration. Delegated administration enables ordinary users to handle administrative tasks on a dataset without being administrators. '''It is however not a sudo replacement as it covers only ZFS related tasks''' such as sharing/unsharing, disk quota management and so on. Permission delegation shines in flexibility because such delegation can be handled by inheritance though nested datasets. Pewrmission deleguation is handled via '''zfs''' through its '''allow''' and '''disallow''' options.&lt;br /&gt;
&lt;br /&gt;
= Data redundancy with ZFS =&lt;br /&gt;
&lt;br /&gt;
Nothing is perfect and the storage medium (even in datacenter-class equipment) is prone to failures and fails on a regular basis. Having data redundancy is mandatory to help in preventing single-points of failure (SPoF). Over the past decades, RAID technologies were powerful however their power is precisely their weakness: as operating at the block level, they do not care about what is stored on the data blocks and have no ways to interact with the filesystems stored on them to ensure data integrity is properly handled.&lt;br /&gt;
&lt;br /&gt;
== Some statistics ==&lt;br /&gt;
&lt;br /&gt;
It is not a secret to tell that a general trend in the IT industry is the exponential growth of data quantities. Just thinking about the amount of data Youtube, Google or Facebook generates every day taking the case of the first [http://www.website-monitoring.com/blog/2010/05/17/youtube-facts-and-figures-history-statistics some statistics] gives:&lt;br /&gt;
* 24 hours of video is generated every ''minute'' in March 2010 (May 2009 - 20h / October 2008 - 15h / May 2008 - 13h)&lt;br /&gt;
* More than 2 ''billions'' views a day&lt;br /&gt;
* More video is produced on Youtube every 60 days than 3 major US broadcasting networks did in the last 60 years&lt;br /&gt;
&lt;br /&gt;
Facebook is also impressive (Facebook own stats):&lt;br /&gt;
&lt;br /&gt;
* over 900 million objects that people interact with (pages, groups, events and community pages)&lt;br /&gt;
* Average user creates 90 pieces of content each month (750 millions users active)&lt;br /&gt;
* More than 2.5 million websites have integrated with Facebook&lt;br /&gt;
&lt;br /&gt;
What is true with Facebook and Youtube is also true with many other cases (think one minutes about the amount of data stored in iTunes) especially with the growing popularity of cloud computing infrastructures. Despite the progress of the technology a &amp;quot;bottleneck&amp;quot; still exists: the storage reliability is nearly the same over the years. If only one organization in the world generate huge quantities of data it would be the [http://public.web.cern.ch CERN] (''Conseil Européen pour la Recherche Nucléaire'', now officially known as ''European Organization for Nuclear Research'') as their experiments can generate spikes of many terabytes of data within a few seconds. A study done in 2007 quoted by a [http://www.zdnet.com/blog/storage/data-corruption-is-worse-than-you-know/191 ZDNet article] reveals that:&lt;br /&gt;
&lt;br /&gt;
* Even ECC memory cannot be always be helpful: 3 double-bit errors (uncorrectable) occurred in 3 months on 1300 nodes. Bad news: it should be '''zero'''.&lt;br /&gt;
* RAID systems cannot protect in all cases: monitoring 492 RAID controller for 4 weeks showed an average error rate of 1 per ~10^14 bits, giving roughly 300 errors for every 2.4 petabytes&lt;br /&gt;
* Magnetic storage is still not reliable even on high-end datacenter class drives: 500 errors found over 100 nodes while writing 2 GB file to 3000+ nodes every 2 hours then read it again and again for 5 weeks. &lt;br /&gt;
&lt;br /&gt;
Overall this means: 22 corrupted files (1 in every 1500 files) for a grand total of 33700 files holding 8.7TB of data. And this study is 5 years old....&lt;br /&gt;
&lt;br /&gt;
== Source of silent data corruption ==&lt;br /&gt;
&lt;br /&gt;
http://www.zdnet.com/blog/storage/50-ways-to-lose-your-data/168&lt;br /&gt;
&lt;br /&gt;
Not an exhaustive list but we can quote:&lt;br /&gt;
&lt;br /&gt;
* Cheap controller or buggy driver that does not reports errors/pre-failure conditions to the operating system;&lt;br /&gt;
* &amp;quot;bit-leaking&amp;quot;: an harddrive consists of many concentric magnetic tracks. When the hard drive magnetic head writes bits on the magnetic surface it generates a very weak magnetic field however sufficient to &amp;quot;leak&amp;quot; on the next track and change some bits. Drives can generally, compensate those situations because they also records some error correction data on the magnetic surface&lt;br /&gt;
* magnetic surface defects (weak sectors)&lt;br /&gt;
* Hard drives firmware bugs&lt;br /&gt;
* Cosmic rays hitting your RAM chips or hard drives cache memory/electronics&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
== Building a mirrored pool ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ZFS RAID-Z ==&lt;br /&gt;
&lt;br /&gt;
=== ZFS/RAID-Z vs RAID-5 ===&lt;br /&gt;
&lt;br /&gt;
RAID-5 is very commonly used nowadays because of its simplicity, efficiency and fault-tolerance. Although the technology did its proof over decades, it has a major drawback known as &amp;quot;The RAID-5 write hole&amp;quot;. if you are familiar with RAID-5 you already know that is consists of spreading the stripes across all of the disks within the array and interleaving them with a special stripe called the parity. Several schemes of spreading stripes/parity between disks exists in the natures, each one with its own pros and cons, however the &amp;quot;standard&amp;quot; one (also known as ''left-asynchronous'') is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Disk_0  | Disk_1  | Disk_2  | Disk_3&lt;br /&gt;
[D0_S0] | [D0_S1] | [D0_S2] | [D0_P]&lt;br /&gt;
[D1_S0] | [D1_S1] | [D1_P]  | [D1_S2]&lt;br /&gt;
[D2_S0] | [D2_P]  | [D2_S1] | [D2_S2]&lt;br /&gt;
[D2_P]  | [D2_S0] | [D2_S1] | [D2_S2]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parity is simply computed by XORing the stripes of the same &amp;quot;row&amp;quot;, thus giving the general equation:&lt;br /&gt;
* [Dn_S0] XOR [Dn_S1] XOR ... XOR [Dn_Sm] XOR [Dn_P] = 0&lt;br /&gt;
This equation can be rewritten in several ways:&lt;br /&gt;
* [Dn_S0] XOR [Dn_S1] XOR ... XOR [Dn_Sm] = [Dn_P]&lt;br /&gt;
* [Dn_S1] XOR [Dn_S2] XOR ... XOR [Dn_Sm] XOR [Dn_P] = [Dn_S0]&lt;br /&gt;
* [Dn_S0] XOR [Dn_S2] XOR ... XOR [Dn_Sm] XOR [Dn_P] = [Dn_S1]&lt;br /&gt;
* ...and so on!&lt;br /&gt;
&lt;br /&gt;
Because the equations are a combinations of exclusive-or, it is  possible to easily compute a parameter if it is missing. Let say we have 3 stripes plus one parity composed of 4 bits each but one of them is missing due to a disk failure:&lt;br /&gt;
&lt;br /&gt;
* D0_S0 = 1011&lt;br /&gt;
* D0_S1 = 0010&lt;br /&gt;
* D0_S2 = &amp;lt;missing&amp;gt;&lt;br /&gt;
* D0_P  = 0110&lt;br /&gt;
&lt;br /&gt;
However we know that: &lt;br /&gt;
* D0_S0 XOR D0_S1 XOR D0_S2 XOR D0_P = 0000 also rewritten as:&lt;br /&gt;
* D0_S2 = D0_S1 XOR D0_S2 XOR D0_P &lt;br /&gt;
&lt;br /&gt;
Applying boolean algebra it gives:''' D0_S2 = 1011 XOR 0010 XOR 0110 = 1111'''.&lt;br /&gt;
Proof: '''1011 XOR 0010 XOR 1111 = 0110''' this is the same as '''D0_P''' &lt;br /&gt;
&lt;br /&gt;
''''''So what's the deal?'''''' &lt;br /&gt;
Okay now the funny part, forgot the above hypothesis and imagine we have this:&lt;br /&gt;
&lt;br /&gt;
* D0_S0 = 1011&lt;br /&gt;
* D0_S1 = 0010&lt;br /&gt;
* D0_S2 = 1101&lt;br /&gt;
* D0_P  = 0110&lt;br /&gt;
&lt;br /&gt;
Applying boolean algebra magics gives 1011 XOR 0010 XOR 1101 =&amp;gt; 0100. Problem: this is different of D0_P  (0110). Can you tell which one (or which ONES) of the four terms lies? If you find a mathematically acceptable solution, found your company because you have just solved a big computer science problem. If humans can't solve the question, imagine how hard it is for the poor little RAID-5 controller to determine which stripe is right and which one lies and the resulting &amp;quot;datageddon&amp;quot; (i.e. massive data corruption on the RAID-5 array) when the RAID-5 controller detect error and start to rebuild the array.&lt;br /&gt;
&lt;br /&gt;
This is not science fiction, this a pure reality and the weakness stays in the RAID-5 simplicity. Here is how it can happen: an urban legend with RAID-5 arrays is that they update stripes in an atomic transaction (all of the stripes+parity are written or none of them). Too bad, this is just not true, the data is written on the fly and if for a reason or another the machine where the RAID-5 array has a power outage or crash, the RAID-5 controller will simply have no idea about what he was doing and which stripes are up to date which ones are not up to date. Of course, RAID controllers in servers do have a replaceable on-board battery and most of the time the server they reside in is connected to an auxiliary source like a battery-based UPS or a diesel/gas electricity generator. However, Murphy laws or unpredictable hazards can, sometimes, happens.... &lt;br /&gt;
&lt;br /&gt;
Another funny scenario: imagine a machine with a RAID-5 array (on UPS this time) but with non ECC memory. the RAID-5 controller splits the data buffer in stripes, computes a data stripe and starts to write them on the different disks of the array. But...but...but... For some odd reason, only one bit in one of the stripes flips (cosmic rays, RFI...) after the parity calculation. Too bad too sad, one of the written stripes contains corrupted data and it is silently written on the array. Datageddon in sight!&lt;br /&gt;
&lt;br /&gt;
Not to make you freaking: storage units have sophisticated error correction capability (a magnetic surface or an optical recording surface is not perfect and reading/writing error occurs) masking most the cases. However, some  established statistics estimates that even with error correction mechanism one bit over 10^16 bits transferred is incorrect. 10^16 is really huge but unfortunately in this beginning of the XXIst century with datacenters brewing massive amounts of data with several hundreds to not say thousands servers this this number starts to give headaches:  '''a big datacenter can face to silent data corruption every 15 minutes''' (Wikepedia). No typo here, a potential disaster may silently appear 5 times an hour for every single day of the year. Detection techniques exists but traditional RAID-5 arrays in them selves can be a problem. Ironic for a so popular and widely used solution :)&lt;br /&gt;
&lt;br /&gt;
If RAID-5 was an acceptable trade-off in the past decades, it simply made its time.  RAID-5 is dead? '''*Horray!*'''&lt;br /&gt;
&lt;br /&gt;
= More advanced topics =&lt;br /&gt;
&lt;br /&gt;
== ZFS Intention Log (ZIL) ==&lt;br /&gt;
&lt;br /&gt;
= Final words and lessons learned =&lt;br /&gt;
 &lt;br /&gt;
ZFS surpasses by far (as of September 2011) every of the well-known filesystems around there: none of them propose such an integration of features and certainly not with this management simplicity and robustness. However in the Linux world it is definitely a no-go in the short term especially for production systems. The two known implementations are not ready for production environments  and lacks some important features or behave in a clunky manner, this is absolutely correct as none of them pretend to be at this level of maturity and the licensing incompatibility between the code opened by Sun Microsystems some years ago and the GNU/GPL does not help the cause. However, both look '''very promising''' once their corners will become rounded. &lt;br /&gt;
&lt;br /&gt;
For a Linux system, the nearest plan B is you seek for a BTRFS like filesystem covering some of the functionalities offered by ZFS is BTRFS (still considered as experimental, be prepared to a disaster sooner or later although BTRFS is used by some Funtoo core team members since 2 years and proved to be quite stable in practise). BTRFS however does not pushes the limits as much as ZFS does: it does not have built-in snapshot differentiation tool nor implement built-in filesystem streaming capabilities and roll-backing a BTRFS subvolume is a bit more manual than in ''&amp;quot;the ZFS way of life&amp;quot;''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Footnotes &amp;amp; references =&lt;br /&gt;
Source: [http://docs.huihoo.com/opensolaris/solaris-zfs-administration-guide/html/index.html solaris-zfs-administration-guide]&lt;br /&gt;
[[Category:Labs]]&lt;br /&gt;
[[Category:Articles]]&lt;br /&gt;
[[Category:Filesystems]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Funtoo_Linux_Installation_on_ARM</id>
		<title>Funtoo Linux Installation on ARM</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Funtoo_Linux_Installation_on_ARM"/>
				<updated>2013-01-12T16:13:31Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Choosing a root password (alternative) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Funtoo now provides [http://ftp.osuosl.org/pub/funtoo/funtoo-current/arm-32bit/ stage3 images] for arm platform. At this time are only armv6j_hardfp and armv7a_hardfp stages available. If you would like us to support other processors (see the list below), please fill a bug report on [http://bugs.funtoo.org].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== List of ARM processor &amp;quot;flavors&amp;quot; ==&lt;br /&gt;
* armv4l-unknown-linux-gnu (Rebel NetWinder, HP Armada and other devices having an ARMv4 processor, which is only capable of running the old ABI. Nevertheless it should work on newer CPUs)&lt;br /&gt;
* armv4tl-softfloat-linux-gnueabi (OpenMoko FreeRunner and other devices using an ARMv4T processor. Uses the new ARM EABI and software floating point by default)&lt;br /&gt;
* armv5tel-softfloat-linux-gnueabi (almost all ARM NAS, devices based on the Marvell Orion and Marvell Kirkwood, Marvell Sheevaplug, Marvell OpenRD, Guruplug, Dreamplug, QNAP TS109/TS209/TS409/TS119/TS219/TS419, Buffalo Linkstation/Kurobox PRO, HP mv2120, HP iPAQ, Linksys NSLU2 and other devices using an ARMv5TE processor. Uses the new ARM EABI and software floating point by default)&lt;br /&gt;
* armv6j-unknown-linux-gnueabi ([[Raspberry Pi]], Nokia N800/N810, Smart Q7, OMAP2-based devices and other multimedia devices using an ARMv6 CPU and VFP. Uses the new ARM EABI and hardware floating point by default)&lt;br /&gt;
* armv7a-unknown-linux-gnueabi (OMAP3-based devices(Beagleboard, IGEPv2, Devkit8000, AlwaysInnovating Touchbook, [[Nokia N900]]), OMAP4-based devices([[Pandaboard]]), Freescale i.MX515-based devices([[Efika MX]], Babbage Board, Lange Board…) Marvell Dove/Armada, Nvidia Tegra2-based devices(Toshiba AC100, Toshiba Folio), ST-Ericsson NOVA A9500-based devices(Snowball), Exynos 4412 ([[Odroid-X]], Odroid-Q) and other devices using an ARMv7-A processor. Uses the new ARM EABI and generic(not NEON) hardware floating point by default&lt;br /&gt;
* armv7a-hardfloat-linux-gnueabi (The same as armv7a-unknown-linux-gnueabi, but this one uses hardfloat instead of softfp. Read more about it here: http://wiki.debian.org/ArmHardFloatPort)&lt;br /&gt;
&lt;br /&gt;
== Default installation of Funtoo on your platform/board ==&lt;br /&gt;
This document is not a complete installation tutorial. Basic information about Funtoo Linux installation can be found on [[Funtoo Linux Installation]]. The goal of this document is to provide general information about installing Funtoo Linux on an ARM device, and highlight differences with a x86 installation.&lt;br /&gt;
&lt;br /&gt;
The following notes are non-board specific. Other instructions can be found in the specific articles for the above mentioned devices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
Most of the ARM boards come with a SD card slot, so you will need an empty SD card (4GB is enough to get you started), in most cases the boards are also equipped with debug port which can be used with USB-to-serial cables, if you have one, you can use it to login to the machine without the need of connecting keyboards or displays. You will need a network connection to be able to download stages, kernel and update your portage tree.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Kernel and bootloader setup ===&lt;br /&gt;
Before you start you will need a kernel and a bootloader for your device. Some of the devices look for bootloader (in most cases U-Boot) on the SD along with the kernel.&lt;br /&gt;
&lt;br /&gt;
More information about the kernel and bootloader can be found on pages specific for your device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing Funtoo (overview) ===&lt;br /&gt;
&lt;br /&gt;
The installation on these devices differs from the normal installation procedure of booting an installation environment and chrooting from there to your new root, and can be little bit easier, but in some cases tricky. &lt;br /&gt;
&lt;br /&gt;
Overview of the installation:&lt;br /&gt;
* Extract stage3 to the 2nd partition of the SD card&lt;br /&gt;
* Extract portage snapshot&lt;br /&gt;
* Setup fstab&lt;br /&gt;
* Setup root password&lt;br /&gt;
* Configure hostname and networking (optional, but recommended)&lt;br /&gt;
* Enable SSH access (optional, but recommended)&lt;br /&gt;
* Enable serial console access (optional, but recommended)&lt;br /&gt;
* Correct RTC &amp;quot;bug&amp;quot; with swclock&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Installing the Stage 3 tarball ====&lt;br /&gt;
&lt;br /&gt;
ARM stage3 tarballs can be found on [http://ftp.osuosl.org/pub/funtoo/funtoo-current/arm-32bit/]. Use the subarchitecture that suits best your device.&lt;br /&gt;
&lt;br /&gt;
Mount the partition that will hold your rootfs of the SD card and extract the stage3 you have downloaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##mkdir /mnt/SD_root&lt;br /&gt;
# ##i##mount /dev/sdcard-device-px /mnt/SD_root&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the stage3 (it may take a while).&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##tar xapf stage3-armv7a_hardfp-xxxx.tar.xz -C /mnt/SD_root&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Extracting a portage snapshot ====&lt;br /&gt;
&lt;br /&gt;
Now, download the portage snapshot from [http://ftp.osuosl.org/pub/funtoo/funtoo-current/snapshots/], and extract it to your partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##tar xapf portage-latest.tar.xz -C /mnt/SD_root/usr&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setup fstab ====&lt;br /&gt;
Edit the /mnt/SD_root/etc/fstab file to look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 /dev/mmcblk0p1		/boot		vfat		noauto,noatime	1 2&lt;br /&gt;
 /dev/mmcblk0p2		/		ext4		noatime		0 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adjust the partition devices and types to suit your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setting the default root password ====&lt;br /&gt;
&lt;br /&gt;
{{fancywarning|Don't skip this step. This part differs from the standard installation procedure, as the root password must be set outside of a chroot environment. Skipping this step will result on an impossibility to login.}}&lt;br /&gt;
&lt;br /&gt;
Normally, for setting the password, one has to be able to run passwd. However that's not possible in this case since an x86 system can't run ARM binaries. Therefore, it is needed to modify the file that contains the passwords (/etc/shadow) to set a default root password.&lt;br /&gt;
&lt;br /&gt;
===== Clearing the root password =====&lt;br /&gt;
This will allow to login with a blank password for the root user.&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##nano -w /mnt/SD_root/etc/shadow&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modify the line beginning by &amp;quot;root&amp;quot; to match the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root::10770:0:::::&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{fancywarning|After initial login, remember to change the root password using the passwd command.}}&lt;br /&gt;
&lt;br /&gt;
===== Choosing a root password (alternative) =====&lt;br /&gt;
&lt;br /&gt;
First, generate a password. The output of this command will be used to modify the shadow file.&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##openssl passwd -1&lt;br /&gt;
or&lt;br /&gt;
# ##i##python -c &amp;quot;import crypt, getpass, pwd; print crypt.crypt('password', '\$6\$SALTsalt\$')&amp;quot;&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, edit the shadow file and use the output of the last command to replace &amp;quot;YOUR_PASSWORD_MD5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##nano -w /mnt/SD_root/etc/shadow&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 root:YOUR_PASSWORD_MD5:14698:0:::::&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup hostname and networking ====&lt;br /&gt;
&lt;br /&gt;
Please read the [[Funtoo Linux Networking]] to configure your network.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Using swclock ====&lt;br /&gt;
One of the problems some of the devices have, is that they don't have a battery to save the clock time. To mitigate this, on Funtoo we have an option in our init system called swclock which sets the date of the system upon boot from a last modified date of a file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First, add swclock to the boot runlevel.&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##ln -sf /etc/init.d/swclock /mnt/SD_root/etc/runlevels/boot&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, remove hwclock from the startup because it sets the date from the RTC, which is 2000-01-01 upon startup and overrides swclock's date.&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##rm /mnt/SD_root/etc/runlevels/boot/hwclock&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
swclock uses the /lib/rc/cache/shutdowntime's modification time to set the date, therefore we update it to have the current date and time.&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##touch /mnt/SD_root/lib/rc/cache/shutdowntime&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although this doesn't fix the issue, at least helps to set a sane date and time.&lt;br /&gt;
Note: Consider using NTP, documented on the next chapter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Enabling SSH access (optional) ====&lt;br /&gt;
Adding sshd to the default runlevel will enable access to the device using ssh.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##ln -sf /etc/init.d/sshd /mnt/SD_root/etc/runlevels/default&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Enabling serial console access (optional) ====&lt;br /&gt;
By default the ttyS0 port is configured at 9600 bps. However, almost all of the ARM devices run the serial port at 115200 bps. Also, the port device names differ (ttyO2 for Pandaboard, ttySAC1 for Odroid-X ...). So edit your /etc/inittab file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##nano -w /mnt/SD_root/etc/inittab&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(For example for Pandaboard: )&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
s0:12345:respawn:/sbin/agetty 115200 ttyO2 vt100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Finishing the installation and booting up the new system ===&lt;br /&gt;
Let's unmount the SD card.&lt;br /&gt;
&amp;lt;console&amp;gt;&lt;br /&gt;
# ##i##umount /mnt/SD_root&lt;br /&gt;
&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have the card ready, put it into your device, and you should be able to boot it. If you have a debug port you will be able to see the boot process using minicom or similar program on another PC connected with the debug cable.&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:ARM]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Developer_Guide</id>
		<title>Developer Guide</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Developer_Guide"/>
				<updated>2012-12-27T08:37:20Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is intended to be a developer guide for Funtoo Linux.&lt;br /&gt;
&lt;br /&gt;
Learning how to help squash out bugs can be a difficult thing to do, especially since sometimes JIRA looks a little overwhelming and confusing. A thank you to Daniel for making some videos (see below) on explaining this better, but there were a couple things left out. So I will take you through that. (With picture reference).&lt;br /&gt;
&lt;br /&gt;
The first thing you're going to want to do is make an account, which is simple as clicking on the 'Log in' button on the top right, then clicking 'Sign up'.&lt;br /&gt;
[[File:Signupjira.png|720px|center]]&lt;br /&gt;
&lt;br /&gt;
After you've made your account, the best way to watch bugs is to click on the 'Agile' drop-down menu, and choose 'Classic'.&lt;br /&gt;
[[File:Agileclassic.png|720px|center]]&lt;br /&gt;
&lt;br /&gt;
Now, we're going to want to change a couple things even with this. By default, the 'Classic' mode takes you to 'Classic Planning Board', you want to change this to 'Classic Task Board'. This makes things much easier to read.&lt;br /&gt;
I also recommend going to the '''Views''' eyeball icon to the right and selecting the '''List''' issue view, and the '''Compact (Kanban)''' task board mode. This will give you a top-level overview of all our bugs and their statuses, and JIRA will remember your view preferences the next time you log in.&lt;br /&gt;
&lt;br /&gt;
[[File:Classicview.png|720px|center]]&lt;br /&gt;
&lt;br /&gt;
After that, we're almost ready to rock and roll. We need to also make sure that you're not set to any version or we'll only see a few bugs. So in case it says '1.1' or '1.0' change it to 'Unscheduled'. &lt;br /&gt;
[[File:Jiraversion.png|720px|center]]&lt;br /&gt;
&lt;br /&gt;
And after all that, you can view and look at bugs that are in queue, To-do, or testing, which Daniel's videos are very great at explaining. Thanks for helping Funtoo Linux better and better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;{{#widget:YouTube|id=JCg5DWjy6Ro|width=720}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=tuFE9ZgVOpY|width=720}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Linux_Fundamentals,_Part_1</id>
		<title>Linux Fundamentals, Part 1</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Linux_Fundamentals,_Part_1"/>
				<updated>2012-12-26T00:19:40Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: Undo revision 8334 by 88.7.197.57 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Before You Start ==&lt;br /&gt;
&lt;br /&gt;
=== About this tutorial ===&lt;br /&gt;
Welcome to &amp;quot;Linux fundamentals,&amp;quot; the first of four tutorials designed to prepare you for the Linux Professional Institute's 101 exam. In this tutorial, we'll introduce you to bash (the standard Linux shell), show you how to take full advantage of standard Linux commands like ls, cp, and mv, explain inodes and hard and symbolic links, and much more. By the end of this tutorial, you'll have a solid grounding in Linux fundamentals and will even be ready to begin learning some basic Linux system administration tasks. By the end of this series of tutorials (eight in all), you'll have the knowledge you need to become a Linux Systems Administrator and will be ready to attain an LPIC Level 1 certification from the Linux Professional Institute if you so choose.&lt;br /&gt;
&lt;br /&gt;
This particular tutorial (Part 1) is ideal for those who are new to Linux, or those who want to review or improve their understanding of fundamental Linux concepts like copying and moving files, creating symbolic and hard links, and using Linux' standard text-processing commands along with pipelines and redirection. Along the way, we'll share plenty of hints, tips, and tricks to keep the tutorial meaty and practical, even for those with a good amount of previous Linux experience. For beginners, much of this material will be new, but more experienced Linux users may find this tutorial to be a great way of rounding out their fundamental Linux skills.&lt;br /&gt;
&lt;br /&gt;
For those who have taken the release 1 version of this tutorial for reasons other than LPI exam preparation, you probably don't need to take this one. However, if you do plan to take the exams, you should strongly consider reading this revised tutorial.&lt;br /&gt;
&lt;br /&gt;
== Introducing bash ==&lt;br /&gt;
=== The shell ===&lt;br /&gt;
If you've used a Linux system, you know that when you log in, you are greeted by a prompt that looks something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The particular prompt that you see may look quite different. It may contain your systems host name, the name of the current working directory, or both. But regardless of what your prompt looks like, there's one thing that's certain. The program that printed that prompt is called a &amp;quot;shell,&amp;quot; and it's very likely that your particular shell is a program called &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Are you running bash? ===&lt;br /&gt;
You can check to see if you're running &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo $SHELL&lt;br /&gt;
/bin/bash&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the above line gave you an error or didn't respond similarly to our example, then you may be running a shell other than bash. In that case, most of this tutorial should still apply, but it would be advantageous for you to switch to &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; for the sake of preparing for the 101 exam.&lt;br /&gt;
&lt;br /&gt;
=== About bash ===&lt;br /&gt;
Bash, an acronym for &amp;quot;Bourne-again shell,&amp;quot; is the default shell on most Linux systems. The shell's job is to obey your commands so that you can interact with your Linux system. When you're finished entering commands, you may instruct the shell to exit or logout, at which point you'll be returned to a login prompt.&lt;br /&gt;
&lt;br /&gt;
By the way, you can also log out by pressing control-D at the bash prompt.&lt;br /&gt;
&lt;br /&gt;
=== Using &amp;quot;cd&amp;quot; ===&lt;br /&gt;
As you've probably found, staring at your bash prompt isn't the most exciting thing in the world. So, let's start using bash to navigate around our file system. At the prompt, type the following (without the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;$&amp;lt;/span&amp;gt;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We've just told bash that you want to work in /, also known as the root directory; all the directories on the system form a tree, and / is considered the top of this tree, or the root. cd sets the directory where you are currently working, also known as the &amp;quot;current working directory.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Paths ===&lt;br /&gt;
To see bash's current working directory, you can type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pwd&lt;br /&gt;
/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the above example, the / argument to &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cd&amp;lt;/span&amp;gt; is called a ''path''. It tells cd where we want to go. In particular, the / argument is an ''absolute'' path, meaning that it specifies a location relative to the root of the file system tree.&lt;br /&gt;
&lt;br /&gt;
=== Absolute paths ===&lt;br /&gt;
Here are some other absolute paths:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/dev&lt;br /&gt;
/usr&lt;br /&gt;
/usr/bin&lt;br /&gt;
/usr/local/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, the one thing that all absolute paths have in common is that they begin with /. With a path of /usr/local/bin, we're telling cd to enter the / directory, then the usr directory under that, and then local and bin. Absolute paths are always evaluated by starting at / first.&lt;br /&gt;
&lt;br /&gt;
=== Relative paths ===&lt;br /&gt;
The other kind of path is called a ''relative path''. &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Bash&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cd&amp;lt;/span&amp;gt;, and other commands always interpret these paths relative to the current directory. Relative paths never begin with a /. So, if we're in /usr:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /usr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we can use a relative path to change to the /usr/local/bin directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd local/bin&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/local/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using .. ===&lt;br /&gt;
Relative paths may also contain one or more .. directories. The .. directory is a special directory that points to the parent directory. So, continuing from the example above:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/local/bin&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, our current directory is now /usr/local. We were able to go &amp;quot;backwards&amp;quot; one directory, relative to the current directory that we were in.&lt;br /&gt;
&lt;br /&gt;
In addition, we can also add .. to an existing relative path, allowing us to go into a directory that's alongside one we are already in, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/local&lt;br /&gt;
$ cd ../share&lt;br /&gt;
$ pwd&lt;br /&gt;
/usr/share&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relative path examples ===&lt;br /&gt;
Relative paths can get quite complex. Here are a few examples, all without the resultant target directory displayed. Try to figure out where you'll end up after typing these commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /bin&lt;br /&gt;
$ cd ../usr/share/zoneinfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ cd /usr/X11R6/bin&lt;br /&gt;
$ cd ../lib/X11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ cd /usr/bin&lt;br /&gt;
$ cd ../bin/../bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, try them out and see if you got them right :)&lt;br /&gt;
&lt;br /&gt;
=== Understanding &amp;quot;.&amp;quot; ===&lt;br /&gt;
Before we finish our coverage of cd, there are a few more things I need to mention. First, there is another special directory called ., which means &amp;quot;the current directory&amp;quot;. While this directory isn't used with the cd command, it's often used to execute some program in the current directory, as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./myprog&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the above example, the myprog executable residing in the current working directory will be executed.&lt;br /&gt;
&lt;br /&gt;
=== cd and the home directory ===&lt;br /&gt;
If we wanted to change to our home directory, we could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With no arguments, cd will change to your home directory, which is /root for the superuser and typically /home/username for a regular user. But what if we want to specify a file in our home directory? Maybe we want to pass a file argument to the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;myprog&amp;lt;/span&amp;gt; command. If the file lives in our home directory, we can type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./myprog /home/drobbins/myfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, using an absolute path like that isn't always convenient. Thankfully, we can use the ~ (tilde) character to do the same thing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./myprog ~/myfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other users' home directories ===&lt;br /&gt;
Bash will expand a lone ~ to point to your home directory, but you can also use it to point to other users' home directories. For example, if we wanted to refer to a file called fredsfile.txt in Fred's home directory, we could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./myprog ~fred/fredsfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using Linux Commands ==&lt;br /&gt;
&lt;br /&gt;
=== Introducing ls ===&lt;br /&gt;
Now, we'll take a quick look at the ls command. Very likely, you're already familiar with ls and know that typing it by itself will list the contents of the current working directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /usr&lt;br /&gt;
$ ls&lt;br /&gt;
X11R6      doc         i686-pc-linux-gnu  lib      man          sbin   ssl&lt;br /&gt;
bin        gentoo-x86  include            libexec  portage      share  tmp&lt;br /&gt;
distfiles  i686-linux  info               local    portage.old  src&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
By specifying the -a option, you can see all of the files in a directory, including hidden files: those that begin with .. As you can see in the following example, ls -a reveals the . and .. special directory links:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -a&lt;br /&gt;
.      bin        gentoo-x86         include  libexec  portage      share  tmp&lt;br /&gt;
..     distfiles  i686-linux         info     local    portage.old  src&lt;br /&gt;
X11R6  doc        i686-pc-linux-gnu  lib      man      sbin         ssl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Long directory listings ===&lt;br /&gt;
You can also specify one or more files or directories on the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls&amp;lt;/span&amp;gt; command line. If you specify a file, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls&amp;lt;/span&amp;gt; will show that file only. If you specify a directory, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls&amp;lt;/span&amp;gt; will show the ''contents'' of the directory. The -l option comes in very handy when you need to view permissions, ownership, modification time, and size information in your directory listing.&lt;br /&gt;
&lt;br /&gt;
In the following example, we use the -l option to display a full listing of my /usr directory.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -l /usr&lt;br /&gt;
drwxr-xr-x    7 root     root          168 Nov 24 14:02 X11R6&lt;br /&gt;
drwxr-xr-x    2 root     root        14576 Dec 27 08:56 bin&lt;br /&gt;
drwxr-xr-x    2 root     root         8856 Dec 26 12:47 distfiles&lt;br /&gt;
lrwxrwxrwx    1 root     root            9 Dec 22 20:57 doc -&amp;gt; share/doc&lt;br /&gt;
drwxr-xr-x   62 root     root         1856 Dec 27 15:54 gentoo-x86&lt;br /&gt;
drwxr-xr-x    4 root     root          152 Dec 12 23:10 i686-linux&lt;br /&gt;
drwxr-xr-x    4 root     root           96 Nov 24 13:17 i686-pc-linux-gnu&lt;br /&gt;
drwxr-xr-x   54 root     root         5992 Dec 24 22:30 include&lt;br /&gt;
lrwxrwxrwx    1 root     root           10 Dec 22 20:57 info -&amp;gt; share/info&lt;br /&gt;
drwxr-xr-x   28 root     root        13552 Dec 26 00:31 lib&lt;br /&gt;
drwxr-xr-x    3 root     root           72 Nov 25 00:34 libexec&lt;br /&gt;
drwxr-xr-x    8 root     root          240 Dec 22 20:57 local&lt;br /&gt;
lrwxrwxrwx    1 root     root            9 Dec 22 20:57 man -&amp;gt; share/man&lt;br /&gt;
lrwxrwxrwx    1 root     root           11 Dec  8 07:59 portage -&amp;gt; gentoo-x86/&lt;br /&gt;
drwxr-xr-x   60 root     root         1864 Dec  8 07:55 portage.old&lt;br /&gt;
drwxr-xr-x    3 root     root         3096 Dec 22 20:57 sbin&lt;br /&gt;
drwxr-xr-x   46 root     root         1144 Dec 24 15:32 share&lt;br /&gt;
drwxr-xr-x    8 root     root          328 Dec 26 00:07 src&lt;br /&gt;
drwxr-xr-x    6 root     root          176 Nov 24 14:25 ssl&lt;br /&gt;
lrwxrwxrwx    1 root     root           10 Dec 22 20:57 tmp -&amp;gt; ../var/tmp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first column displays permissions information for each item in the listing. I'll explain how to interpret this information in a bit. The next column lists the number of links to each file system object, which we'll gloss over now but return to later. The third and fourth columns list the owner and group, respectively. The fifth column lists the object size. The sixth column is the &amp;quot;last modified&amp;quot; time or &amp;quot;mtime&amp;quot; of the object. The last column is the object's name. If the file is a symbolic link, you'll see a trailing -&amp;gt; and the path to which the symbolic link points.&lt;br /&gt;
&lt;br /&gt;
=== Looking at directories ===&lt;br /&gt;
Sometimes, you'll want to look at a directory, rather than inside it. For these situations, you can specify the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; option, which will tell ls to look at any directories that it would normally look inside:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -dl /usr /usr/bin /usr/X11R6/bin ../share&lt;br /&gt;
drwxr-xr-x    4 root     root           96 Dec 18 18:17 ../share&lt;br /&gt;
drwxr-xr-x   17 root     root          576 Dec 24 09:03 /usr&lt;br /&gt;
drwxr-xr-x    2 root     root         3192 Dec 26 12:52 /usr/X11R6/bin&lt;br /&gt;
drwxr-xr-x    2 root     root        14576 Dec 27 08:56 /usr/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recursive and inode listings ===&lt;br /&gt;
So you can use &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; to look at a directory, but you can also use &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;-R&amp;lt;/span&amp;gt; to do the opposite: not just look inside a directory, but recursively look inside all the files and directories inside that directory! We won't include any example output for this option (since it's generally voluminous), but you may want to try a few &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -R&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -Rl&amp;lt;/span&amp;gt; commands to get a feel for how this works.&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;-i&amp;lt;/span&amp;gt; ls option can be used to display the inode numbers of the file system objects in the listing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -i /usr&lt;br /&gt;
   1409 X11R6        314258 i686-linux           43090 libexec        13394 sbin&lt;br /&gt;
   1417 bin            1513 i686-pc-linux-gnu     5120 local          13408 share&lt;br /&gt;
   8316 distfiles      1517 include                776 man            23779 src&lt;br /&gt;
     43 doc            1386 info                 93892 portage        36737 ssl&lt;br /&gt;
  70744 gentoo-x86     1585 lib                   5132 portage.old      784 tmp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Understanding inodes ===&lt;br /&gt;
Every object on a file system is assigned a unique index, called an inode number. This might seem trivial, but understanding inodes is essential to understanding many file system operations. For example, consider the . and .. links that appear in every directory. To fully understand what a .. directory actually is, we'll first take a look at /usr/local's inode number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -id /usr/local&lt;br /&gt;
   5120 /usr/local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The /usr/local directory has an inode number of 5120. Now, let's take a look at the inode number of /usr/local/bin/..:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -id /usr/local/bin/..&lt;br /&gt;
   5120 /usr/local/bin/..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, /usr/local/bin/.. has the same inode number as /usr/local! Here's how we can come to grips with this shocking revelation. In the past, we've considered /usr/local to be the directory itself. Now, we discover that inode 5120 is in fact the directory, and we have found two directory entries (called &amp;quot;links&amp;quot;) that point to this inode. Both /usr/local and /usr/local/bin/.. are links to inode 5120. Although inode 5120 only exists in one place on disk, multiple things link to it. Inode 5120 is the actual entry on disk.&lt;br /&gt;
&lt;br /&gt;
In fact, we can see the total number of times that inode 5120 is referenced by using the &amp;lt;pre&amp;gt;ls -dl&amp;lt;/pre&amp;gt; command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -dl /usr/local&lt;br /&gt;
drwxr-xr-x    8 root     root          240 Dec 22 20:57 /usr/local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If we take a look at the second column from the left, we see that the directory /usr/local (inode 5120) is referenced eight times. On my system, here are the various paths that reference this inode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local&lt;br /&gt;
/usr/local/.&lt;br /&gt;
/usr/local/bin/..&lt;br /&gt;
/usr/local/games/..&lt;br /&gt;
/usr/local/lib/..&lt;br /&gt;
/usr/local/sbin/..&lt;br /&gt;
/usr/local/share/..&lt;br /&gt;
/usr/local/src/..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mkdir ===&lt;br /&gt;
Let's take a quick look at the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mkdir&amp;lt;/span&amp;gt; command, which can be used to create new directories. The following example creates three new directories, tic, tac, and toe, all under /tmp:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ mkdir tic tac toe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
By default, the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mkdir&amp;lt;/span&amp;gt; command doesn't create parent directories for you; the entire path up to the next-to-last element needs to exist. So, if you want to create the directories '''won/der/ful''', you'd need to issue three separate &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mkdir&amp;lt;/span&amp;gt; commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir won/der/ful&lt;br /&gt;
mkdir: cannot create directory `won/der/ful': No such file or directory&lt;br /&gt;
$ mkdir won&lt;br /&gt;
$ mkdir won/der&lt;br /&gt;
$ mkdir won/der/ful&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, mkdir has a handy -p option that tells mkdir to create any missing parent directories, as you can see here:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir -p easy/as/pie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
All in all, pretty straightforward. To learn more about the mkdir command, type &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;man mkdir&amp;lt;/span&amp;gt; to read the manual page. This will work for nearly all commands covered here (for example, &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;man ls&amp;lt;/span&amp;gt;), except for &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cd&amp;lt;/span&amp;gt;, which is built-in to bash.&lt;br /&gt;
&lt;br /&gt;
=== touch ===&lt;br /&gt;
Now, we're going to take a quick look at the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cp&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt; commands, used to copy, rename, and move files and directories. To begin this overview, we'll first use the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt; command to create a file in /tmp:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ touch copyme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The touch command updates the &amp;quot;mtime&amp;quot; of a file if it exists (recall the sixth column in &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -l&amp;lt;/span&amp;gt; output). If the file doesn't exist, then a new, empty file will be created. You should now have a '''/tmp/copyme''' file with a size of zero.&lt;br /&gt;
&lt;br /&gt;
=== echo ===&lt;br /&gt;
Now that the file exists, let's add some data to the file. We can do this using the echo command, which takes its arguments and prints them to standard output. First, the echo command by itself:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo &amp;quot;firstfile&amp;quot;&lt;br /&gt;
firstfile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, the same echo command with output redirection:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo &amp;quot;firstfile&amp;quot; &amp;gt; copyme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The greater-than sign tells the shell to write echo's output to a file called copyme. This file will be created if it doesn't exist, and will be overwritten if it does exist. By typing &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -l&amp;lt;/span&amp;gt;, we can see that the copyme file is 10 bytes long, since it contains the word firstfile and the newline character:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -l copyme&lt;br /&gt;
-rw-r--r--    1 root     root           10 Dec 28 14:13 copyme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== cat and cp ===&lt;br /&gt;
To display the contents of the file on the terminal, use the cat command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat copyme&lt;br /&gt;
firstfile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, we can use a basic invocation of the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;cp&amp;lt;/span&amp;gt; command to create a copiedme file from the original copyme file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp copyme copiedme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Upon investigation, we find that they are truly separate files; their inode numbers are different:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -i copyme copiedme&lt;br /&gt;
  648284 copiedme   650704 copyme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mv ===&lt;br /&gt;
Now, let's use the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt; command to rename &amp;quot;copiedme&amp;quot; to &amp;quot;movedme&amp;quot;. The inode number will remain the same; however, the filename that points to the inode will change.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mv copiedme movedme&lt;br /&gt;
$ ls -i movedme&lt;br /&gt;
  648284 movedme&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A moved file's inode number will remain the same as long as the destination file resides on the same file system as the source file. We'll take a closer look at file systems in [[Linux Fundamentals, Part 3]] of this tutorial series.&lt;br /&gt;
&lt;br /&gt;
While we're talking about &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt;, let's look at another way to use this command. &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt;, in addition to allowing us to rename files, also allows us to move one or more files to another location in the directory hierarchy. For example, to move '''/var/tmp/myfile.txt''' to '''/home/drobbins''' (which happens to be my home directory,) I could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mv /var/tmp/myfile.txt /home/drobbins&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After typing this command, myfile.txt will be moved to '''/home/drobbins/myfile.txt'''. And if '''/home/drobbins''' is on a different file system than /var/tmp, the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt; command will handle the copying of myfile.txt to the new file system and erasing it from the old file system. As you might guess, when myfile.txt is moved between file systems, the myfile.txt at the new location will have a new inode number. This is because every file system has its own independent set of inode numbers.&lt;br /&gt;
&lt;br /&gt;
We can also use the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;mv&amp;lt;/span&amp;gt; command to move multiple files to a single destination directory. For example, to move myfile1.txt and myarticle3.txt to /home/drobbins, I could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mv /var/tmp/myfile1.txt /var/tmp/myarticle3.txt /home/drobbins&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating Links and Removing Files ==&lt;br /&gt;
&lt;br /&gt;
=== Hard links ===&lt;br /&gt;
We've mentioned the term &amp;quot;link&amp;quot; when referring to the relationship between directory entries (the &amp;quot;names&amp;quot; we type) and inodes (the index numbers on the underlying file system that we can usually ignore.) There are actually two kinds of links available on Linux. The kind we've discussed so far are called hard links. A given inode can have any number of hard links, and the inode will persist on the file system until all the hard links disappear. When the last hard link disappears and no program is holding the file open, Linux will delete the file automatically. New hard links can be created using the &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ln&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ touch firstlink&lt;br /&gt;
$ ln firstlink secondlink&lt;br /&gt;
$ ls -i firstlink secondlink&lt;br /&gt;
  15782 firstlink    15782 secondlink&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, hard links work on the inode level to point to a particular file. On Linux systems, hard links have several limitations. For one, you can only make hard links to files, not directories. That's right; even though . and .. are system-created hard links to directories, you (even as the &amp;quot;root&amp;quot; user) aren't allowed to create any of your own. The second limitation of hard links is that they can't span file systems; which would be the case if the file systems are on separate disk partitions. This means that you can't create a link from /usr/bin/bash to /bin/bash if your / and /usr directories exist on separate disk partitions.&lt;br /&gt;
&lt;br /&gt;
=== Symbolic links ===&lt;br /&gt;
&lt;br /&gt;
In practice, symbolic links (or symlinks) are used more often than hard links. Symlinks are a special file type where the link refers to another file by name, rather than directly to the inode. Symlinks do not prevent a file from being deleted; if the target file disappears, then the symlink will just be unusable, or broken.&lt;br /&gt;
&lt;br /&gt;
A symbolic link can be created by passing the -s option to &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ln&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ln -s secondlink thirdlink&lt;br /&gt;
$ ls -l firstlink secondlink thirdlink&lt;br /&gt;
-rw-rw-r--    2 agriffis agriffis        0 Dec 31 19:08 firstlink&lt;br /&gt;
-rw-rw-r--    2 agriffis agriffis        0 Dec 31 19:08 secondlink&lt;br /&gt;
lrwxrwxrwx    1 agriffis agriffis       10 Dec 31 19:39 thirdlink -&amp;gt; secondlink&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Symbolic links can be distinguished in &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;ls -l&amp;lt;/span&amp;gt; output from normal files in three ways. First, notice that the first column contains an l character to signify the symbolic link. Second, the size of the symbolic link is the number of characters in the target (secondlink, in this case). Third, the last column of the output displays the target filename preceded by a cute little -&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Symlinks in-depth ===&lt;br /&gt;
Symbolic links are generally more flexible than hard links. You can create a symbolic link to any type of file system object, including directories. And because the implementation of symbolic links is based on paths (not inodes), it's perfectly fine to create a symbolic link that points to an object on another physical file system; that is, a different disk partition. However, this fact can also make symbolic links tricky to understand.&lt;br /&gt;
&lt;br /&gt;
Consider a situation where we want to create a link in /tmp that points to /usr/local/bin. Should we type this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ln -s /usr/local/bin bin1&lt;br /&gt;
$ ls -l bin1&lt;br /&gt;
lrwxrwxrwx    1 root     root           14 Jan  1 15:42 bin1 -&amp;gt; /usr/local/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or alternatively:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ln -s ../usr/local/bin bin2&lt;br /&gt;
$ ls -l bin2&lt;br /&gt;
lrwxrwxrwx    1 root     root           16 Jan  1 15:43 bin2 -&amp;gt; ../usr/local/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see, both symbolic links point to the same directory. However, if our second symbolic link is ever moved to another directory, it will be &amp;quot;broken&amp;quot; because of the relative path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -l bin2&lt;br /&gt;
lrwxrwxrwx    1 root     root           16 Jan  1 15:43 bin2 -&amp;gt; ../usr/local/bin&lt;br /&gt;
$ mkdir mynewdir&lt;br /&gt;
$ mv bin2 mynewdir&lt;br /&gt;
$ cd mynewdir&lt;br /&gt;
$ cd bin2&lt;br /&gt;
bash: cd: bin2: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because the directory /tmp/usr/local/bin doesn't exist, we can no longer change directories into bin2; in other words, bin2 is now broken.&lt;br /&gt;
&lt;br /&gt;
For this reason, it is sometimes a good idea to avoid creating symbolic links with relative path information. However, there are many cases where relative symbolic links come in handy. Consider an example where you want to create an alternate name for a program in /usr/bin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ls -l /usr/bin/keychain &lt;br /&gt;
-rwxr-xr-x    1 root     root        10150 Dec 12 20:09 /usr/bin/keychain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As the root user, you may want to create an alternate name for &amp;quot;keychain&amp;quot;, such as &amp;quot;kc&amp;quot;. In this example, we have root access, as evidenced by our bash prompt changing to &amp;quot;#&amp;quot;. We need root access because normal users aren't able to create files in /usr/bin. As root, we could create an alternate name for keychain as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /usr/bin&lt;br /&gt;
# ln -s /usr/bin/keychain kc&lt;br /&gt;
# ls -l keychain&lt;br /&gt;
-rwxr-xr-x    1 root     root        10150 Dec 12 20:09 /usr/bin/keychain&lt;br /&gt;
# ls -l kc       &lt;br /&gt;
lrwxrwxrwx    1 root     root           17 Mar 27 17:44 kc -&amp;gt; /usr/bin/keychain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example, we created a symbolic link called kc that points to the file /usr/bin/keychain.&lt;br /&gt;
&lt;br /&gt;
While this solution will work, it will create problems if we decide that we want to move both files, /usr/bin/keychain and /usr/bin/kc to /usr/local/bin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mv /usr/bin/keychain /usr/bin/kc /usr/local/bin&lt;br /&gt;
# ls -l /usr/local/bin/keychain&lt;br /&gt;
-rwxr-xr-x    1 root     root        10150 Dec 12 20:09 /usr/local/bin/keychain&lt;br /&gt;
# ls -l /usr/local/bin/kc&lt;br /&gt;
lrwxrwxrwx    1 root     root           17 Mar 27 17:44 kc -&amp;gt; /usr/bin/keychain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because we used an absolute path in our symbolic link, our kc symlink is still pointing to /usr/bin/keychain, which no longer exists since we moved /usr/bin/keychain to /usr/local/bin.&lt;br /&gt;
&lt;br /&gt;
That means that kc is now a broken symlink. Both relative and absolute paths in symbolic links have their merits, and you should use a type of path that's appropriate for your particular application. Often, either a relative or absolute path will work just fine. The following example would have worked even after both files were moved:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /usr/bin&lt;br /&gt;
# ln -s keychain kc&lt;br /&gt;
# ls -l kc&lt;br /&gt;
lrwxrwxrwx    1 root     root            8 Jan  5 12:40 kc -&amp;gt; keychain&lt;br /&gt;
# mv keychain kc /usr/local/bin&lt;br /&gt;
# ls -l /usr/local/bin/keychain&lt;br /&gt;
-rwxr-xr-x    1 root     root        10150 Dec 12 20:09 /usr/local/bin/keychain&lt;br /&gt;
# ls -l /usr/local/bin/kc&lt;br /&gt;
lrwxrwxrwx    1 root     root           17 Mar 27 17:44 kc -&amp;gt; keychain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, we can run the keychain program by typing /usr/local/bin/kc. /usr/local/bin/kc points to the program keychain in the same directory as kc.&lt;br /&gt;
&lt;br /&gt;
=== rm ===&lt;br /&gt;
Now that we know how to use cp, mv, and ln, it's time to learn how to remove objects from the file system. Normally, this is done with the rm command. To remove files, simply specify them on the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /tmp&lt;br /&gt;
$ touch file1 file2&lt;br /&gt;
$ ls -l file1 file2&lt;br /&gt;
-rw-r--r--    1 root     root            0 Jan  1 16:41 file1&lt;br /&gt;
-rw-r--r--    1 root     root            0 Jan  1 16:41 file2&lt;br /&gt;
$ rm file1 file2&lt;br /&gt;
$ ls -l file1 file2&lt;br /&gt;
ls: file1: No such file or directory&lt;br /&gt;
ls: file2: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that under Linux, once a file is rm'ed, it's typically gone forever. For this reason, many junior system administrators will use the -i option when removing files. The -i option tells rm to remove all files in interactive mode -- that is, prompt before removing any file. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm -i file1 file2&lt;br /&gt;
rm: remove regular empty file `file1'? y&lt;br /&gt;
rm: remove regular empty file `file2'? y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the above example, the rm command prompted whether or not the specified files should *really* be deleted. In order for them to be deleted, I had to type &amp;quot;y&amp;quot; and Enter twice. If I had typed &amp;quot;n&amp;quot;, the file would not have been removed. Or, if I had done something really wrong, I could have typed Control-C to abort the rm -i command entirely -- all before it is able to do any potential damage to my system.&lt;br /&gt;
&lt;br /&gt;
If you are still getting used to the rm command, it can be useful to add the following line to your ~/.bashrc file using your favorite text editor, and then log out and log back in. Then, any time you type rm, the bash shell will convert it automatically to an rm -i command. That way, rm will always work in interactive mode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias rm=&amp;quot;rm -i&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== rmdir ===&lt;br /&gt;
To remove directories, you have two options. You can remove all the objects inside the directory and then use &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;rmdir&amp;lt;/span&amp;gt; to remove the directory itself:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir mydir&lt;br /&gt;
$ touch mydir/file1&lt;br /&gt;
$ rm mydir/file1&lt;br /&gt;
$ rmdir mydir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This method is commonly referred to as &amp;quot;directory removal for suckers.&amp;quot; All real power users and administrators worth their salt use the much more convenient &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;rm -rf&amp;lt;/span&amp;gt; command, covered next.&lt;br /&gt;
&lt;br /&gt;
The best way to remove a directory is to use the ''recursive force'' options of the rm command to tell rm to remove the directory you specify, as well as all objects contained in the directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm -rf mydir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Generally, rm -rf is the preferred method of removing a directory tree. Be very careful when using rm -rf, since its power can be used for both good and evil :)&lt;br /&gt;
&lt;br /&gt;
== Using Wild cards ==&lt;br /&gt;
&lt;br /&gt;
=== Introducing Wild cards ===&lt;br /&gt;
In your day-to-day Linux use, there are many times when you may need to perform a single operation (such as rm) on many file system objects at once. In these situations, it can often be cumbersome to type in many files on the command line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm file1 file2 file3 file4 file5 file6 file7 file8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To solve this problem, you can take advantage of Linux' built-in wild card support. This support, also called &amp;quot;globbing&amp;quot; (for historical reasons), allows you to specify multiple files at once by using a wildcard pattern. Bash and other Linux commands will interpret this pattern by looking on disk and finding any files that match it. So, if you had files file1 through file8 in the current working directory, you could remove these files by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm file[1-8]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Or if you simply wanted to remove all files whose names begin with file as well as any file named file, you could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rm file*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The * wildcard matches any character or sequence of characters, or even &amp;quot;no character.&amp;quot; Of course, glob wildcards can be used for more than simply removing files, as we'll see in the next panel.&lt;br /&gt;
&lt;br /&gt;
=== Understanding non-matches ===&lt;br /&gt;
If you wanted to list all the file system objects in /etc beginning with g as well as any file called g, you could type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -d /etc/g*&lt;br /&gt;
/etc/gconf  /etc/ggi  /etc/gimp  /etc/gnome  /etc/gnome-vfs-mime-magic  /etc/gpm  /etc/group  /etc/group-&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, what happens if you specify a pattern that doesn't match any file system objects? In the following example, we try to list all the files in /usr/bin that begin with asdf and end with jkl, including potentially the file asdfjkl:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ls -d /usr/bin/asdf*jkl&lt;br /&gt;
ls: /usr/bin/asdf*jkl: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here's what happened. Normally, when we specify a pattern, that pattern matches one or more files on the underlying file system, and ''bash replaces the pattern with a space-separated list of all matching objects''. However, when the pattern doesn't produce any matches, ''bash leaves the argument, wild cards and all, as-is''. So, then ls can't find the file /usr/bin/asdf*jkl and it gives us an error. The operative rule here is that ''glob patterns are expanded only if they match objects in the file system''. Otherwise they remain as is and are passed literally to the program you're calling.&lt;br /&gt;
&lt;br /&gt;
=== Wild card syntax: * and ? ===&lt;br /&gt;
Now that we've seen how globbing works, we should look at wild card syntax. You can use special characters for wild card expansion:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; will match zero or more characters. It means &amp;quot;anything can go here, including nothing&amp;quot;. Examples:&lt;br /&gt;
&lt;br /&gt;
* /etc/g* matches all files in /etc that begin with g, or a file called g.&lt;br /&gt;
* /tmp/my*1 matches all files in /tmp that begin with my and end with 1, including the file my1.&lt;br /&gt;
&lt;br /&gt;
? matches any single character. Examples:&lt;br /&gt;
&lt;br /&gt;
* myfile? matches any file whose name consists of myfile followed by a single character&lt;br /&gt;
* /tmp/notes?txt would match both /tmp/notes.txt and /tmp/notes_txt, if they exist&lt;br /&gt;
&lt;br /&gt;
=== Wild card syntax: [] ===&lt;br /&gt;
This wild card is like a ?, but it allows more specificity. To use this wild card, place any characters you'd like to match inside the []. The resultant expression will match a single occurrence of any of these characters. You can also use - to specify a range, and even combine ranges. Examples:&lt;br /&gt;
&lt;br /&gt;
* myfile[12] will match myfile1 and myfile2. The wild card will be expanded as long as at least one of these files exists in the current directory.&lt;br /&gt;
* [Cc]hange[Ll]og will match Changelog, ChangeLog, changeLog, and changelog. As you can see, using bracket wild cards can be useful for matching variations in capitalization.&lt;br /&gt;
* ls /etc/[0-9]* will list all files in /etc that begin with a number.&lt;br /&gt;
* ls /tmp/[A-Za-z]* will list all files in /tmp that begin with an upper or lower-case letter.&lt;br /&gt;
&lt;br /&gt;
The [!] construct is similar to the [] construct, except rather than matching any characters inside the brackets, it'll match any character, as long as it is not listed between the [! and ]. Example:&lt;br /&gt;
&lt;br /&gt;
* rm myfile[!9] will remove all files named myfile plus a single character, except for myfile9&lt;br /&gt;
&lt;br /&gt;
=== Wild card caveats ===&lt;br /&gt;
Here are some caveats to watch out for when using wild cards. Since bash treats wild card-related characters (?, [, ], and *) specially, you need to take special care when typing in an argument to a command that contains these characters. For example, if you want to create a file that contains the string [fo]*, the following command may not do what you want:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo [fo]* &amp;gt; /tmp/mynewfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the pattern [fo]* matches any files in the current working directory, then you'll find the names of those files inside /tmp/mynewfile.txt rather than a literal [fo]* like you were expecting. The solution? Well, one approach is to surround your characters with single quotes, which tell bash to perform absolutely no wild card expansion on them:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo '[fo]*' &amp;gt; /tmp/mynewfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using this approach, your new file will contain a literal [fo]* as expected. Alternatively, you could use backslash escaping to tell bash that [, ], and * should be treated literally rather than as wild cards:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ echo \[fo\]\* &amp;gt; /tmp/mynewfile.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Both approaches (single quotes and backslash escaping) have the same effect. Since we're talking about backslash expansion, now would be a good time to mention that in order to specify a literal \, you can either enclose it in single quotes as well, or type \\ instead (it will be expanded to \).&lt;br /&gt;
{{fancynote|Double quotes will work similarly to single quotes, but will still allow bash to do some limited expansion. Therefore, single quotes are your best bet when you are truly interested in passing literal text to a command. For more information on wild card expansion, type man 7 glob. For more information on quoting in bash, type man 8 glob and read the section titled QUOTING. If you're planning to take the LPI exams, consider this a homework assignment :)}}&lt;br /&gt;
&lt;br /&gt;
== Summary and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
Congratulations; you've reached the end of our review of Linux fundamentals! I hope that it has helped you to firm up your foundational Linux knowledge. The topics you've learned here, including the basics of bash, basic Linux commands, links, and wild cards, have laid the groundwork for our next tutorial on basic administration, in which we'll cover topics like regular expressions, ownership and permissions, user account management, and more.&lt;br /&gt;
&lt;br /&gt;
By continuing in this tutorial series, you'll soon be ready to attain your LPIC Level 1 Certification from the Linux Professional Institute. Speaking of LPIC certification, if this is something you're interested in, then we recommend that you study the Resources in the next panel, which have been carefully selected to augment the material covered in this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
Be sure to read the other articles in this series:&lt;br /&gt;
*[[Linux Fundamentals, Part 2]]&lt;br /&gt;
*[[Linux Fundamentals, Part 3]]&lt;br /&gt;
*[[Linux Fundamentals, Part 4]]&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;Bash by Example&amp;quot; article series, Daniel shows you how to use bash programming constructs to write your own bash scripts. This series (particularly Parts 1 and 2) will be good preparation for the LPIC Level 1 exam:&lt;br /&gt;
* [[Bash by Example, Part 1]]: Fundamental programming in the Bourne-again shell&lt;br /&gt;
* [[Bash by Example, Part 2]]: More bash programming fundamentals&lt;br /&gt;
* [[Bash by Example, Part 3]]: Exploring the ebuild system&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
[[Category:Linux Core Concepts]]&lt;br /&gt;
[[Category:Articles]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Funtoo_Linux_History</id>
		<title>Funtoo Linux History</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Funtoo_Linux_History"/>
				<updated>2012-11-18T20:42:29Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Citations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Funtoo arises from [[User:Drobbins|Daniel Robbins]]'s experience with [http://www.gentoo.org/ Gentoo] (and prior to that Stampede).&lt;br /&gt;
&lt;br /&gt;
= Funtoo Linux History =&lt;br /&gt;
&lt;br /&gt;
;'''Aug 25, 2010''': Perl 5.12 stabilized in Funtoo.&lt;br /&gt;
;'''Feb 1, 2010''': Sunrise removed from Funtoo.&lt;br /&gt;
;'''Jan 30, 2009''': Perl 5.10 integrated into Funtoo.&lt;br /&gt;
;'''Jan 8, 2009''': Git support integrated into Portage.&lt;br /&gt;
;'''Jan 6, 2009''': [http://www.gentoo.org/proj/en/sunrise/ Sunrise overlay] merged into Funtoo.&lt;br /&gt;
;'''Dec 15, 2008''': Metro 1.2 released.&lt;br /&gt;
;'''Nov 4, 2008''': Metro 1.1 released.&lt;br /&gt;
;'''Oct 18, 2008''': First version of [[Metro]], Linux automated build engine, released.&lt;br /&gt;
;'''Aug, 2008''': Daniel builds first unstable Gentoo stages -- requires modifications to upstream Gentoo tree.&lt;br /&gt;
;'''Jul 2008''': Daniel moves stages to 2008.0 profile.&lt;br /&gt;
;'''Dec 2007''': Daniel starts building Gentoo OpenVZ templates.&lt;br /&gt;
;'''Dec 2007''': Daniel starts building stable Gentoo stages.&lt;br /&gt;
&lt;br /&gt;
= From Inception to Gentoo 1.0+ =&lt;br /&gt;
&lt;br /&gt;
;'''Jun 10, 2002''': Gentoo Linux 1.2 released. :) &amp;lt;ref&amp;gt;http://www.linuxtoday.com/news_story.php3?ltsn=2002-06-12-016-26-NW-SW&amp;lt;/ref&amp;gt;&lt;br /&gt;
;'''Apr 8, 2002''': Gentoo Linux 1.1a released. :)&lt;br /&gt;
;'''May 10, 2002''': Gentoo listed as one of the top 10 Linux distributions on [http://distrowatch.com/ DistroWatch].&lt;br /&gt;
;'''Mar 31, 2002''': Gentoo Linux 1.0 released!!! &amp;lt;ref&amp;gt;http://www.linuxtoday.com/news_story.php3?ltsn=2002-04-01-011-26-PR-CY-DV&amp;lt;/ref&amp;gt;&lt;br /&gt;
;'''Feb 16-17, 2002''': Was in Brussels, Belgium to attend FOSDEM.&lt;br /&gt;
;'''Aug 14, 2001''': New Gentoo logo/web site debut -- designed by me! Still in use today! :)&lt;br /&gt;
;'''Dec 11, 2000''': Gentoo 1.0 Release Candidate 3 released.&lt;br /&gt;
;'''Nov 3, 2000''': Gentoo 1.0 Release Candidate 2 released.&lt;br /&gt;
;'''July 26, 2000''': Gentoo 1.0 release &amp;quot;imminent&amp;quot;, CVS online, and rsync &amp;quot;coming soon&amp;quot;.&lt;br /&gt;
;'''Late 1999''': Must have came back to Enoch and done the Gentoo name change right about now (the &amp;quot;Gentoo&amp;quot; name was Bob Mutch's idea). Started incorporating some FreeBSD ideas into Enoch... Portage (as we know it today) was born.&lt;br /&gt;
;'''Aug 1999''': My new dual Celeron mobo would not run Linux; went to FreeBSD, Achim Gottinger kept Enoch going.&lt;br /&gt;
;'''May 18-27, 1999''': First version of Enoch released, according to LWN.net. My blurb for Enoch: &amp;quot;Enoch is an advanced GNU/Linux distribution for the x86 PC Architecture, designed to bring your Linux experience into a new dimension. Or something like that.&amp;quot; &amp;lt;ref&amp;gt;http://lwn.net/1999/0527/dists.php3&amp;lt;/ref&amp;gt;&lt;br /&gt;
;'''Apr 1999''': Was working on Enoch. Wrote xpak .tbz2 code that is still in Portage.&lt;br /&gt;
;'''Nov 1998''': Was using/developing for Stampede Linux at home, but had not (yet) started Enoch?&lt;br /&gt;
;'''July 1997''': Started a new position at University of New Mexico, was using Debian 1.3.   &lt;br /&gt;
&lt;br /&gt;
= Citations =&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTITLE__&lt;br /&gt;
&lt;br /&gt;
[[Category:Funtoo]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Funtoo_Linux</id>
		<title>Funtoo Linux</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Funtoo_Linux"/>
				<updated>2012-11-18T20:41:24Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Funtoo Filesystem Hierarchy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Getting Started =&lt;br /&gt;
Start by [[Funtoo Linux Installation|installing Funtoo]]. If you have questions, someone has probably asked them already in our [[Funtoo Linux FAQ]]. Otherwise, there are other [[Funtoo Wiki:Community portal|community resources]] available. For more information on the vision of Funtoo, see: [[vision]]&lt;br /&gt;
&lt;br /&gt;
= Differences between Funtoo Linux and Gentoo Linux =&lt;br /&gt;
&lt;br /&gt;
From an installation perspective, the main difference between Funtoo Linux and Gentoo Linux is that Funtoo Linux has a different Portage tree. We store our Portage tree in a git repository. Our Portage tree does track the Gentoo repository (we import Gentoo changes almost every day,) but our tree does contain some significant changes from Gentoo's tree.&lt;br /&gt;
&lt;br /&gt;
Here is a basic overview of how Funtoo Linux differ from Gentoo Linux:&lt;br /&gt;
&lt;br /&gt;
{| {{Table}}&lt;br /&gt;
!||colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;|stable||colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background-color: #f78888;&amp;quot;|current||colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background-color: #f70088;&amp;quot;|experimental&lt;br /&gt;
|-&lt;br /&gt;
!Category&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |Gentoo Linux&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |Funtoo Linux&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |Gentoo Linux&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |Funtoo Linux&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |Gentoo Linux&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |Funtoo Linux&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!portage&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |2.1.10.49&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |2.3.3-r3 (funtoo)&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |~2.2.0_alpha100&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |2.3.3-r3 (funtoo)&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |2.3.3-r3 (funtoo)&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!portage tree&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |rsync-based&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |git-based&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |rsync-based&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |git-based&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |git-based&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!glibc&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |2.13-r4&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |2.11.3&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |2.14.1-r3&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |2.13-r4&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |2.13-r4&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!gcc&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |4.5.3-r1&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |4.4.5&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |4.5.3-r2&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |4.6.2-r1&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |4.6.2-r1&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!udev&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |171-r5&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |160-r3&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |182-r2/3&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |171-r3&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |171-r3&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!init scripts&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |openrc&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |openrc&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |openrc&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |openrc&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |openrc&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!perl&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |5.12.4-r1&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |5.12.4-r1&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |5.12.4-r2&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |5.14.2&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |gentoo unstable&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!ruby&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |1.8.7_p357&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |1.8.7_p357&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |1.8.7_p357&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |1.8.7_p357&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |1.8.7_p357&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!core openresolv&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |no&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |yes&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |no&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |yes&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |yes&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!custom pkgs&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |[[Portage (Funtoo)|portage]], udev, grub, coreboot, openrc, and [http://github.com/funtoo/funtoo-overlay more]&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |[[Portage (Funtoo)|portage]], udev, grub, coreboot, openrc, and [http://github.com/funtoo/funtoo-overlay more]&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |[[Portage (Funtoo)|portage]], udev, grub, coreboot, openrc, and [http://github.com/funtoo/funtoo-overlay more]&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!merged overlays&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |None&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |[https://github.com/slashbeast/foo-overlay slashbeast], [https://github.com/adessemond/bar-overlay A. Dessemond], [https://github.com/funtoo/flora flora]&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |None&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |[https://github.com/slashbeast/foo-overlay slashbeast], [https://github.com/adessemond/bar-overlay A. Dessemond], [https://github.com/funtoo/flora flora]&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |[https://github.com/slashbeast/foo-overlay slashbeast], [https://github.com/adessemond/bar-overlay A. Dessemond], [https://github.com/funtoo/flora flora]&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!upstream tree&lt;br /&gt;
|colspan=&amp;quot;1&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;| &lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |None&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |gentoo stable&lt;br /&gt;
|style=&amp;quot;background-color: #ddf;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |None&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |gentoo unstable&lt;br /&gt;
|style=&amp;quot;background-color: #f78888;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|style=&amp;quot;background-color:#87CEEB;&amp;quot; |N/A&lt;br /&gt;
|style=&amp;quot;background-color:#A0E75A;&amp;quot; |gentoo unstable&lt;br /&gt;
|style=&amp;quot;background-color: #f70088;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
!||colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background-color: #ddf;&amp;quot;|stable||colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background-color: #f78888;&amp;quot;|current||colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background-color: #f70088;&amp;quot;|experimental&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= What are the differences between 'stable', 'current' and 'experimental' ? =&lt;br /&gt;
&lt;br /&gt;
Funtoo Linux follows a continuous development cycle. This means that new packages are continuously added to the [[Portage Tree]] and others are periodically improved with patches and bug fixes. &lt;br /&gt;
&lt;br /&gt;
When a package is considered to be stable, it is tagged as such, and means that you are very unlikely to have trouble with it during installation and in daily usage. All other packages are typically tagged as 'current' meaning they have undergone less widespread testing and you are more likely to experience issues with the software itself, or a package build failure. However, in day-to-day experience:&lt;br /&gt;
&lt;br /&gt;
* Funtoo 'experimental' is the the development tree for CoreTeam members, it generally is the Funtoo 'current' tree to which tools are added that are right now at a testing, if one of these testing circles is done and finished the 'experimental' tree is merged into the 'current' tree and will so long not difer from it, until new packages with heavy impact are there for being tested. This tree is just designed for CoreTeam members as troubles might be more common here than in 'current'.&lt;br /&gt;
&lt;br /&gt;
* '''Funtoo 'current' is almost as stable as Funtoo 'stable'''', although some troubles may appear from time to time. Some distributions name their 'current' branch 'unstable' but we do not because it implies that &amp;quot;unstable == unusable&amp;quot; (Funtoo current '''IS''' usable for a daily usage in production environments, depending on your requirements). &lt;br /&gt;
&lt;br /&gt;
* Funtoo 'stable' can, per definition, lag '''a long ways behind''' 'current'. This branch is recommended for setting up servers which have standard and very well supported hardware for a long time. If you have a desktop machine which requires the most recent drivers / kernel available using 'stable' may not be a solution for you. Efforts are also made to ensure compatibility with stable Red Hat Enterprise Linux 5 kernels for use in environments where stability is of the utmost importance.&lt;br /&gt;
&lt;br /&gt;
= What's Been Done So Far =&lt;br /&gt;
&lt;br /&gt;
My technical goals for Funtoo Linux are to focus on improving the core Gentoo system, ie. what you'd find inside a stage3. I also have been working to improve general Gentoo technologies, such as migrating Portage to git, and ensuring that Funtoo is easily buildable in an automated way, by creating Metro. These changes are intended to empower me to improve Funtoo more easily, and are shared with you so that you can benefit from them as well.&lt;br /&gt;
&lt;br /&gt;
These improvements are detailed below:&lt;br /&gt;
&lt;br /&gt;
== Git-based Portage Tree ==&lt;br /&gt;
&lt;br /&gt;
One of the first things I did was migrate Gentoo's development Portage tree from cvs to git, and migrate Gentoo's user Portage tree from rsync to git. This was done to help me work more effectively, since git is simply a much more powerful and efficient tool than cvs.&lt;br /&gt;
&lt;br /&gt;
Zack Medico, Portage/emerge maintainer, has enhanced the 2.2 version of Portage so that it is compatible with git. This allows ''users'' to pull a Portage tree from a git repository. This can often be more efficient than rsync, although the git repository does take up more space on disk. But I did not switch away from rsync because it wasn't fast enough.&lt;br /&gt;
&lt;br /&gt;
More important for me is the fact that users can pull from the same repositories that I use for Funtoo development. This simplifies Funtoo infrastructure considerably, keeping things more fun for me :)&lt;br /&gt;
&lt;br /&gt;
Git also provides integrity-checking functionality that is superior to that which currently exists in Portage, which will allow improved data integrity checks in future versions of Portage. This work is not yet finished, or even really started, but by using git we are starting to move in this direction. This work will continue as I have time.&lt;br /&gt;
&lt;br /&gt;
== Forked Tree ==&lt;br /&gt;
&lt;br /&gt;
Funtoo has its own Portage tree that is 99% identical to Gentoo's Portage tree. I merge changes from Gentoo into our tree every 12 hours, using an automated process. Our tree has a few significant differences from the Gentoo Portage tree, which are covered in more detail in our [http://www.funtoo.org/en/articles/funtoo/quick-install-howto/ Quick Install Guide]&lt;br /&gt;
&lt;br /&gt;
I created my own Portage tree for a multitude of reasons. The main reason for creating the tree was so I could get improvements into my Portage tree immediately, changes which Gentoo developers may or may not be interested in adding to the official Gentoo tree. I don't want to wait around or try to convince someone to add a fix I need.&lt;br /&gt;
&lt;br /&gt;
== Metro and Daily Builds ==&lt;br /&gt;
&lt;br /&gt;
[[Metro]] is a tool I created to build Gentoo and Funtoo releases in an automated way. For around a year, I have been using Gentoo's catalyst, and now [[Metro]] to build daily releases of Gentoo and Funtoo. These stages are available on the [[Download|Download page]].&lt;br /&gt;
&lt;br /&gt;
Metro is a big improvement over Gentoo's automated build tool, catalyst, which I originally wrote but has not aged well over the years. Metro is still missing some functionality that exists in catalyst, most notably LiveCD support (I haven't created a Funtoo LiveCD yet, which is why :) but in nearly all other respects is much more capable than catalyst. I will continue to maintain and improve Metro as I have time. The daily builds serve as a good ongoing test for Metro as well as the integrity of the Funtoo Portage tree.&lt;br /&gt;
&lt;br /&gt;
== Forkable - Empowering Developers ==&lt;br /&gt;
&lt;br /&gt;
Combine the transition to git with Metro, and Funtoo is now actually quite easy to fork, unlike Gentoo. If you wanted to create your own derivative of Funtoo or Gentoo, you could simply clone my git repository and then set up Metro to build releases of this variant. With some basic familiarity with git, this can all be accomplished by an single individual in a single day.&lt;br /&gt;
&lt;br /&gt;
Why is this important? If you love Gentoo like I do, but want to work on Gentoo independently, so that you have your own personal &amp;amp;quot;fun, too&amp;amp;quot; project where ''you'' are Chief Architect, you have all the tools you need to make this happen. There is no longer a need to become an official Gentoo developer in order to grow in your Gentoo knowledge.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Core System Changes ==&lt;br /&gt;
Funtoo has several core system changes, and I plan to continue to focus on improving the core system quite a bit. Funtoo has its own &amp;lt;tt&amp;gt;sys-fs/udev&amp;lt;/tt&amp;gt; package, its own &amp;lt;tt&amp;gt;sys-apps/baselayout&amp;lt;/tt&amp;gt;, its own &amp;lt;tt&amp;gt;sys-apps/openrc&amp;lt;/tt&amp;gt; (which is used by default), along with various other packages and improvements. Work is currently under way on a [[Unified Configuration]] structure as well as new, improved profile method which allows specifying multiple profiles (See [[Multiple Profiles]]).&lt;br /&gt;
&lt;br /&gt;
== Articles ==&lt;br /&gt;
On the [[:Category:Articles|Articles]] page, you'll notice a number of technical articles and HOWTOs. My original IBM developerWorks Linux articles are gradually being added to the site and updated as time permits.&lt;br /&gt;
&lt;br /&gt;
Every now and then, I will be adding interesting new content, such as the intriguing [http://www.funtoo.org/en/security/slowloris/ Slowloris DOS Mitigation Guide], which details various mitigations for the Slowloris DOS that affects the Apache Web server. This article was co-authored with Ryan Vick, a security researcher who is a friend of mine.&lt;br /&gt;
&lt;br /&gt;
= What's in the Works =&lt;br /&gt;
In addition to various ongoing [[:Category:Projects|Funtoo Linux Projects]], there are other efforts.&lt;br /&gt;
&lt;br /&gt;
== Funtoo Filesystem Hierarchy ==&lt;br /&gt;
&lt;br /&gt;
The [[Funtoo Filesystem Hierarchy]] seeks to document the specific nuances of the Funtoo fileystem hierarchy beyond what is in the [http://pathname.com/fhs/ Filesystem Hierarchy Standard] already.&lt;br /&gt;
&lt;br /&gt;
[[Category:Funtoo]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Funtoo_Basic_concepts</id>
		<title>Funtoo Basic concepts</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Funtoo_Basic_concepts"/>
				<updated>2012-11-18T20:40:51Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following article is about several concepts which are very important to clearly understand how Funtoo works.&lt;br /&gt;
&lt;br /&gt;
= Funtoo branches =&lt;br /&gt;
&lt;br /&gt;
= Keywording and USE flags =&lt;br /&gt;
&lt;br /&gt;
== An analogy ==&lt;br /&gt;
&lt;br /&gt;
This is most probably the '''most fundamental and central point''' to understand as it covers how the package management in Funtoo works &amp;quot;coast-to-coast&amp;quot;. Basically this is extremely simple and pretty easy understand with a little analogy in your daily life: you are due to go the the grocery and several places around and to not forget what you have to do, you put on the list several items like:&lt;br /&gt;
* Grocery:&lt;br /&gt;
** Bread&lt;br /&gt;
** Eggs&lt;br /&gt;
** Butter&lt;br /&gt;
* Bank $40&lt;br /&gt;
* Photos&lt;br /&gt;
&lt;br /&gt;
When you will follow your list, every item will trigger an action like making you go in a particular section in the grocery to put a bag of bread in your basket or going to the bank outlet to withdraw $40. Those list items are a bit like switches: if you write (define) the item you turn a switch on making you take the appropriate action, if you don't write an item on the list you leave the switch turned off and you won't do something special. &lt;br /&gt;
&lt;br /&gt;
Items on the  list are, by ''convention'', related to what they denote: the good sense makes you write &amp;quot;beer&amp;quot; to make you remember to buy some beer. Technically, you can achieve the exact same thing by writing &amp;quot;cookies&amp;quot; or &amp;quot;butter&amp;quot; (unless some very good reason like hiding some evil intentions to the eyes of your house overlord ;-)). If you give your list to someone else and because, by convention, itemns on your list denotes what they are related to  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Portage will follow a similar behaviour, although more subtle: depending on the &amp;quot;grocery list items&amp;quot; you define at various places in the system you can govern how Portage acts (what features present on the system it is allowed to use, which are the packages it can consider or forget about, and so on. Those switches are split among several categories like:&lt;br /&gt;
* '''Features''' for those that control the features portage can use or can't use (like &amp;quot;you can use distcc if present&amp;quot; or &amp;quot;you can fetch the source code archive in the background&amp;quot; or &amp;quot;keep aside a binary archive of a package once compiled&amp;quot; or &amp;quot;Use ccache if present&amp;quot;)&lt;br /&gt;
* '''USE flags''' for those that governs what features are activated in the different packages you install on a machine. USE flags are a bit more subtle in practise because they can also express extra action to take care of like &amp;quot;download and copy the package official documentation in /usr/share/doc&amp;quot; or &amp;quot;automatically add a symlink /usr/bin/blahblah which points to /usr/bin/mypackage&amp;quot;. It is not easy to give a general case here due to the lack of a rigid rule telling what USE flag should do what (exact care given by portage varies from package to package depending on what orders are written in the ebuild file), those are only a '''convention'''.  &lt;br /&gt;
* '''Keywords''' &lt;br /&gt;
&lt;br /&gt;
= Portage and Portage tree =&lt;br /&gt;
&lt;br /&gt;
= Profiles =&lt;br /&gt;
&lt;br /&gt;
[[Category:Funtoo]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Funtoo_ARMv7</id>
		<title>Funtoo ARMv7</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Funtoo_ARMv7"/>
				<updated>2012-11-18T20:37:07Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is currently a scratch page for getting an ARMv7 build working for Funtoo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo 'sys-devel/crossdev **' &amp;gt;&amp;gt; /etc/portage/package.keywords&lt;br /&gt;
# emerge layman crossdev&lt;br /&gt;
# echo 'PORTDIR_OVERLAY=/usr/local/portage' &amp;gt;&amp;gt; /etc/make.conf&lt;br /&gt;
# install -d /usr/local/portage&lt;br /&gt;
# layman -a gentoo-arm&lt;br /&gt;
# crossdev -t armv7-none-linux-gnueabi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ARM]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Fonts</id>
		<title>Fonts</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Fonts"/>
				<updated>2012-11-18T20:36:54Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* LibXft */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LCD-Filtering overlay ==&lt;br /&gt;
Funtoo Linux planning to integrate LCD-filtering overlay into main tree in order to have very good font experience. Before that the overlay available via layman and manual steps required as described below. Overlay consist of patched versions of &amp;lt;tt&amp;gt;cairo&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;libXft&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;fontconfig&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;freetype&amp;lt;/tt&amp;gt; with the aim of getting nice hinting and rendering, emulate the Ubuntu/MS Windows/Mac OS X fonts appearance.&lt;br /&gt;
== Install the packages ==&lt;br /&gt;
&amp;lt;console&amp;gt; # emerge -uN fontconfig freetype cairo libXft&amp;lt;/console&amp;gt;&lt;br /&gt;
== Advanced configuration ==&lt;br /&gt;
=== Fontconfig ===&lt;br /&gt;
&lt;br /&gt;
=== Default configuration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;eselect fontconfig enable 10-antialias.conf&lt;br /&gt;
eselect fontconfig enable 10-autohint.conf  &lt;br /&gt;
eselect fontconfig enable 10-hinting.conf  &lt;br /&gt;
eselect fontconfig enable 10-hinting-slight.conf  &lt;br /&gt;
eselect fontconfig enable 10-sub-pixel-rgb.conf  &lt;br /&gt;
eselect fontconfig enable 11-lcdfilter-default.conf  &lt;br /&gt;
eselect fontconfig enable 70-no-bitmaps.conf  &lt;br /&gt;
eselect fontconfig disable 10-hinting-full.conf  &lt;br /&gt;
eselect fontconfig disable 10-hinting-medium.conf  &lt;br /&gt;
eselect fontconfig disable 10-no-sub-pixel.conf  &lt;br /&gt;
eselect fontconfig disable 10-sub-pixel-bgr.conf  &lt;br /&gt;
eselect fontconfig disable 10-sub-pixel-vbgr.conf  &lt;br /&gt;
eselect fontconfig disable 10-sub-pixel-vrgb.conf  &lt;br /&gt;
eselect fontconfig disable 10-unhinted.conf&amp;lt;/console&amp;gt;&lt;br /&gt;
===Linux configuration ===&lt;br /&gt;
&lt;br /&gt;
Same as default configuration except:&lt;br /&gt;
&amp;lt;console&amp;gt;eselect fontconfig enable 21-hinting-small-aquabase-slight.conf&lt;br /&gt;
eselect fontconfig enable 21-hinting-small-browallia-slight.conf  &lt;br /&gt;
eselect fontconfig enable 22-hinting-courier-italic-slight.conf&amp;lt;/console&amp;gt;&lt;br /&gt;
=== Infinality’s configuration ===&lt;br /&gt;
&lt;br /&gt;
Same as default configuration except:&lt;br /&gt;
&amp;lt;console&amp;gt;eselect fontconfig enable 15-hinting-tt-instructed-full.conf&lt;br /&gt;
eselect fontconfig enable 20-hinting-small-fonts-slight.conf  &lt;br /&gt;
eselect fontconfig enable 21-hinting-small-aquabase-slight.conf  &lt;br /&gt;
eselect fontconfig enable 21-hinting-small-browallia-slight.conf  &lt;br /&gt;
eselect fontconfig enable 22-hinting-courier-italic-slight.conf  &lt;br /&gt;
eselect fontconfig enable 25-hinting-small-arial-black-slight.conf&amp;lt;/console&amp;gt;&lt;br /&gt;
=== Windows configuration ===&lt;br /&gt;
&lt;br /&gt;
Same as default except:&lt;br /&gt;
&amp;lt;console&amp;gt;eselect fontconfig disable 10-autohint.conf&lt;br /&gt;
eselect fontconfig disable 10-hinting-slight.conf  &lt;br /&gt;
eselect fontconfig enable 10-hinting-full.conf  &lt;br /&gt;
eselect fontconfig enable 15-hinting-non-tt-instructed-slight.conf  &lt;br /&gt;
eselect fontconfig enable 20-hinting-small-fonts-slight.conf  &lt;br /&gt;
eselect fontconfig enable 21-hinting-small-aquabase-slight.conf  &lt;br /&gt;
eselect fontconfig enable 21-hinting-small-browallia-slight.conf  &lt;br /&gt;
eselect fontconfig enable 22-hinting-courier-italic-slight.conf  &lt;br /&gt;
eselect fontconfig enable 25-hinting-small-arial-black-slight.conf&amp;lt;/console&amp;gt;&lt;br /&gt;
=== OSX ===&lt;br /&gt;
&lt;br /&gt;
Same as default configuration except:&lt;br /&gt;
&amp;lt;console&amp;gt;eselect fontconfig disable 10-autohint.conf&lt;br /&gt;
eselect fontconfig disable 10-hinting.conf  &lt;br /&gt;
eselect fontconfig disable 10-hinting-slight.conf  &lt;br /&gt;
eselect fontconfig enable 10-unhinted.conf  &lt;br /&gt;
eselect fontconfig enable 15-hinting-tt-instructed-none.conf&amp;lt;/console&amp;gt;&lt;br /&gt;
== Freetype ==&lt;br /&gt;
Freetype can be configured through environment variables (see &amp;lt;tt&amp;gt;/etc/env.d/99lcdfilter&amp;lt;/tt&amp;gt; for a list of the variables and their description). Those variables can be overridden on a per-user basis by either redefining them in a startup file (such as &amp;lt;tt&amp;gt;~/.bash_profile&amp;lt;/tt&amp;gt;) or by sourcing the &amp;lt;tt&amp;gt;/usr/lib/ft-settings.sh&amp;lt;/tt&amp;gt; script with the desired style in parameter (you can, of course, source the script from a startup file).&lt;br /&gt;
&lt;br /&gt;
usage: source ft-settings.sh &amp;lt;style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;Possible styles:   &lt;br /&gt;
  default      - Use default settings.  A compromise that should please most people  &lt;br /&gt;
  osx          - Simulate OSX rendering  &lt;br /&gt;
  ubuntu       - Simulate UBUNTU rendering  &lt;br /&gt;
  linux        - Generic Linux style - no snapping or certain other tweaks  &lt;br /&gt;
  windows      - Simulate Windows rendering  &lt;br /&gt;
  vanilla      - Just subpixel hinting&lt;br /&gt;
&lt;br /&gt;
Infinality styles:  &lt;br /&gt;
  classic      - Infinality rendering circa 2010. No snapping  &lt;br /&gt;
  nudge        - CLASSIC with lightly stem snapping and tweaks  &lt;br /&gt;
  push         - CLASSIC with medium stem snapping and tweaks  &lt;br /&gt;
  shove        - Full stem snapping and tweaks without sharpening  &lt;br /&gt;
  sharpened    - Full stem snapping, tweaks, and Windows-style sharpening  &lt;br /&gt;
  infinality   - Settings used by Infinality&amp;lt;/console&amp;gt;&lt;br /&gt;
== LibXft ==&lt;br /&gt;
Only legacy programs still use libXft. The default configuration is defined in &amp;lt;tt&amp;gt;/usr/share/X11/app-defaults/Xft&amp;lt;/tt&amp;gt;. It can be overriden on a per-user basis in the &amp;lt;tt&amp;gt;~/.Xresources&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;~/.Xdefaults&amp;lt;/tt&amp;gt; files :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;console&amp;gt;Xft.antialias:  1&lt;br /&gt;
Xft.autohint:   0  &lt;br /&gt;
Xft.dpi:        96  &lt;br /&gt;
Xft.hinting:    1  &lt;br /&gt;
Xft.hintstyle:  hintfull  &lt;br /&gt;
Xft.lcdfilter:  lcddefault  &lt;br /&gt;
Xft.rgba:       rgb&amp;lt;/console&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Extlinux</id>
		<title>Extlinux</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Extlinux"/>
				<updated>2012-11-18T20:36:37Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* manual extlinux.conf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What is ExtLinux? =&lt;br /&gt;
&lt;br /&gt;
ExtLinux is a pretty simple and modern systemloader, bundled with the syslinux tools, installation is really simple for it and fast, and thanks to our CoreTeam member Slashbeast the configuration runs automated in an awesome way.&lt;br /&gt;
&lt;br /&gt;
= Installing ExtLinux for funtoo =&lt;br /&gt;
&lt;br /&gt;
Installing ExtLinux for funtoo is known to work and supported too. If you like to try it just emerge syslinux&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# emerge syslinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with that you have the complete syslinux tools installed. Another helpful tool you should merge with syslinux is slashbeast's lazykernel tool, so let us merge it too:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# emerge lazykernel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing extlinux ==&lt;br /&gt;
&lt;br /&gt;
to install extlinux just follow these steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install -d /boot/extlinux&lt;br /&gt;
# extlinux --install /boot/extlinux&lt;br /&gt;
# cd /boot&lt;br /&gt;
# ln -s . boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the next steps are different depending if you use an MBR or GPT setup and the HDD you installed on and want to boot from. Let us now for general take /dev/sda as your boot device.&lt;br /&gt;
&lt;br /&gt;
=== MBR ===&lt;br /&gt;
&lt;br /&gt;
If you set up your disk with MBR partition scheme just do the next steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/mbr.bin of=/dev/sda&lt;br /&gt;
# cp /usr/share/syslinux/menu.c32 /boot/extlinux/&lt;br /&gt;
# touch /boot/extlinux/extlinux.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPT ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# sgdisk /dev/sda --attributes=1:set:2&lt;br /&gt;
# sgdisk /dev/sda --attributes=1:show&lt;br /&gt;
1:2:1 (legacy BIOS bootable)&lt;br /&gt;
# dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/gptmbr.bin of=/dev/sda&lt;br /&gt;
# cp /usr/share/syslinux/menu.c32 /boot/extlinux/&lt;br /&gt;
# touch /boot/extlinux/extlinux.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up the Kernel ==&lt;br /&gt;
&lt;br /&gt;
Now if you followed our advice to install lazykernel we have a pretty nice way to solve all the setup with a bit of prework and finish it then. If not you should go to the manual part. :)&lt;br /&gt;
&lt;br /&gt;
=== lazykernel way ===&lt;br /&gt;
&lt;br /&gt;
As you setup lazykernel, we now need to edit /etc/lazykernel.conf&lt;br /&gt;
&lt;br /&gt;
make it to look like somethink like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# After configuring, hash or remove line below.&lt;br /&gt;
#CONFIGUREFIRST&lt;br /&gt;
&lt;br /&gt;
# Number of the kernels to keep so `lazykernel clean` will not propose to remove them. Default: 3&lt;br /&gt;
keep_kernels=5&lt;br /&gt;
&lt;br /&gt;
# Sort kernels by 'version' (biggest version first) or by 'mtime' (latest images first). Default: mtime&lt;br /&gt;
# Sorting by version may fail and 3.3.0-rc2 will be marked as newer than 3.3.0.&lt;br /&gt;
#sort_by='version'&lt;br /&gt;
sort_by=mtime&lt;br /&gt;
&lt;br /&gt;
# The name for menu entry.&lt;br /&gt;
menu_entry_name=&amp;quot;Funtoo Linux&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Specify what initramfs image to use, if any. (Optional)&lt;br /&gt;
initramfs='initramfs.cpio.gz'&lt;br /&gt;
&lt;br /&gt;
# Append kernel params, usualy you use it to specify rootfs device, but you can use it to pass switches to initramfs as well. (Optional)&lt;br /&gt;
#kernel_params='root=/dev/sda2'&lt;br /&gt;
#kernel_params=&amp;quot;rootfstype=ext4 luks enc_root=/dev/sda2 lvm root=/dev/mapper/vg-rootfs uswsusp resume=/dev/mapper/vg-swap&amp;quot;&lt;br /&gt;
kernel_params=&amp;quot;rootfstype=ext4 luks enc_root=/dev/sdb3 lvm root=/dev/mapper/vg-root uswsusp resume=/dev/mapper/vg-swap&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
please make sure to comment out or delete the second line of the config file, else it will spit out an error for you... :)&lt;br /&gt;
&lt;br /&gt;
Now let us setup our kernel with lazykernel if you have a manual kernel just run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd &amp;lt;kernel build dir&amp;gt;&lt;br /&gt;
# lazykernel auto&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
that will generate the modules for you, copy your kernel form /usr/src/linux over to /boot and generate the /boot/extlinux/extlinux.conf for you. The manual kernel will be the only supported one by lazykernel.&lt;br /&gt;
&lt;br /&gt;
That's all you are ready to boot. :)&lt;br /&gt;
&lt;br /&gt;
=== manual extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
For other kernels, like those created by genkernel or by the binary USE-flag you need to edit your config by yourself. Just open /etc/extlinux/extlinux.conf in your favorite editor and setup something like the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TIMEOUT 30&lt;br /&gt;
UI menu.c32&lt;br /&gt;
&lt;br /&gt;
MENU TITLE Boot Menu&lt;br /&gt;
MENU COLOR title        1;37;40&lt;br /&gt;
MENU COLOR border       30;40&lt;br /&gt;
MENU COLOR unsel        37;40&lt;br /&gt;
&lt;br /&gt;
LABEL funtoo1&lt;br /&gt;
        MENU LABEL Funtoo Linux KERNEL-VERSION&lt;br /&gt;
        LINUX /&amp;lt;kernel&amp;gt;&lt;br /&gt;
        INITRD /&amp;lt;initramfs&amp;gt;&lt;br /&gt;
        APPEND rootfstype=ext4 luks enc_root=/dev/sdb3 lvm root=/dev/mapper/vg-root uswsusp resume=/dev/mapper/vg-swap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That's all again you are ready for boot. You can also define several LABELs in that list to have multiple kernels been booted... :)&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Ebuild_Maintainer_list</id>
		<title>Ebuild Maintainer list</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Ebuild_Maintainer_list"/>
				<updated>2012-11-18T20:31:57Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As we would like to keep track of who is responsible and how we could contact him it would be nice to have you subscribed in the following list with the ebuild and your data to contact you.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:75%; margin:1em 1em 1em 0; background:#fafafa; border:1px #aaa solid; border-collapse:collapse; font-size:95%; caption-side:bottom;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! ebuild !! Name !! IRC Contact !! Wiki User !! Other Contact&lt;br /&gt;
|-&lt;br /&gt;
! A &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! B&lt;br /&gt;
|-&lt;br /&gt;
| || x11-misc/bumblebee || Michael Ketslah || ZogG || [[User:ZogG|ZogG]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! C&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! D&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! E&lt;br /&gt;
|-&lt;br /&gt;
| || eclipse-sdk || Jean-Francis Roy || jeanfrancis || [[User:Jeanfrancis|JeanFrancis]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || eclipse-sdk-bin || Jean-Francis Roy || jeanfrancis || [[User:Jeanfrancis|JeanFrancis]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! F&lt;br /&gt;
|-&lt;br /&gt;
| || media-video/freeseer || Patrick McMunn || PaddyMac || [[User:PaddyMac|PaddyMac]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || fribid || Edward Tjörnhammar || edwtjo || [[User:Edwtjo|Edwtjo]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! G&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! H&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! I&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! J&lt;br /&gt;
|-&lt;br /&gt;
| || jsl || Jean-Francis Roy (ebuild from felicitus overlay) || jeanfrancis || [[User:Jeanfrancis|JeanFrancis]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! K&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! L&lt;br /&gt;
|-&lt;br /&gt;
| || lucene-analyzers || Jean-Francis Roy || jeanfrancis || [[User:Jeanfrancis|JeanFrancis]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! M&lt;br /&gt;
|-&lt;br /&gt;
| || minetest || Edward Tjörnhammar || edwtjo || [[User:Edwtjo|Edwtjo]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || safecopy || Markus Maiwald || mmatk || [[User:Mmatk|Mmatk]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || media-gfx/makehuman || Sandy-Marko Knauer || knasan || [[User:Knasan|Knasan]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! N&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! O&lt;br /&gt;
|-&lt;br /&gt;
| || oblogout || Jean-Francis Roy || jeanfrancis || [[User:Jeanfrancis|JeanFrancis]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || oxygen-fonts || Rafael Fernández López || ereslibre || [[User:Ereslibre|Ereslibre]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! P&lt;br /&gt;
|-&lt;br /&gt;
| || palm-novacom || Jean-Francis Roy || jeanfrancis || [[User:Jeanfrancis|JeanFrancis]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || pyroom || Martin Scholz || golodhrim || [[User:Golodhrim|Golodhrim]] || see Bio&lt;br /&gt;
|-&lt;br /&gt;
! Q&lt;br /&gt;
|-&lt;br /&gt;
! R&lt;br /&gt;
|-&lt;br /&gt;
! S&lt;br /&gt;
|-&lt;br /&gt;
| || splash-themes-funtoo || ryo || ryo || [[User:ryo|Ryo]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || shogun || Jean-Francis Roy || jeanfrancis || [[User:Jeanfrancis|JeanFrancis]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || media-libs/silly || Patrick McMunn || PaddyMac || [[User:PaddyMac|PaddyMac]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || spotify || Rafael Fernández López || ereslibre || [[User:Ereslibre|Ereslibre]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || sublime-text || Rafael Fernández López || ereslibre || [[User:Ereslibre|Ereslibre]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || svmlight || Jean-Francis Roy || jeanfrancis || [[User:Jeanfrancis|JeanFrancis]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! T&lt;br /&gt;
|-&lt;br /&gt;
| || theano|| Jean-Francis Roy || jeanfrancis || [[User:Jeanfrancis|JeanFrancis]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || thinkfan || Rafael Fernández López || ereslibre || [[User:Ereslibre|Ereslibre]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
| || traGtor || Kai Korla || balticer || [[User:balticer|balticer]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! U&lt;br /&gt;
|-&lt;br /&gt;
! V&lt;br /&gt;
|-&lt;br /&gt;
! W&lt;br /&gt;
|-&lt;br /&gt;
| || games-fps/warsow || Ari Malinen || defer || [[User:defer|defer]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! X&lt;br /&gt;
|-&lt;br /&gt;
| || xfce-base/xfwm4 || Roman v. Gemmeren || strowi || [[User:strowi|strowi]] || see user page&lt;br /&gt;
|-&lt;br /&gt;
! Y&lt;br /&gt;
|-&lt;br /&gt;
! Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Lenovo_Thinkpad_T420</id>
		<title>Lenovo Thinkpad T420</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Lenovo_Thinkpad_T420"/>
				<updated>2012-11-18T20:27:56Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: Palica moved page Dossier: Lenovo Thinkpad T420 to Lenovo Thinkpad T420&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Throughout, this article will assume the following:&lt;br /&gt;
* You have installed Gentoo or Funtoo in the past.&lt;br /&gt;
** If you haven't, this article will still serve you well, but please have either the official funtoo, or gentoo install guides open. We move through non-machine-specific bits with little elaboration.&lt;br /&gt;
* Have a T420 or similar machine.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have a T420, you may find this guide useful for:&lt;br /&gt;
* Nvidia Optimus Cards.&lt;br /&gt;
* Power management.&lt;br /&gt;
* General setup.&lt;br /&gt;
&lt;br /&gt;
This installation assumes (For now) that the install is starting from an MS-Windows installation. If you are not on Windows, please add your favourite choice of steps, keep the emphasis on ease of understanding.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
You'll want to get yourself running off a LiveCD or LiveUSB to start. This guide will assume liveUSB, since some users find them more difficult to prepare, this is usually due to boot flag issues. &lt;br /&gt;
(Note: ''Live USB restore drives are nice to have in general! The author keeps one in his college binder.'')&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
We can use LiLi for this, it provides a nice, simple interface and is fairly reliable: [http://www.linuxliveusb.com/en/download LiLi Download]&lt;br /&gt;
&lt;br /&gt;
=== SysrescueCD ===&lt;br /&gt;
Grab the version that Suites your needs here: [http://www.sysresccd.org/Download Sysrescue Download]&lt;br /&gt;
Next use LiLi (Or whatever you happen to be using) to flash the image or burn your CD. Reboot, change your boot device, and you'll find yourself at a grub menu.&lt;br /&gt;
&lt;br /&gt;
Since the T series are all 64-bit laptops, make sure to boot the 64-bit kernel, as the default is 32-bit.&lt;br /&gt;
&lt;br /&gt;
''But Why?: If we pick 32-bit, later on we won't be able to chroot into our Funtoo's 64-bit stage 3.''&lt;br /&gt;
&lt;br /&gt;
You should see a fairly verbose boot as sysrescueCD scans for modules it requires and starts up. It is safe to simply accept prompt defaults here, unless they are errors.&lt;br /&gt;
&lt;br /&gt;
When you are greeted by the interactive command prompt, enter 'wizard' as prompted, and accept the default entry in the dialogue. This will give us a functioning XFCE desktop environment.&lt;br /&gt;
&lt;br /&gt;
== Partitioning ==&lt;br /&gt;
Partitioning is the only step of this install which provides real risk to data on other operating systems. Be extremely careful if there is something you do not wish to loose. These steps are not foolproof and may result in lost data.&lt;br /&gt;
&lt;br /&gt;
Please be aware that MBR disks only support '''4''' primary partitions. You can solve this by creating an 'extended' partition and adding logical partitions to it. If you are feeling particularly brave try GPT on your disk.&lt;br /&gt;
&lt;br /&gt;
So lets start:&lt;br /&gt;
First open up gparted. You should see it on the taskbar if you're using systemrescueCD. It will scan available drives and show you the partition table. Most users will likely find one of the following to their liking:&lt;br /&gt;
&lt;br /&gt;
==== Pure Funtoo ====&lt;br /&gt;
You'll likely want:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/boot       :: EXT2       :: 100mb-500mb&lt;br /&gt;
    ''Note: We choose EXT2 because there is really no good use for a journalled boot partition, but feel free to use EXT4 instead!''&lt;br /&gt;
/           :: EXT4       :: 60gb (suggested floor value) - 500+&lt;br /&gt;
swap        :: linux-swap :: Your RAM Value (Optional, allows for hibernation)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You may wish for a separate /home, which is perfectly legitimate, or any number of other partitions. &lt;br /&gt;
&lt;br /&gt;
==== Dual Boot with Windows ====&lt;br /&gt;
If dual booting with Windows, it is advisable to have Windows installed '''first''' since it will muck with the MBR and possibly want to create it's own boot partition.&lt;br /&gt;
You'll likely want:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
System Reserved    :: NTFS      :: Whatever windows chooses.&lt;br /&gt;
Windows            :: NTFS      :: &amp;gt;100gb (If you plan on doing any serious work on windows)&lt;br /&gt;
/boot              :: EXT2      :: 100mb-500mb&lt;br /&gt;
Extended Partition -&lt;br /&gt;
  /                :: EXT4      :: Whatever is left.&lt;br /&gt;
  swap             :: linux-swap:: Your RAM value. (Optional, allows for hibernation)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You may also want a separate /home, etc. These will fit into your extended partition without contributing to MBR's 4 partition limit.&lt;br /&gt;
&lt;br /&gt;
== Starting the  (actual) Install ==&lt;br /&gt;
Up until now everything we've done has just been foreplay. Finally we can mount our partitions and get started on the installation!&lt;br /&gt;
&lt;br /&gt;
==== Mounting ====&lt;br /&gt;
First, lets mount all of our partitions.&lt;br /&gt;
* Make a directory for root. Lets assume '''/mnt/funtoo'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /mnt/funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mount your '/' partition to /mnt/funtoo&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount /dev/sd## /mnt/funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Make a directory for your boot partition.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /mnt/funtoo/boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mount your boot partition.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount /dev/sd## /mnt/funtoo/boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mount anything else you may have made and need. (Not swap)&lt;br /&gt;
&lt;br /&gt;
==== Checking the Date ====&lt;br /&gt;
Although this may seem super un-important, if you want to avoid lots of spammy warning messages later, checking your date is beneficial.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
date&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it needs to be set, you'll want something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
date 071620002011&lt;br /&gt;
#Fri Jul 16 20:00:00 UTC 2011&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fetch a Stage 3 ====&lt;br /&gt;
Next we need to fetch a tarball containing a barebones stage. We will download the core-i7 architecture version, if you have a core i5 or i3, don't worry, it's all the same.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /mnt/funtoo&lt;br /&gt;
wget http://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-64bit/corei7/stage3-current.tar.xz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next lets unpack with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar xJpf stage3-current.tar.xz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''Seriously, don't forget the 'p' option.''&lt;br /&gt;
&lt;br /&gt;
If you run 'ls' now, you should see the /mnt/funtoo is fully populated with folders such as lib, home, and proc.&lt;br /&gt;
&lt;br /&gt;
==== Chroot'ing ====&lt;br /&gt;
Now we need to change the ''apparent root'' of our system to our fledgling Funtoo system.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /mnt/funtoo&lt;br /&gt;
mount --bind /proc ./proc&lt;br /&gt;
mount --bind /dev ./dev&lt;br /&gt;
cp /etc/resolv.conf ./etc&lt;br /&gt;
env -i HOME=/root TERM=$TERM chroot /mnt/funtoo /bin/bash --login&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting the Portage Tree ====&lt;br /&gt;
Funtoo (Unlike Gentoo) uses a git based portage tree, however if you're coming from Gentoo, you'll be glad to know we sync with the Gentoo tree once every 12 hours.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge --sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''You can ignore most of the errors that might be spat out at this stage, however if they do not disappear on subsequent merges, talk to us in #funtoo.''&lt;br /&gt;
Your first sync will take significantly longer then subsequent syncs, as the whole tree must be synced.&lt;br /&gt;
&lt;br /&gt;
==== A Configuration Celebration ====&lt;br /&gt;
Now that we have our portage tree cloned, we need to do some initial setup on some files before doing anything else with portage.&lt;br /&gt;
&lt;br /&gt;
'''Fstab'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll want something like this: (Replace the dev values with what you are using)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;fs&amp;gt;			&amp;lt;mountpoint&amp;gt;	&amp;lt;type&amp;gt;		&amp;lt;opts&amp;gt;		         &amp;lt;dump/pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/dev/sda1		/boot		ext2		noauto,noatime  	 1 2&lt;br /&gt;
/dev/sda3		none		swap		sw		         0 0&lt;br /&gt;
/dev/sda4		/		ext4		noatime		         0 1&lt;br /&gt;
/dev/cdrom		/mnt/cdrom	auto		noauto,ro	         0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Localtime'''&lt;br /&gt;
&lt;br /&gt;
Lets remove the default localtime, and create a symbolic link to the proper time zone. (You probably will want something other then Vancouver)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /etc/localtime&lt;br /&gt;
ln -s /usr/share/zoneinfo/America/Vancouver /etc/localtime&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Hostname '''&lt;br /&gt;
Set your host name: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /etc/conf.d/hostname&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''hwclock'''&lt;br /&gt;
&lt;br /&gt;
If you're using a dual boot system, you'll want to change this. Otherwise it's entirely optional.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /etc/conf.d/hwclock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you're on windows you'll want:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clock=&amp;quot;local&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Make.conf'''&lt;br /&gt;
Important enough that it deserves it's own article. A template make.conf for the T420 will be forthcoming.&lt;br /&gt;
&lt;br /&gt;
For now:&lt;br /&gt;
If you have an i5 or i3 you will want&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have an i7 you'll probably want&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''But I have Hyperthreading! Why only -j3?''&lt;br /&gt;
Hyperthreading and compiling don't play well together. You'll have the same (or better) performance with -j3 as -j5 with a dual core hyper threaded processor.&lt;br /&gt;
&lt;br /&gt;
== Stop, Kernel time! ==&lt;br /&gt;
''For this guide we'll be using some pre-found config options that I will be adding later.''&lt;br /&gt;
&lt;br /&gt;
* Networking:&lt;br /&gt;
** iwlwifi and auxilary&lt;br /&gt;
** Unknown intel ethernet adapter. Selected several.&lt;br /&gt;
* GPU&lt;br /&gt;
** Intel available default.&lt;br /&gt;
** nvidia will be dealt with later&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
* wpa_supplicant&lt;br /&gt;
* iwl6000-ucode&lt;br /&gt;
* wireless-tools&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Bootloader Setup ==&lt;br /&gt;
In funtoo the setup of grub is extremely simplified.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge -vqat boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''Q: What are those options? A: We'll get to them later, lets get the system booted first, okay? ''&lt;br /&gt;
Boot-update is a tool that will allow for very simple configuration of grub similar to older versions (But nicer still). &lt;br /&gt;
&lt;br /&gt;
You will now find a file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat /etc/boot.conf&lt;br /&gt;
boot {&lt;br /&gt;
        generate grub&lt;br /&gt;
        default &amp;quot;Funtoo Linux genkernel&amp;quot;&lt;br /&gt;
        timeout 3 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Funtoo Linux&amp;quot; {&lt;br /&gt;
        kernel bzImage[-v]&lt;br /&gt;
        # params += nomodeset&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Funtoo Linux genkernel&amp;quot; {&lt;br /&gt;
        kernel kernel[-v]&lt;br /&gt;
        initrd initramfs[-v]&lt;br /&gt;
        params += real_root=auto &lt;br /&gt;
        # params += nomodeset&lt;br /&gt;
} &lt;br /&gt;
This can be configured (We'll touch on this later. We need to make sure the kernel is booting and working before we start tweaking) with options for the kernel.&lt;br /&gt;
&lt;br /&gt;
==== Dual-Booters Only ====&lt;br /&gt;
If you want to dual boot with windows you'll need to add an entry here:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Windows 7&amp;quot; {&lt;br /&gt;
    type win7&lt;br /&gt;
    params root=/dev/sda1&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Installing Grub onto the Drive(Everyone) ====&lt;br /&gt;
Next we can install grub onto the drive.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
grub-install --no-floppy /dev/sda&lt;br /&gt;
boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
No errors means we should be good to go!&lt;br /&gt;
&lt;br /&gt;
== Tidy up and go. ==&lt;br /&gt;
Just a few more things!&lt;br /&gt;
&lt;br /&gt;
Lets set a root password.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
passwd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is advisable to exit the chroot and umount all the relevant install drives. Or at least just exit the chroot, but you can just simply reboot from here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
cd /&lt;br /&gt;
umount /mnt/funtoo/boot /mnt/funtoo/dev /mnt/funtoo/proc /mnt/funtoo&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring the New System ==&lt;br /&gt;
Welcome to funtoo! You should be greeted by a bunch of spammy text that scrolls by reasonably fast and then a couple penguins and openrc. Login to your root user and lets start playing.&lt;br /&gt;
&lt;br /&gt;
A note, this part of the guide is meant to be much more of a dialogue between us.&lt;br /&gt;
&lt;br /&gt;
==== Getting up the (wired) network ====&lt;br /&gt;
If you're gifted with a wired network connect, use it! The initial setup is much more convenient and quick.&lt;br /&gt;
&lt;br /&gt;
Quickly set up the network with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/init.d/dhcpcd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now check to see if our wired adapter is listed with ifconfig.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
#  (or)&lt;br /&gt;
ping google.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you see it listed with a description, we're good to go!&lt;br /&gt;
&lt;br /&gt;
==== Making the make.conf ====&lt;br /&gt;
Before we start merging into our tree everything under the sun, lets do some system planning.&lt;br /&gt;
&lt;br /&gt;
You can use this as a starting point:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# These settings were set by the metro build script that automatically built this stage.&lt;br /&gt;
# Please consult /etc/make.conf.example for a more detailed example.&lt;br /&gt;
&lt;br /&gt;
ACCEPT_KEYWORDS=&amp;quot;~amd64&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
CFLAGS=&amp;quot;-march=corei7 -O2 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;-march=corei7 -O2 -pipe&amp;quot;&lt;br /&gt;
SYNC=&amp;quot;git://github.com/funtoo/ports-2012.git&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # -j3 :: Have make use 3 threads by default.&lt;br /&gt;
MAKEOPTS=&amp;quot;-j3&amp;quot;&lt;br /&gt;
 #  Setup emerge's default options:&lt;br /&gt;
 #    --ask     :: Double check before merging.&lt;br /&gt;
 #    --verbose :: Show use flags etc.&lt;br /&gt;
 #    --quiet  :: Don't show me make spam.&lt;br /&gt;
 #    --tree    :: Use nice dependancy graphs.&lt;br /&gt;
EMERGE_DEFAULT_OPTS=&amp;quot;--ask --verbose --quiet --tree&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Portage Features&lt;br /&gt;
#    TODO: Descriptions&lt;br /&gt;
FEATURES=&amp;quot;mini-manifest parallel-fetch userfetch parallel-install sandbox fixpackages collision-protect&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 #  We might use binary packages later. Lets set that up just in case.&lt;br /&gt;
PORTAGE_BINHOST=/usr/portage/packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # CCache&lt;br /&gt;
 #   This is not going to be done by default.&lt;br /&gt;
 #   Why? It's only wortwhile if you plan on compiling packages multiple&lt;br /&gt;
 #   times per version, which the average user will not.&lt;br /&gt;
#CCACHE_SIZE=&amp;quot;5G&amp;quot;&lt;br /&gt;
#CCACHE_DIR=&amp;quot;/var/cache/ccache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Licenses&lt;br /&gt;
#   By default we're just going to accept everything.&lt;br /&gt;
ACCEPT_LICENSE=&amp;quot;*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Device Specific Settings&lt;br /&gt;
#    INPUT_DEVICES :: A list of input devices you'll be wanting. This is needed for xorg and not much else.&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
#    VIDEO CARDS   :: A list of video cards. Optimus users beware here.&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel i915 i965 nvidia&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Use flags.&lt;br /&gt;
#   Application specific flags should be migrated to /etc/portage/package.use (which can be a folder with multiple files!)&lt;br /&gt;
#   To look at the user flags for an application use &amp;quot;equery uses FOOPKG&amp;quot;&lt;br /&gt;
USE=&amp;quot;&lt;br /&gt;
acpi alsa /&lt;br /&gt;
bash-completition /&lt;br /&gt;
curl /&lt;br /&gt;
dvdr /&lt;br /&gt;
ithreads /&lt;br /&gt;
ncurses networkmanager/&lt;br /&gt;
policykit /&lt;br /&gt;
ssl sse sse2 sse3 sse4 /&lt;br /&gt;
threads /&lt;br /&gt;
udev /&lt;br /&gt;
vim-syntax /&lt;br /&gt;
zsh-completion /&lt;br /&gt;
&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting an Editor ====&lt;br /&gt;
Well, first things first lets get ourselves an editor. The author prefers vim, but you may like emacs or something else... Feel free to disregard this and explore! If you plan to have multiple users however, this will often be expected by experienced linux users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge vim&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Check that your USE flags look reasonable (see above) and feel free to do any fine tweaking in /etc/portage/package.use.&lt;br /&gt;
Consult your output after merge! You may want to follow some of it's advice.&lt;br /&gt;
&lt;br /&gt;
You can find multiple good guides on google for vim configurations and setups.&lt;br /&gt;
Funtoo also provides a very nice base configuration in /etc/vim/vimrc.&lt;br /&gt;
&lt;br /&gt;
==== Boot Parameters ====&lt;br /&gt;
The T420 has a number of boot parameters that can be set to conserve power. On a laptop these options are generally reasonable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat /etc/boot.conf&lt;br /&gt;
boot {&lt;br /&gt;
	generate grub&lt;br /&gt;
	default &amp;quot;Funtoo Linux&amp;quot; &lt;br /&gt;
	timeout 15 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Funtoo Linux&amp;quot; {&lt;br /&gt;
	kernel bzImage[-v]&lt;br /&gt;
	#   Force PCIE Active State Power Management on.&lt;br /&gt;
	params += pcie_aspm=force&lt;br /&gt;
	#   TODO (Range 1..15)&lt;br /&gt;
	params += epb=7&lt;br /&gt;
	#   TODO&lt;br /&gt;
	params += hpet=force&lt;br /&gt;
	#   i915 Enable rc6 sleep state (?)&lt;br /&gt;
	params += i915.i915_enable_rc6=1&lt;br /&gt;
	#   TODO (Framebuffer?)&lt;br /&gt;
	params += i915.i915_enable_fbc=1&lt;br /&gt;
	#   Downclock the lvds screen (60hz -&amp;gt; 50hz)&lt;br /&gt;
	params += i915.lvds_downclock=1&lt;br /&gt;
        #   Quiet some of the excessively verbose kernel boot&lt;br /&gt;
        params += quiet&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Windows 7&amp;quot; {&lt;br /&gt;
        type win7&lt;br /&gt;
        params root=/dev/sda1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#&amp;quot;Funtoo Linux genkernel&amp;quot; {&lt;br /&gt;
#	kernel kernel[-v]&lt;br /&gt;
#	initrd initramfs[-v]&lt;br /&gt;
#	params += real_root=auto &lt;br /&gt;
#} &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you're done, update grub with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Power Saving Local Scripts ====&lt;br /&gt;
Next we're going to set up a script that runs at default runlevel for the machine. This will echo several options to various dev files. Most distros would do this via /etc/rc.local or something of the like.&lt;br /&gt;
&lt;br /&gt;
With Funtoo (and Gentoo) this is accomplished via&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/local.d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Consult the README (in directory) for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat /etc/local.d/power-saving.start&lt;br /&gt;
# /bin/bash&lt;br /&gt;
#&lt;br /&gt;
echo 1 &amp;gt; /sys/modules/snd_hda_intel/parameters/power_save&lt;br /&gt;
for i in /sys/bus/usb/devices/*/power/autosuspend; do&lt;br /&gt;
    echo 1 &amp;gt; $i&lt;br /&gt;
done&lt;br /&gt;
for i in /sys/class/scsi_host/host*/link_power_management_policy; do&lt;br /&gt;
    echo min_power &amp;gt; $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you copy this wholesale remember to chmod -x the file!&lt;br /&gt;
&lt;br /&gt;
==== rc.conf ====&lt;br /&gt;
rc.conf lets us change some options to do with open RC.&lt;br /&gt;
&lt;br /&gt;
First, lets set rc_sys to it's default, this will suppress a warning message at boot.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc_sys=&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we can turn on rc_parallel to get a bit of speedup on boot.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc_parallel=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you get errors or problems with services on boot, try turning this off.&lt;br /&gt;
&lt;br /&gt;
== Making it Usable ==&lt;br /&gt;
Next we'll be setting up a normal user and installing the venerable Xorg.&lt;br /&gt;
&lt;br /&gt;
==== Mouse in framebuffer ====&lt;br /&gt;
Right now we should be looking at a framebuffer'd console. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/init.d/gpm start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
gpm is a daemon that allows us to use our mouse (trackpad/trackpoint) on console. Give it a try! If you want to keep it on across boots, add it to your init.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-update add gpm default&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Making a New User =====&lt;br /&gt;
Lets use superadduser to make the task ever so much easier (Though, it is already easy)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge superadduser&lt;br /&gt;
superadduser&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Walk through the prompts and set up your user how you choose.&lt;br /&gt;
&lt;br /&gt;
==== Sudo Make Me a Sandwich ====&lt;br /&gt;
Next lets merge in sudo, and set up our new user to be able to use sudo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge sudo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now edit the config with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
visudo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You'll probably want to uncomment out one of the two options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Uncomment to allow members of group wheel to execute any command&lt;br /&gt;
# %wheel ALL=(ALL) ALL&lt;br /&gt;
&lt;br /&gt;
## Same thing without a password&lt;br /&gt;
# %wheel ALL=(ALL) NOPASSWD: ALL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now just add your user to the 'wheel' group.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpasswd -a foouser wheel&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now re-login as your user, and you should be good to go!&lt;br /&gt;
&lt;br /&gt;
==== Tmux ====&lt;br /&gt;
Before we emerge xorg, lets get tmux working so we can easily scroll through output and look at USE flags etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge tmux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default config will suffice for now. You may find it beneficial to learn to use tmux ''properly'' sometime, but for now we'll hold hands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tmux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now we can scroll through output with CTRL+B [ and the up and down arrows.&lt;br /&gt;
&lt;br /&gt;
== Xorg ==&lt;br /&gt;
Xorg is a large topic in and on itself. We'll focus on getting a working xorg and a simple window manager.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# (in tmux)&lt;br /&gt;
sudo emerge xorg-server&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once again use CTRL+B [ to start scrolling (escape to exit) and look through your use flags, adding anything you might want.&lt;br /&gt;
&lt;br /&gt;
== A note on Gnome ==&lt;br /&gt;
Want to get rid of that awful lock screen on wake from suspend?&lt;br /&gt;
&amp;lt;pre&amp;gt;gsettings set org.gnome.desktop.lockdown disable-lock-screen 'true'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:HWLaptop]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Lenovo_Thinkpad_T420</id>
		<title>Lenovo Thinkpad T420</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Lenovo_Thinkpad_T420"/>
				<updated>2012-11-18T20:27:33Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Throughout, this article will assume the following:&lt;br /&gt;
* You have installed Gentoo or Funtoo in the past.&lt;br /&gt;
** If you haven't, this article will still serve you well, but please have either the official funtoo, or gentoo install guides open. We move through non-machine-specific bits with little elaboration.&lt;br /&gt;
* Have a T420 or similar machine.&lt;br /&gt;
&lt;br /&gt;
Even if you do not have a T420, you may find this guide useful for:&lt;br /&gt;
* Nvidia Optimus Cards.&lt;br /&gt;
* Power management.&lt;br /&gt;
* General setup.&lt;br /&gt;
&lt;br /&gt;
This installation assumes (For now) that the install is starting from an MS-Windows installation. If you are not on Windows, please add your favourite choice of steps, keep the emphasis on ease of understanding.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
You'll want to get yourself running off a LiveCD or LiveUSB to start. This guide will assume liveUSB, since some users find them more difficult to prepare, this is usually due to boot flag issues. &lt;br /&gt;
(Note: ''Live USB restore drives are nice to have in general! The author keeps one in his college binder.'')&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
We can use LiLi for this, it provides a nice, simple interface and is fairly reliable: [http://www.linuxliveusb.com/en/download LiLi Download]&lt;br /&gt;
&lt;br /&gt;
=== SysrescueCD ===&lt;br /&gt;
Grab the version that Suites your needs here: [http://www.sysresccd.org/Download Sysrescue Download]&lt;br /&gt;
Next use LiLi (Or whatever you happen to be using) to flash the image or burn your CD. Reboot, change your boot device, and you'll find yourself at a grub menu.&lt;br /&gt;
&lt;br /&gt;
Since the T series are all 64-bit laptops, make sure to boot the 64-bit kernel, as the default is 32-bit.&lt;br /&gt;
&lt;br /&gt;
''But Why?: If we pick 32-bit, later on we won't be able to chroot into our Funtoo's 64-bit stage 3.''&lt;br /&gt;
&lt;br /&gt;
You should see a fairly verbose boot as sysrescueCD scans for modules it requires and starts up. It is safe to simply accept prompt defaults here, unless they are errors.&lt;br /&gt;
&lt;br /&gt;
When you are greeted by the interactive command prompt, enter 'wizard' as prompted, and accept the default entry in the dialogue. This will give us a functioning XFCE desktop environment.&lt;br /&gt;
&lt;br /&gt;
== Partitioning ==&lt;br /&gt;
Partitioning is the only step of this install which provides real risk to data on other operating systems. Be extremely careful if there is something you do not wish to loose. These steps are not foolproof and may result in lost data.&lt;br /&gt;
&lt;br /&gt;
Please be aware that MBR disks only support '''4''' primary partitions. You can solve this by creating an 'extended' partition and adding logical partitions to it. If you are feeling particularly brave try GPT on your disk.&lt;br /&gt;
&lt;br /&gt;
So lets start:&lt;br /&gt;
First open up gparted. You should see it on the taskbar if you're using systemrescueCD. It will scan available drives and show you the partition table. Most users will likely find one of the following to their liking:&lt;br /&gt;
&lt;br /&gt;
==== Pure Funtoo ====&lt;br /&gt;
You'll likely want:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/boot       :: EXT2       :: 100mb-500mb&lt;br /&gt;
    ''Note: We choose EXT2 because there is really no good use for a journalled boot partition, but feel free to use EXT4 instead!''&lt;br /&gt;
/           :: EXT4       :: 60gb (suggested floor value) - 500+&lt;br /&gt;
swap        :: linux-swap :: Your RAM Value (Optional, allows for hibernation)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You may wish for a separate /home, which is perfectly legitimate, or any number of other partitions. &lt;br /&gt;
&lt;br /&gt;
==== Dual Boot with Windows ====&lt;br /&gt;
If dual booting with Windows, it is advisable to have Windows installed '''first''' since it will muck with the MBR and possibly want to create it's own boot partition.&lt;br /&gt;
You'll likely want:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
System Reserved    :: NTFS      :: Whatever windows chooses.&lt;br /&gt;
Windows            :: NTFS      :: &amp;gt;100gb (If you plan on doing any serious work on windows)&lt;br /&gt;
/boot              :: EXT2      :: 100mb-500mb&lt;br /&gt;
Extended Partition -&lt;br /&gt;
  /                :: EXT4      :: Whatever is left.&lt;br /&gt;
  swap             :: linux-swap:: Your RAM value. (Optional, allows for hibernation)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You may also want a separate /home, etc. These will fit into your extended partition without contributing to MBR's 4 partition limit.&lt;br /&gt;
&lt;br /&gt;
== Starting the  (actual) Install ==&lt;br /&gt;
Up until now everything we've done has just been foreplay. Finally we can mount our partitions and get started on the installation!&lt;br /&gt;
&lt;br /&gt;
==== Mounting ====&lt;br /&gt;
First, lets mount all of our partitions.&lt;br /&gt;
* Make a directory for root. Lets assume '''/mnt/funtoo'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /mnt/funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mount your '/' partition to /mnt/funtoo&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount /dev/sd## /mnt/funtoo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Make a directory for your boot partition.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /mnt/funtoo/boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mount your boot partition.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mount /dev/sd## /mnt/funtoo/boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mount anything else you may have made and need. (Not swap)&lt;br /&gt;
&lt;br /&gt;
==== Checking the Date ====&lt;br /&gt;
Although this may seem super un-important, if you want to avoid lots of spammy warning messages later, checking your date is beneficial.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
date&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it needs to be set, you'll want something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
date 071620002011&lt;br /&gt;
#Fri Jul 16 20:00:00 UTC 2011&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Fetch a Stage 3 ====&lt;br /&gt;
Next we need to fetch a tarball containing a barebones stage. We will download the core-i7 architecture version, if you have a core i5 or i3, don't worry, it's all the same.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /mnt/funtoo&lt;br /&gt;
wget http://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-64bit/corei7/stage3-current.tar.xz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next lets unpack with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar xJpf stage3-current.tar.xz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''Seriously, don't forget the 'p' option.''&lt;br /&gt;
&lt;br /&gt;
If you run 'ls' now, you should see the /mnt/funtoo is fully populated with folders such as lib, home, and proc.&lt;br /&gt;
&lt;br /&gt;
==== Chroot'ing ====&lt;br /&gt;
Now we need to change the ''apparent root'' of our system to our fledgling Funtoo system.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /mnt/funtoo&lt;br /&gt;
mount --bind /proc ./proc&lt;br /&gt;
mount --bind /dev ./dev&lt;br /&gt;
cp /etc/resolv.conf ./etc&lt;br /&gt;
env -i HOME=/root TERM=$TERM chroot /mnt/funtoo /bin/bash --login&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting the Portage Tree ====&lt;br /&gt;
Funtoo (Unlike Gentoo) uses a git based portage tree, however if you're coming from Gentoo, you'll be glad to know we sync with the Gentoo tree once every 12 hours.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge --sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''You can ignore most of the errors that might be spat out at this stage, however if they do not disappear on subsequent merges, talk to us in #funtoo.''&lt;br /&gt;
Your first sync will take significantly longer then subsequent syncs, as the whole tree must be synced.&lt;br /&gt;
&lt;br /&gt;
==== A Configuration Celebration ====&lt;br /&gt;
Now that we have our portage tree cloned, we need to do some initial setup on some files before doing anything else with portage.&lt;br /&gt;
&lt;br /&gt;
'''Fstab'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /etc/fstab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll want something like this: (Replace the dev values with what you are using)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;fs&amp;gt;			&amp;lt;mountpoint&amp;gt;	&amp;lt;type&amp;gt;		&amp;lt;opts&amp;gt;		         &amp;lt;dump/pass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/dev/sda1		/boot		ext2		noauto,noatime  	 1 2&lt;br /&gt;
/dev/sda3		none		swap		sw		         0 0&lt;br /&gt;
/dev/sda4		/		ext4		noatime		         0 1&lt;br /&gt;
/dev/cdrom		/mnt/cdrom	auto		noauto,ro	         0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Localtime'''&lt;br /&gt;
&lt;br /&gt;
Lets remove the default localtime, and create a symbolic link to the proper time zone. (You probably will want something other then Vancouver)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /etc/localtime&lt;br /&gt;
ln -s /usr/share/zoneinfo/America/Vancouver /etc/localtime&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Hostname '''&lt;br /&gt;
Set your host name: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /etc/conf.d/hostname&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''hwclock'''&lt;br /&gt;
&lt;br /&gt;
If you're using a dual boot system, you'll want to change this. Otherwise it's entirely optional.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /etc/conf.d/hwclock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you're on windows you'll want:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clock=&amp;quot;local&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Make.conf'''&lt;br /&gt;
Important enough that it deserves it's own article. A template make.conf for the T420 will be forthcoming.&lt;br /&gt;
&lt;br /&gt;
For now:&lt;br /&gt;
If you have an i5 or i3 you will want&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you have an i7 you'll probably want&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAKEOPTS=&amp;quot;-j5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''But I have Hyperthreading! Why only -j3?''&lt;br /&gt;
Hyperthreading and compiling don't play well together. You'll have the same (or better) performance with -j3 as -j5 with a dual core hyper threaded processor.&lt;br /&gt;
&lt;br /&gt;
== Stop, Kernel time! ==&lt;br /&gt;
''For this guide we'll be using some pre-found config options that I will be adding later.''&lt;br /&gt;
&lt;br /&gt;
* Networking:&lt;br /&gt;
** iwlwifi and auxilary&lt;br /&gt;
** Unknown intel ethernet adapter. Selected several.&lt;br /&gt;
* GPU&lt;br /&gt;
** Intel available default.&lt;br /&gt;
** nvidia will be dealt with later&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
* wpa_supplicant&lt;br /&gt;
* iwl6000-ucode&lt;br /&gt;
* wireless-tools&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Bootloader Setup ==&lt;br /&gt;
In funtoo the setup of grub is extremely simplified.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge -vqat boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''Q: What are those options? A: We'll get to them later, lets get the system booted first, okay? ''&lt;br /&gt;
Boot-update is a tool that will allow for very simple configuration of grub similar to older versions (But nicer still). &lt;br /&gt;
&lt;br /&gt;
You will now find a file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat /etc/boot.conf&lt;br /&gt;
boot {&lt;br /&gt;
        generate grub&lt;br /&gt;
        default &amp;quot;Funtoo Linux genkernel&amp;quot;&lt;br /&gt;
        timeout 3 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Funtoo Linux&amp;quot; {&lt;br /&gt;
        kernel bzImage[-v]&lt;br /&gt;
        # params += nomodeset&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Funtoo Linux genkernel&amp;quot; {&lt;br /&gt;
        kernel kernel[-v]&lt;br /&gt;
        initrd initramfs[-v]&lt;br /&gt;
        params += real_root=auto &lt;br /&gt;
        # params += nomodeset&lt;br /&gt;
} &lt;br /&gt;
This can be configured (We'll touch on this later. We need to make sure the kernel is booting and working before we start tweaking) with options for the kernel.&lt;br /&gt;
&lt;br /&gt;
==== Dual-Booters Only ====&lt;br /&gt;
If you want to dual boot with windows you'll need to add an entry here:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Windows 7&amp;quot; {&lt;br /&gt;
    type win7&lt;br /&gt;
    params root=/dev/sda1&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Installing Grub onto the Drive(Everyone) ====&lt;br /&gt;
Next we can install grub onto the drive.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
grub-install --no-floppy /dev/sda&lt;br /&gt;
boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
No errors means we should be good to go!&lt;br /&gt;
&lt;br /&gt;
== Tidy up and go. ==&lt;br /&gt;
Just a few more things!&lt;br /&gt;
&lt;br /&gt;
Lets set a root password.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
passwd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is advisable to exit the chroot and umount all the relevant install drives. Or at least just exit the chroot, but you can just simply reboot from here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
cd /&lt;br /&gt;
umount /mnt/funtoo/boot /mnt/funtoo/dev /mnt/funtoo/proc /mnt/funtoo&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring the New System ==&lt;br /&gt;
Welcome to funtoo! You should be greeted by a bunch of spammy text that scrolls by reasonably fast and then a couple penguins and openrc. Login to your root user and lets start playing.&lt;br /&gt;
&lt;br /&gt;
A note, this part of the guide is meant to be much more of a dialogue between us.&lt;br /&gt;
&lt;br /&gt;
==== Getting up the (wired) network ====&lt;br /&gt;
If you're gifted with a wired network connect, use it! The initial setup is much more convenient and quick.&lt;br /&gt;
&lt;br /&gt;
Quickly set up the network with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/init.d/dhcpcd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now check to see if our wired adapter is listed with ifconfig.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
#  (or)&lt;br /&gt;
ping google.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you see it listed with a description, we're good to go!&lt;br /&gt;
&lt;br /&gt;
==== Making the make.conf ====&lt;br /&gt;
Before we start merging into our tree everything under the sun, lets do some system planning.&lt;br /&gt;
&lt;br /&gt;
You can use this as a starting point:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# These settings were set by the metro build script that automatically built this stage.&lt;br /&gt;
# Please consult /etc/make.conf.example for a more detailed example.&lt;br /&gt;
&lt;br /&gt;
ACCEPT_KEYWORDS=&amp;quot;~amd64&amp;quot;&lt;br /&gt;
CHOST=&amp;quot;x86_64-pc-linux-gnu&amp;quot;&lt;br /&gt;
CFLAGS=&amp;quot;-march=corei7 -O2 -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;-march=corei7 -O2 -pipe&amp;quot;&lt;br /&gt;
SYNC=&amp;quot;git://github.com/funtoo/ports-2012.git&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # -j3 :: Have make use 3 threads by default.&lt;br /&gt;
MAKEOPTS=&amp;quot;-j3&amp;quot;&lt;br /&gt;
 #  Setup emerge's default options:&lt;br /&gt;
 #    --ask     :: Double check before merging.&lt;br /&gt;
 #    --verbose :: Show use flags etc.&lt;br /&gt;
 #    --quiet  :: Don't show me make spam.&lt;br /&gt;
 #    --tree    :: Use nice dependancy graphs.&lt;br /&gt;
EMERGE_DEFAULT_OPTS=&amp;quot;--ask --verbose --quiet --tree&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Portage Features&lt;br /&gt;
#    TODO: Descriptions&lt;br /&gt;
FEATURES=&amp;quot;mini-manifest parallel-fetch userfetch parallel-install sandbox fixpackages collision-protect&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 #  We might use binary packages later. Lets set that up just in case.&lt;br /&gt;
PORTAGE_BINHOST=/usr/portage/packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # CCache&lt;br /&gt;
 #   This is not going to be done by default.&lt;br /&gt;
 #   Why? It's only wortwhile if you plan on compiling packages multiple&lt;br /&gt;
 #   times per version, which the average user will not.&lt;br /&gt;
#CCACHE_SIZE=&amp;quot;5G&amp;quot;&lt;br /&gt;
#CCACHE_DIR=&amp;quot;/var/cache/ccache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Licenses&lt;br /&gt;
#   By default we're just going to accept everything.&lt;br /&gt;
ACCEPT_LICENSE=&amp;quot;*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Device Specific Settings&lt;br /&gt;
#    INPUT_DEVICES :: A list of input devices you'll be wanting. This is needed for xorg and not much else.&lt;br /&gt;
INPUT_DEVICES=&amp;quot;evdev synaptics&amp;quot;&lt;br /&gt;
#    VIDEO CARDS   :: A list of video cards. Optimus users beware here.&lt;br /&gt;
VIDEO_CARDS=&amp;quot;intel i915 i965 nvidia&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Use flags.&lt;br /&gt;
#   Application specific flags should be migrated to /etc/portage/package.use (which can be a folder with multiple files!)&lt;br /&gt;
#   To look at the user flags for an application use &amp;quot;equery uses FOOPKG&amp;quot;&lt;br /&gt;
USE=&amp;quot;&lt;br /&gt;
acpi alsa /&lt;br /&gt;
bash-completition /&lt;br /&gt;
curl /&lt;br /&gt;
dvdr /&lt;br /&gt;
ithreads /&lt;br /&gt;
ncurses networkmanager/&lt;br /&gt;
policykit /&lt;br /&gt;
ssl sse sse2 sse3 sse4 /&lt;br /&gt;
threads /&lt;br /&gt;
udev /&lt;br /&gt;
vim-syntax /&lt;br /&gt;
zsh-completion /&lt;br /&gt;
&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting an Editor ====&lt;br /&gt;
Well, first things first lets get ourselves an editor. The author prefers vim, but you may like emacs or something else... Feel free to disregard this and explore! If you plan to have multiple users however, this will often be expected by experienced linux users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge vim&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Check that your USE flags look reasonable (see above) and feel free to do any fine tweaking in /etc/portage/package.use.&lt;br /&gt;
Consult your output after merge! You may want to follow some of it's advice.&lt;br /&gt;
&lt;br /&gt;
You can find multiple good guides on google for vim configurations and setups.&lt;br /&gt;
Funtoo also provides a very nice base configuration in /etc/vim/vimrc.&lt;br /&gt;
&lt;br /&gt;
==== Boot Parameters ====&lt;br /&gt;
The T420 has a number of boot parameters that can be set to conserve power. On a laptop these options are generally reasonable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat /etc/boot.conf&lt;br /&gt;
boot {&lt;br /&gt;
	generate grub&lt;br /&gt;
	default &amp;quot;Funtoo Linux&amp;quot; &lt;br /&gt;
	timeout 15 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Funtoo Linux&amp;quot; {&lt;br /&gt;
	kernel bzImage[-v]&lt;br /&gt;
	#   Force PCIE Active State Power Management on.&lt;br /&gt;
	params += pcie_aspm=force&lt;br /&gt;
	#   TODO (Range 1..15)&lt;br /&gt;
	params += epb=7&lt;br /&gt;
	#   TODO&lt;br /&gt;
	params += hpet=force&lt;br /&gt;
	#   i915 Enable rc6 sleep state (?)&lt;br /&gt;
	params += i915.i915_enable_rc6=1&lt;br /&gt;
	#   TODO (Framebuffer?)&lt;br /&gt;
	params += i915.i915_enable_fbc=1&lt;br /&gt;
	#   Downclock the lvds screen (60hz -&amp;gt; 50hz)&lt;br /&gt;
	params += i915.lvds_downclock=1&lt;br /&gt;
        #   Quiet some of the excessively verbose kernel boot&lt;br /&gt;
        params += quiet&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Windows 7&amp;quot; {&lt;br /&gt;
        type win7&lt;br /&gt;
        params root=/dev/sda1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#&amp;quot;Funtoo Linux genkernel&amp;quot; {&lt;br /&gt;
#	kernel kernel[-v]&lt;br /&gt;
#	initrd initramfs[-v]&lt;br /&gt;
#	params += real_root=auto &lt;br /&gt;
#} &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you're done, update grub with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
boot-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Power Saving Local Scripts ====&lt;br /&gt;
Next we're going to set up a script that runs at default runlevel for the machine. This will echo several options to various dev files. Most distros would do this via /etc/rc.local or something of the like.&lt;br /&gt;
&lt;br /&gt;
With Funtoo (and Gentoo) this is accomplished via&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/local.d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Consult the README (in directory) for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat /etc/local.d/power-saving.start&lt;br /&gt;
# /bin/bash&lt;br /&gt;
#&lt;br /&gt;
echo 1 &amp;gt; /sys/modules/snd_hda_intel/parameters/power_save&lt;br /&gt;
for i in /sys/bus/usb/devices/*/power/autosuspend; do&lt;br /&gt;
    echo 1 &amp;gt; $i&lt;br /&gt;
done&lt;br /&gt;
for i in /sys/class/scsi_host/host*/link_power_management_policy; do&lt;br /&gt;
    echo min_power &amp;gt; $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you copy this wholesale remember to chmod -x the file!&lt;br /&gt;
&lt;br /&gt;
==== rc.conf ====&lt;br /&gt;
rc.conf lets us change some options to do with open RC.&lt;br /&gt;
&lt;br /&gt;
First, lets set rc_sys to it's default, this will suppress a warning message at boot.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc_sys=&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we can turn on rc_parallel to get a bit of speedup on boot.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc_parallel=&amp;quot;YES&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you get errors or problems with services on boot, try turning this off.&lt;br /&gt;
&lt;br /&gt;
== Making it Usable ==&lt;br /&gt;
Next we'll be setting up a normal user and installing the venerable Xorg.&lt;br /&gt;
&lt;br /&gt;
==== Mouse in framebuffer ====&lt;br /&gt;
Right now we should be looking at a framebuffer'd console. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/init.d/gpm start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
gpm is a daemon that allows us to use our mouse (trackpad/trackpoint) on console. Give it a try! If you want to keep it on across boots, add it to your init.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-update add gpm default&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Making a New User =====&lt;br /&gt;
Lets use superadduser to make the task ever so much easier (Though, it is already easy)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge superadduser&lt;br /&gt;
superadduser&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Walk through the prompts and set up your user how you choose.&lt;br /&gt;
&lt;br /&gt;
==== Sudo Make Me a Sandwich ====&lt;br /&gt;
Next lets merge in sudo, and set up our new user to be able to use sudo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge sudo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now edit the config with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
visudo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You'll probably want to uncomment out one of the two options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Uncomment to allow members of group wheel to execute any command&lt;br /&gt;
# %wheel ALL=(ALL) ALL&lt;br /&gt;
&lt;br /&gt;
## Same thing without a password&lt;br /&gt;
# %wheel ALL=(ALL) NOPASSWD: ALL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now just add your user to the 'wheel' group.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpasswd -a foouser wheel&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now re-login as your user, and you should be good to go!&lt;br /&gt;
&lt;br /&gt;
==== Tmux ====&lt;br /&gt;
Before we emerge xorg, lets get tmux working so we can easily scroll through output and look at USE flags etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge tmux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The default config will suffice for now. You may find it beneficial to learn to use tmux ''properly'' sometime, but for now we'll hold hands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tmux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now we can scroll through output with CTRL+B [ and the up and down arrows.&lt;br /&gt;
&lt;br /&gt;
== Xorg ==&lt;br /&gt;
Xorg is a large topic in and on itself. We'll focus on getting a working xorg and a simple window manager.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# (in tmux)&lt;br /&gt;
sudo emerge xorg-server&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once again use CTRL+B [ to start scrolling (escape to exit) and look through your use flags, adding anything you might want.&lt;br /&gt;
&lt;br /&gt;
== A note on Gnome ==&lt;br /&gt;
Want to get rid of that awful lock screen on wake from suspend?&lt;br /&gt;
&amp;lt;pre&amp;gt;gsettings set org.gnome.desktop.lockdown disable-lock-screen 'true'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:HWLaptop]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Desktop-install</id>
		<title>Desktop-install</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Desktop-install"/>
				<updated>2012-11-18T20:26:04Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{delete}}&lt;br /&gt;
&lt;br /&gt;
Nothing to See here!  What you are looking for is the [[Funtoo_Linux_Installation]] or, for the brave adventurer, [[Installation_(Tutorial)]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Core_Team</id>
		<title>Core Team</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Core_Team"/>
				<updated>2012-11-18T20:25:23Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Your Staff ==&lt;br /&gt;
&lt;br /&gt;
Funtoo Linux Core Team members are Funtoo Linux developers who are actively contributing to technical aspects of Funtoo Linux, and are available for resolving bugs and other QA issues. Please see [[Core Team Responsibilities]] for general policies, [[Funtoo Linux Vision]] for an understanding of strategic direction, and [[TODO]] for immediate things that need to get done. &lt;br /&gt;
&lt;br /&gt;
=== Project Leadership ===&lt;br /&gt;
&lt;br /&gt;
;Benevolent Dictator for Life:  [[User:Drobbins|Daniel Robbins]] is the Chief Architect of Funtoo Linux, and so-called &amp;quot;Benevolent Dictator for Life.&amp;quot;&lt;br /&gt;
;Core Team Lead: [[User:Oleg|Oleg Vinichenko]] - ''angry_vincent'' is the senior member of the Funtoo Linux development team.&lt;br /&gt;
&lt;br /&gt;
=== Staff ===&lt;br /&gt;
&lt;br /&gt;
Funtoo Linux staff includes our Core Team of developers and participates in the continued operation and improvement of Funtoo Linux:&lt;br /&gt;
{{#ask: [[Category:People]] [[Role type::Staff]]&lt;br /&gt;
| ? Full name&lt;br /&gt;
 | ? Nick&lt;br /&gt;
 | ? Role desc&lt;br /&gt;
 | ? Start date&lt;br /&gt;
 | format=template&lt;br /&gt;
 | template=TeamList&lt;br /&gt;
 | link=none&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Staff and Contributor Map ===&lt;br /&gt;
&lt;br /&gt;
{{#compound_query:[[Category:People]] [[Role type::Staff]];?Geoloc;icon=Purplemarker.png&lt;br /&gt;
    |[[Category:People]][[Role type::Contributor]];?Geoloc;icon=Orangemarker.png&lt;br /&gt;
    |format=googlemap|height=500}}&lt;br /&gt;
&lt;br /&gt;
=== Where to Find Us ===&lt;br /&gt;
&lt;br /&gt;
The Funtoo team can often be found in the [ircs://irc.freenode.net:7000/funtoo|funtoo channel on Freenode]. The team also monitors the [http://forums.funtoo.org/ Funtoo Forum] and [https://groups.google.com/group/funtoo-dev/ mailing list].&lt;br /&gt;
&lt;br /&gt;
=== Contributors ===&lt;br /&gt;
&lt;br /&gt;
Contributors are active Funtoo Linux developers who have made significant contributions to Funtoo Linux, as well as former Core Team members who are currently inactive. Some contributors have overlays that are automatically incorporated into the Funtoo Linux [[Portage Tree]]. Others work on projects in their own repositories and make periodic contributions to Funtoo Linux.&lt;br /&gt;
{{#ask: [[Category:People]] [[Role type::Contributor]]&lt;br /&gt;
| ? Full name&lt;br /&gt;
 | ? Nick&lt;br /&gt;
 | ? Role desc&lt;br /&gt;
 | ? Start date&lt;br /&gt;
 | format=template&lt;br /&gt;
 | template=TeamList&lt;br /&gt;
 | link=none&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Former Contributors ===&lt;br /&gt;
&lt;br /&gt;
* [[User:Ferdy|Giuseppe Miceli]] - ''ferdy'' - new&lt;br /&gt;
* [[User:Apple|Daniel Cordero]] - ''TheAppleMan'' &lt;br /&gt;
* [[User:Brantgurga|Brant Gurganus]] - ''brantgurga''&lt;br /&gt;
* [[User:destroyFX|Mathieu Bélanger]] - ''destroyFX''&lt;br /&gt;
* [https://github.com/hollow Benedikt Böhm] = ''hollow'' - Metro contributor&lt;br /&gt;
* [[User:Tarsius|Jonas Bernoulli]] - ''tarsius'' &lt;br /&gt;
* [[User:Vroman|Víctor Román Archidona]] - ''vroman''&lt;br /&gt;
* [[User:Stagr.lee|Lee Thompson]] - ''Stagr.Lee'' - Vagrant/VeeWee hacking&lt;br /&gt;
* [[User:404_Error|Adrien Dessemond]] - ''404_Error'' - Funtoo SPARC (since epoch 1296959908)&lt;br /&gt;
&lt;br /&gt;
__NOTITLE__&lt;br /&gt;
&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:People</id>
		<title>Category:People</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:People"/>
				<updated>2012-11-18T20:24:56Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Has default form::Person|:Person]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Core_Team_Responsibilities</id>
		<title>Core Team Responsibilities</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Core_Team_Responsibilities"/>
				<updated>2012-11-18T20:24:40Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Seniority */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are responsibilities associated with being an active Funtoo Linux Core Team member. These responsibilities are detailed below.&lt;br /&gt;
&lt;br /&gt;
=== The Vision ===&lt;br /&gt;
&lt;br /&gt;
* '''The [[Funtoo Linux Vision]] defines our focus and direction.&lt;br /&gt;
&lt;br /&gt;
All Core Team members are expected to agree with and support the [[Funtoo Linux Vision]], and to actively participate in pursuing this vision every week.&lt;br /&gt;
&lt;br /&gt;
=== Metro ===&lt;br /&gt;
&lt;br /&gt;
* '''Reliable automated builds are a priority of the Funtoo Linux project.'''&lt;br /&gt;
&lt;br /&gt;
Active Funtoo Linux Core Team members must use Metro to regularly build Funtoo Linux stages. Every Core Team member must perform a full stage1/2/3 build at least once a week. This may be automated via cron job. Core Team members must be aware of any build failures that occur and communicate them to the rest of the team, and take steps to ensure they are resolved.&lt;br /&gt;
&lt;br /&gt;
=== Install Testing ===&lt;br /&gt;
&lt;br /&gt;
* '''A trouble-free installation experience is a priority of the Funtoo Linux project.'''&lt;br /&gt;
* '''The initial end-user experience is important.'''&lt;br /&gt;
&lt;br /&gt;
Active Funtoo Linux Core Team members must perform a fresh install of Funtoo Linux from current stage3 at least once per calendar month. This install may be in a virtual machine, or to replace an existing install. During this install process, any bugs or anomalies must be documented on the [[Usability Testing]] page, reported to the rest of the team, and steps should be taken by the developer to address any problems found.&lt;br /&gt;
&lt;br /&gt;
The Core Team Lead may assign &amp;quot;install weeks&amp;quot; to particular developers to ensure that Funtoo Linux installation is tested as frequently as possible.&lt;br /&gt;
&lt;br /&gt;
=== Team Size ===&lt;br /&gt;
&lt;br /&gt;
Currently, the Core Team is defined to be ''five'' people in size.&lt;br /&gt;
&lt;br /&gt;
=== Availability ===&lt;br /&gt;
&lt;br /&gt;
* '''Excellent user support and timely resolution of problems is a priority of the Funtoo Linux project.'''&lt;br /&gt;
* '''Core Team members are there to keep Funtoo Linux working well for its users.'''&lt;br /&gt;
&lt;br /&gt;
A Funtoo Core Team member maintains &amp;quot;active&amp;quot; status by being available for consecutive week-long periods to perform active development, fix bugs and participate in the #funtoo development channel, forums or funtoo-dev mailing list. A developer does not need to be available on a particular day, but must be available and active for at least 4 days per week, and should be able to perform at least 1 hour of active, focused development per day. &lt;br /&gt;
&lt;br /&gt;
If you do not think that you can commit to this level of involvement, you should become a [[Core Team#Contributor|Funtoo Linux Contributor]] instead. Core Team members bear the primary responsibility for being available to resolve QA issues in a timely manner and move various key distribution initiatives forward, so our contribution and availability requirements for Core Team members are quite stringent.&lt;br /&gt;
&lt;br /&gt;
==== Absences ====&lt;br /&gt;
&lt;br /&gt;
Week-long absences are permitted as long as they are announced in advance to &amp;lt;tt&amp;gt;staff@funtoo.org&amp;lt;/tt&amp;gt; so that adequate Core Team coverage for any particular week can be assured. Any absence longer than a week (7 days) in duration should be announced in advance as well, but will result in the developer moving from the role of active Core Team member to a Contributor position in their absence. &lt;br /&gt;
&lt;br /&gt;
==== Reinstatements ====&lt;br /&gt;
&lt;br /&gt;
Core Team members that are unavailable and move to a Contributor role due to their absence may be reinstated as members of the Core Team when they are available to return to active duty, at the discretion of the Development Lead. However, there will be a limited number of &amp;quot;seats&amp;quot; available on the Core Team, and empty positions may be filled. &lt;br /&gt;
&lt;br /&gt;
The Core Team Lead may decide to expand the size of the Core Team, but this is not a requirement.&lt;br /&gt;
&lt;br /&gt;
This policy exists to provide an incentive for Core Team members to remain continually active on the project. This policy is also designed to accommodate certain realities of Free Software projects: often, we have a contributor who is active for several months and makes many valuable contributions to Funtoo Linux, but then they become inactive. &lt;br /&gt;
&lt;br /&gt;
If we keep this person as a Core Team member indefinitely, it has the potential of negatively impacting the quality of Funtoo Linux and preventing others who ''are'' available from actively contributing to Funtoo Linux. This policy helps Funtoo Linux adapt to the realities of volunteer contribution.&lt;br /&gt;
&lt;br /&gt;
==== Seniority ====&lt;br /&gt;
&lt;br /&gt;
These policies define the standard policies that apply to all Core Team members. However, those who have a consistent track record of contribution to the Core Team and have made a significant investment in the quality and capabilities of Funtoo Linux may be afforded exceptions to some of these policies.&lt;br /&gt;
&lt;br /&gt;
For example, long-term Core Team members may be able to take more extended periods of absence and still retain their original position when they return. The intention of these seniority exceptions is to provide some benefit and security to those who have made a significant contribution to the project, and also provide a goal for newer Core Team members to aspire to. We want to reward those who have been there for us.&lt;br /&gt;
&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Community</id>
		<title>Category:Community</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Community"/>
				<updated>2012-11-18T20:24:29Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: Created page with &amp;quot;Category:Funtoo&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Funtoo]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Core_Team_Lead</id>
		<title>Core Team Lead</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Core_Team_Lead"/>
				<updated>2012-11-18T20:24:14Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Core Team Lead (effectively the day-to-day leader of the project) is now a rotating position, with 3-month to 6-month terms, and all Core Team members are expected to serve in this capacity at some point (dates are flexible.) The acting Core Team Lead will have the opportunity and responsibility to provide leadership for the project, and help the project pursue initiatives that he/she finds personally interesting or is passionate about and are in line with the general goals of the project. &lt;br /&gt;
&lt;br /&gt;
The Core Team Lead will also coordinate closely with Daniel Robbins regarding project direction and BDFL initiatives, and keep in close communication with the rest of the Core Team. The other Core Team members are responsible to assist the Core Team Lead in pursuing these initiatives, just as the Core Team Lead is responsible to support Core Team members in their day-to-day development and support activities. The Core Team Lead will also be engaged with end users and be responsible for leading the effort in fixing build breaks and other critical bugs, along with Daniel Robbins and with the support of the Core Team. ''A key aspect of the Core Team Lead position is to ensure that coordination, communication and execution of important tasks are happening in an effective way, throughout the entire Funtoo Community (Users, Contributors, Core Team and BDFL.)''&lt;br /&gt;
&lt;br /&gt;
The Core Team Lead position is designed to share the opportunity and responsibility of running the project fairly, among all team members, and it is a great opportunity for Core Team members to grow in their skills and abilities.&lt;br /&gt;
&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Clang</id>
		<title>Clang</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Clang"/>
				<updated>2012-11-18T20:21:10Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: /* Using clang with distcc */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
LLVM can be used as an alternative to GNU's compiler, GCC. The main benefit of using LLVM compilers instead of GCC is their lower memory usage, faster compile time and better diagnostics. There are some Benchmarks on the [http://clang.llvm.org/features.html#performance Clang] and [http://www.phoronix.com/scan.php?page=article&amp;amp;item=llvm3_gcc_open64 Phoronix] homepages.&lt;br /&gt;
&lt;br /&gt;
It may happen that some programs do not compile (like glibc) because they depend on GCC-specific language extensions [http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html] (this is why the whole BSD code can be compiled with LLVM but some GNU code cannot) or segfault after successful compilation with LLVM (like xorg-server) but after following this guide, the system will still be able to compile packages with gcc. So if something goes wrong, it can be switched back to gcc for the particular package by uncommenting lines in /etc/make.conf and the bug should be reported.&lt;br /&gt;
&lt;br /&gt;
LLVM's C/C++ frontends clang and clang++ version 3.0 are stable enough to be self-hosting [http://blog.llvm.org/2010/02/clang-successfully-self-hosts.html] and compile Boost [http://blog.llvm.org/2010/05/clang-builds-boost.html], Qt [http://labs.qt.nokia.com/2010/10/29/compiling-qt-with-clang/], LibreOffice [http://wiki.documentfoundation.org/Development/Building_LibreOffice_with_Clang], FreeBSD [http://wiki.freebsd.org/BuildingFreeBSDWithClang], some parts of the Linux kernel [http://lwn.net/Articles/411654/] and more.&lt;br /&gt;
&lt;br /&gt;
Further, using LLVM 3.0 and up, there is a third way to compile with LLVM: the dragonegg package creates a gcc-plugin, that uses LLVM's optimizers but parses the code and creates binaries with gcc, which means that everything that compiles and works with gcc should work with dragonegg also. This plugin can be enabled by using a single CFLAG. Since LLVM 3.0 the old llvm-gcc package is deprecated and replaced by dragonegg, so it will disappear from portage with llvm version 2.9.&lt;br /&gt;
&lt;br /&gt;
==LLVM Frontends==&lt;br /&gt;
To be able to compile some sourcecode of a specific language, LLVM needs an appropriate frontend. There are clang, llvm-gcc and dragonegg in portage.&lt;br /&gt;
&lt;br /&gt;
The goal of the Clang project is to create a new C, C++, Objective C and Objective C++ front-end for the LLVM compiler.&lt;br /&gt;
&lt;br /&gt;
llvm-gcc is a modified version of gcc that compiles C/ObjC programs into native objects, LLVM bitcode or LLVM assembly language, depending upon the options. As written in the previous section, dragonegg replaced llvm-gcc in version 3.0.&lt;br /&gt;
&lt;br /&gt;
So after installing llvm, clang and dragonegg, you will be able to choose between gcc and llvm whenever you like or use them both at the same time.&lt;br /&gt;
&lt;br /&gt;
== Install LLVM and it's Frontends ==&lt;br /&gt;
Simply emerge the packages on ~arch systems. On arch systems you have to unmask some packages first. dragonegg requires gcc's ''lto'' USE-flag to be set and works with gcc 4.5 and gcc 4.6.&lt;br /&gt;
&lt;br /&gt;
{{Root|emerge llvm clang dragonegg}}&lt;br /&gt;
&lt;br /&gt;
Note, that for clang++ the C++ headers search path is hardcoded to the active gcc profile.&lt;br /&gt;
If you change the active gcc profile, or update gcc to a new version, you will have to remerge clang to update the search path.&lt;br /&gt;
&lt;br /&gt;
To use dragonegg, run gcc as usual, with an extra command line argument &amp;quot;-fplugin=/usr/lib/llvm/dragonegg.so&amp;quot;&lt;br /&gt;
If you change the active gcc profile, or update gcc to a new version, you will have to remerge dragonegg to update the plugin.&lt;br /&gt;
&lt;br /&gt;
After the installation, check which CPUs are supported by using the command&lt;br /&gt;
&amp;lt;pre&amp;gt;llvm-as &amp;lt; /dev/null | llc -mcpu=help&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then add the following lines to /etc/make.conf (uncommenting the lines you need) to enable compilation via LLVM, adapting the march-option according to the previous command:&lt;br /&gt;
&lt;br /&gt;
in /etc/make.conf :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# LLVM&lt;br /&gt;
#CC=&amp;quot;/usr/bin/clang&amp;quot;&lt;br /&gt;
#CXX=&amp;quot;/usr/bin/clang++&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# llvm-gcc for C++ code and fortran&lt;br /&gt;
# llvm-gcc is deprecated and only used with LLVM 2.9&lt;br /&gt;
#CC=&amp;quot;/usr/bin/llvm-gcc&amp;quot;&lt;br /&gt;
#CXX=&amp;quot;/usr/bin/llvm-g++&amp;quot;&lt;br /&gt;
#CPP=&amp;quot;/usr/bin/llvm-cpp&amp;quot;&lt;br /&gt;
#F77=&amp;quot;/usr/bin/llvm-gfortran&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Flags for clang: Insert your arch here instead of k8 and have a look at the manpage of clang for flag descriptions.&lt;br /&gt;
# Some gcc flags like -pipe and -pthread also work, though they might be ignored by clang.&lt;br /&gt;
#CFLAGS=&amp;quot;-march=k8 -O2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Flags for dragonegg; just use all the gcc flags you like and append -fplugin=/path/to/dragonegg.so&lt;br /&gt;
#CFLAGS=&amp;quot;-march=k8 -O2 -fplugin=/usr/lib64/llvm/dragonegg.so&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Have a look at clang's manpages for additional information. If you get errors that your compiler cannot produce code, you should check your flags, e.g. don't use -O4 -flto -S or stuff like that; the examples above will work.&lt;br /&gt;
&lt;br /&gt;
== Using clang with portage ==&lt;br /&gt;
&lt;br /&gt;
Although Gentoo package tree is not designed to be used with compiler other than GCC, clang can be enforced on most of the packages through ''CC'' and ''CXX'' variables.&lt;br /&gt;
&lt;br /&gt;
Please note, however, that many of Gentoo packages still don't build with clang and a few don't work correctly after being built. That's why we suggest using ''/etc/portage/env'' file to enable the use of clang per-package.&lt;br /&gt;
&lt;br /&gt;
In order to do that, first create a new environment override to use:&lt;br /&gt;
&lt;br /&gt;
in /etc/portage/env/clang :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CC=clang&lt;br /&gt;
CXX=clang++&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can enable use of clang for packages using ''[[:/etc/portage/env|/etc/portage/package.env]]'' file:&lt;br /&gt;
&lt;br /&gt;
in /etc/portage/package.env &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app-foo/bar clang&lt;br /&gt;
app-bar/baz clang&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use clang by default you can and need specify some core packages. Here is small list of core packages that currently failing on clang, but not that could be outdated:&lt;br /&gt;
&lt;br /&gt;
You need to add /etc/portage/env/gcc :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CC=gcc&lt;br /&gt;
CXX=g++&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if addition I recommend to add compiler flags there&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CFLAGS=&amp;quot;-O2 -march=native -mtune=native -pipe&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;-O2 -march=native -mtune=native -pipe&amp;quot;&lt;br /&gt;
LDFLAGS=&amp;quot;-Wl,--as-needed&amp;quot;&lt;br /&gt;
#You can disable gold link here&lt;br /&gt;
#EXTRA_ECONF=&amp;quot;--enable-gold=default&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And in /etc/portage/package.env &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#---------------CORE PACKAGES TO BUILD WITH GCC:&lt;br /&gt;
sys-apps/which gcc&lt;br /&gt;
sys-fs/reiserfsprogs gcc&lt;br /&gt;
sys-libs/ncurses gcc&lt;br /&gt;
sys-libs/zlib gcc&lt;br /&gt;
sys-apps/busybox gcc&lt;br /&gt;
sys-fs/e2fsprogs gcc&lt;br /&gt;
sys-devel/binutils gcc&lt;br /&gt;
sys-libs/glibc gcc&lt;br /&gt;
sys-devel/dragonegg gcc&lt;br /&gt;
dev-libs/openssl gcc&lt;br /&gt;
sys-boot/grub gcc&lt;br /&gt;
#---------------USER PACKAGES TO BUILD WITH GCC:&lt;br /&gt;
sys-apps/pacman gcc&lt;br /&gt;
www-client/firefox gcc&lt;br /&gt;
x11-libs/cairo gcc&lt;br /&gt;
media-libs/mesa gcc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have app-portage/flaggie installed, the ''/etc/portage/package.env'' file could be modified using:&lt;br /&gt;
&lt;br /&gt;
{{Root|flaggie app-foo/bar app-bar/baz +clang}}&lt;br /&gt;
&lt;br /&gt;
== Enabling link-time optimizations ==&lt;br /&gt;
&lt;br /&gt;
The ''link-time optimization'' feature defers optimizing the resulting executables to linking phase. This can result in better optimization of packages but is unsupported in Gentoo yet, and many packages simply fail to build.&lt;br /&gt;
&lt;br /&gt;
When using LTO, clang compiles units into LLVM byte-code rather than machine code. In order to support linking such object files, the [[gold]] linker must be installed and set as the default linker, as it does support plugins.&lt;br /&gt;
&lt;br /&gt;
Similarly, ''ar'' needs plugin support as well. Sadly, binutils ar doesn't support passing '--plugin'' option before the actual command. Thus, we need to create a wrapper for it:&lt;br /&gt;
&lt;br /&gt;
in /usr/local/bin/clang-ar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
firstarg=${1}&lt;br /&gt;
shift&lt;br /&gt;
&lt;br /&gt;
exec /usr/bin/ar &amp;quot;${firstarg}&amp;quot; --plugin /usr/lib/llvm/LLVMgold.so &amp;quot;${@}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that's done, you can create a new environment override profile for LTO-enabled clang:&lt;br /&gt;
&lt;br /&gt;
in /etc/portage/env/clang-lt: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CC='clang'&lt;br /&gt;
CXX='clang++'&lt;br /&gt;
CFLAGS=&amp;quot;${CFLAGS} -O4&amp;quot;&lt;br /&gt;
CXXFLAGS=&amp;quot;${CXXFLAGS} -O4&amp;quot;&lt;br /&gt;
LDFLAGS=&amp;quot;${LDFLAGS} -O4 -Wl,-plugin,/usr/lib/llvm/LLVMgold.so&amp;quot;&lt;br /&gt;
AR='/usr/local/bin/clang-ar'&lt;br /&gt;
RANLIB=':'&lt;br /&gt;
NM='nm --plugin /usr/lib64/llvm/LLVMgold.so'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the link-time optimizations were indirectly enabled here via ''-O4''. If you don't want to enable other optimizations enforced by ''-O3'', please use ''-flto'' instead. You need to also pass optimization flags when linking because that's where clang needs them.&lt;br /&gt;
&lt;br /&gt;
You may also need to adjust the libdir path to plugin. Newer (live) versions of clang add `-plugin` when linking automatically, so `-Wl,-plugin`… is no longer necessary.&lt;br /&gt;
&lt;br /&gt;
== Using clang with distcc ==&lt;br /&gt;
&lt;br /&gt;
In order to use clang on distcc client, additional symlinks have to be created in ''/usr/lib*/distcc/bin'':&lt;br /&gt;
&lt;br /&gt;
{{Root|ln -s /usr/bin/distcc /usr/lib/distcc/bin/clang&lt;br /&gt;
ln -s /usr/bin/distcc /usr/lib/distcc/bin/clang++}}&lt;br /&gt;
&lt;br /&gt;
{{GLW|src=http://en.gentoo-wiki.com/wiki/Llvm}}&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Choose_Funtoo</id>
		<title>Choose Funtoo</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Choose_Funtoo"/>
				<updated>2012-11-18T19:52:19Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Choose Funtoo! ==&lt;br /&gt;
&lt;br /&gt;
* Funtoo is a true source-based operating system that gives you the freedom to learn, change, and make it better.&lt;br /&gt;
&lt;br /&gt;
* Funtoo is led by Daniel Robbins who has proven himself to have the skills and qualifications to keep improving Funtoo.&lt;br /&gt;
&lt;br /&gt;
* Funtoo is a rolling release distribution which is essentially version-less once installed.&lt;br /&gt;
&lt;br /&gt;
* Since Funtoo is built locally from source it is optimized for your machine, especially if you use an 8-core processor.&lt;br /&gt;
&lt;br /&gt;
* Funtoo's team of core developers are a small tight-knit community which welcomes others to join the development family.&lt;br /&gt;
&lt;br /&gt;
* Do you want to use &amp;lt;tt&amp;gt;$application&amp;lt;/tt&amp;gt; but don't care much for &amp;lt;tt&amp;gt;$optional_feature&amp;lt;/tt&amp;gt;? With USE flags, you have full control over what you install on your system.&lt;br /&gt;
&lt;br /&gt;
* Major updates such as toolchain upgrades are tested vigorously before they are introduced to the main branch.&lt;br /&gt;
&lt;br /&gt;
[[Category:Funtoo|*]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Boot_livecd_ISO_from_HDD</id>
		<title>Boot livecd ISO from HDD</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Boot_livecd_ISO_from_HDD"/>
				<updated>2012-11-18T19:51:18Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;With grub2 you can easily boot livecd image from hard drive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
This is general example. I will add settings for different livecd's later.&lt;br /&gt;
&lt;br /&gt;
1. Copy the iso image to root folder for simplicity :&lt;br /&gt;
&amp;lt;pre&amp;gt;cp /home/user/downloads/systemrescuecd.iso /src.iso&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Reboot and when grub2 loads press 'c' for console. Use following commands (tab autocompletion is your friend) :&lt;br /&gt;
&amp;lt;pre&amp;gt;loopback loop (hd0,2)/src.iso&lt;br /&gt;
linux (loop)/boot/vmlinuz&lt;br /&gt;
initrd (loop)/boot/initrd.lz&lt;br /&gt;
boot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Baselayout_(Funtoo)</id>
		<title>Baselayout (Funtoo)</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Baselayout_(Funtoo)"/>
				<updated>2012-11-18T19:50:51Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Funtoo Linux has its own baselayout package that defines the base filesystem structure. It contains a device node creation program called '''realdev'''.&lt;br /&gt;
&lt;br /&gt;
[[Category:Internals]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Tutorial</id>
		<title>Category:Tutorial</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Tutorial"/>
				<updated>2012-11-18T19:45:32Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As you already saw we have HOWTOs, these are there for you to get stuff working in an easy way.&lt;br /&gt;
These section is more educational, our Tutorials have the AIM to give you knowledge of what you did and why you did it. Enjoy reading them.&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:QA</id>
		<title>Category:QA</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:QA"/>
				<updated>2012-11-18T19:45:18Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Projects</id>
		<title>Category:Projects</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Projects"/>
				<updated>2012-11-18T19:44:48Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Funtoo Linux has several projects in its ecosystem that come together to form the software you download.&lt;br /&gt;
; [[Boot-Update]]&lt;br /&gt;
: Boot-update is a tool that brings a unified configuration mechanism across all boot loaders.&lt;br /&gt;
; [[Baselayout (Funtoo)]]&lt;br /&gt;
: Baselayout provides the basic device nodes and filesystem layout.&lt;br /&gt;
; [[OpenRC (Funtoo)]]&lt;br /&gt;
: Funtoo OpenRC provides system initialization, service management, and network configuration facilities.&lt;br /&gt;
; [[Portage (Funtoo)]]&lt;br /&gt;
: Portage is the package manager for Funtoo.&lt;br /&gt;
; [[Metro]]&lt;br /&gt;
: Metro is Funtoo's automated OS release build system.&lt;br /&gt;
; [[Keychain]]&lt;br /&gt;
: Keychain helps you to manage ssh and GPG keys in a convenient and secure manner. It acts as a front-end to ssh-agent.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Processor_Architectures</id>
		<title>Category:Processor Architectures</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Processor_Architectures"/>
				<updated>2012-11-18T19:44:28Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Portage</id>
		<title>Category:Portage</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Portage"/>
				<updated>2012-11-18T19:43:57Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This category contains pages related to the Portage package manager/ports system.&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Labs</id>
		<title>Category:Labs</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Labs"/>
				<updated>2012-11-18T19:43:11Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Funtoo Labs is where Funtoo Research and Development projects can be found. This provides a nice place for you to see what we're working on, and also potentially get involved :)&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:HOWTO</id>
		<title>Category:HOWTO</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:HOWTO"/>
				<updated>2012-11-18T19:42:18Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can do many things with Funtoo Linux. This is just a sample of how to do some tasks.&lt;br /&gt;
&lt;br /&gt;
'''Note to Authors:''' The HOWTO section is for short, to the point, hands-on guides.  Guides that also delve into the ''why'' in addition to the ''how'' belong in [[:Category:Tutorial]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Desktop</id>
		<title>Category:Desktop</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Desktop"/>
				<updated>2012-11-18T19:41:34Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists all desktop-related pages, such as window managers and desktop environments (DE).&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:HWLaptop</id>
		<title>Category:HWLaptop</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:HWLaptop"/>
				<updated>2012-11-18T19:40:39Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Category will keep track of special setups for different laptop hardware setups. Please specify the setup you used in an own page and set the category as HWLaptop.&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Hardware_Compatibility</id>
		<title>Category:Hardware Compatibility</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Hardware_Compatibility"/>
				<updated>2012-11-18T19:40:16Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This category is used to tag pages that provide information about the compatibility of hardware with Funtoo Linux.&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Articles</id>
		<title>Category:Articles</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Articles"/>
				<updated>2012-11-18T19:39:52Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most of these articles began their lives on IBM developerWorks, in Daniel's &amp;quot;Common Threads&amp;quot; column. They have now been wiki-fied, so they can be maintained into the future. Enjoy them, and help us maintain them!&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Internals</id>
		<title>Category:Internals</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Internals"/>
				<updated>2012-11-18T19:39:19Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are a lot of packages that go into Funtoo. The items in this category take a deep dive into some of them and how they affect the operation of Funtoo Linux.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Development</id>
		<title>Category:Development</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Development"/>
				<updated>2012-11-18T19:38:58Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Funtoo]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Software</id>
		<title>Category:Software</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Software"/>
				<updated>2012-11-18T19:37:55Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: Created page with &amp;quot;This is the Software category.  Category:Funtoo&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the Software category.&lt;br /&gt;
&lt;br /&gt;
[[Category:Funtoo]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	<entry>
		<id>http://www.funtoo.org/wiki/Category:Hardware</id>
		<title>Category:Hardware</title>
		<link rel="alternate" type="text/html" href="http://www.funtoo.org/wiki/Category:Hardware"/>
				<updated>2012-11-18T19:36:33Z</updated>
		
		<summary type="html">&lt;p&gt;Palica: Created page with &amp;quot;This is the Hardware category.  Category:Funtoo&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the Hardware category.&lt;br /&gt;
&lt;br /&gt;
[[Category:Funtoo]]&lt;/div&gt;</summary>
		<author><name>Palica</name></author>	</entry>

	</feed>