Difference between pages "Install/Partitioning" and "Package:Layman"

< Install(Difference between pages)
(Created page with "<noinclude> {{Note|This is a template that is used as part of the Installation instructions, to describe the process of partitioning and filesystem creation. Templates are bei...")
 
m
 
Line 1: Line 1:
<noinclude>
+
{{Ebuild
{{Note|This is a template that is used as part of the Installation instructions, to describe the process of partitioning and filesystem creation. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.}}
+
|Summary=Tool to manage Gentoo overlays
</noinclude>
+
|CatPkg=app-portage/layman
=== Prepare Hard Disk ===
+
|Homepage=http://layman.sourceforge.net/
==== Partitions ====
+
}}
 +
Layman is an "overlay" external repository management tool.
  
Funtoo Linux fully supports traditional MBR partitions, as well as newer GPT/GUID partition formats. See below to determine which partitioning scheme to use:
+
=== Installation ===
 +
<console>###i## emerge layman</console>
 +
[[make.conf]] must source laymans overlays for emerge to pull in packages from external sources.  This line needs to be below everything else in make.conf.
 +
<console>###i## echo "source /var/lib/layman/make.conf" >> /etc/portage/make.conf</console>
  
===== MBR Partitions =====
+
=== Using Layman ===
 +
Fetch, and display a list of overlays:
 +
<console>###i## layman -L</console>
  
* '''Recommended if your system disk is <=2TB in size'''
+
Add an overlay to your system:
* Legacy, DOS partitioning scheme
+
<console>###i## layman -a <overlay name></console>
* Only 4 primary partitions per disk; after that, you must use "logical" partitions
+
* Does not support 2 TB+ disks for booting
+
* Compatible with certain problematic systems (such as the HP ProBook 4520)
+
* Dual-boot with Windows for BIOS systems (Windows handle GPT only on true EFI systems, whatever version it is)
+
* Multiple boot loader options, e.g. GRUB 2, GRUB Legacy, lilo
+
  
{{fancynote|Due to the fact that it is more widely supported on PC hardware, it is best to use MBR partitions if possible.}}
+
Delete an overlay from your system:
 +
<console>###i## layman -d <overlay name></console>
  
===== GPT Partitions =====
+
==== Masking Overlay Packages ====
 +
Overlays have the power to override distro packages.  To avoid conflicts, mask everything in the overlay, and unmask the packages that are necessary to your system.
  
* '''Recommended if your disk is >2TB in size'''
+
{{file|name=/etc/portage/package.mask|lang=|desc=mask all packages in an overlay|body=
* Newer format for Linux systems
+
*/*::overlay-name
* Supports 2 TB+ hard drives for booting
+
}}
* Supports hundreds of partitions per disk of any size
+
* Requires legacy BIOS boot partition (~32 MB) to be created if system does not use EFI
+
* Requires bootloader with support for GPT such as GRUB 2, EXTLINUX, or a patched version of GRUB Legacy
+
  
{{fancyimportant|If you have a system disk that is 2TB or greater and want to use the space beyond 2TB, you ''must'' partition using the GPT/GUID format. Otherwise, MBR is recommended as the most reliable boot method.}}
+
{{file|name=/etc/portage/package.unmask|lang=|desc=unmask packages to be used|body=
 
+
cat-egory/pack-age1
===== Filesystem Resources =====
+
cat-egory/pack-age2
 
+
Advanced users may be interested in the following topics:
+
 
+
* [[GUID Booting Guide]]
+
* [[LVM Install Guide]]
+
* [[Rootfs over encrypted lvm]]
+
* [[Rootfs over encrypted lvm over raid-1 on GPT]]
+
* '''NEW!''' '''[[ZFS Install Guide]] (Also contains instructions for Rootfs over Encrypted ZFS!)'''
+
 
+
===== Partitioning Recommendations =====
+
 
+
Below are our partitioning recommendations in table form. For MBR-based partitions, use the MBR Block Device and MBR code columns with <code>fdisk</code>. For GPT-based partitions, use the GPT Block Device and GPT Code columns with <code>gdisk</code>:
+
 
+
{{TableStart}}
+
<tr class="active"><th>Partition</th>
+
<th>Size</th>
+
<th>MBR Block Device (<code>fdisk</code>)</th>
+
<th>GPT Block Device (<code>gdisk</code>)</th>
+
<th>Filesystem</th>
+
<th>MBR Code</th>
+
<th>GPT Code</th>
+
</tr><tr>
+
<td><code>/boot</code></td>
+
<td>512 MB</td>
+
<td><code>/dev/sda1</code></td>
+
<td><code>/dev/sda1</code></td>
+
<td>ext2</td>
+
<td>83</td>
+
<td>8300</td>
+
</tr><tr>
+
<td>GRUB boot loader partition</td>
+
<td>1 MB</td>
+
<td>''not required for MBR''</td>
+
<td><code>/dev/sda2</code></td>
+
<td>For GPT/GUID only, skip for MBR - no filesystem.</td>
+
<td>''N/A''</td>
+
<td>EF02</td>
+
</tr><tr>
+
<td>swap</td>
+
<td>2x RAM for low-memory systems and production servers; otherwise 2GB.</td>
+
<td><code>/dev/sda2</code></td>
+
<td><code>/dev/sda3</code></td>
+
<td>swap (default)</td>
+
<td>82</td>
+
<td>8200</td>
+
</tr><tr>
+
<td><code>/</code> (root)</td>
+
<td>Rest of the disk, minimum of 10GB.  Note: to compile the <code>debian-sources</code> kernel, as described later on this page, requires a minimum of 14GB free space in <code>/tmp</code>; consider a minimum of 20GB in this case.</td>
+
<td><code>/dev/sda3</code></td>
+
<td><code>/dev/sda4</code></td>
+
<td>XFS recommended, alternatively ext4</td>
+
<td>83</td>
+
<td>8300</td>
+
</tr><tr>
+
<td><code>/home</code> (optional) </td>
+
<td>User storage and media. Typically most of the disk.</td>
+
<td><code>/dev/sda4</code> (if created)</td>
+
<td><code>/dev/sda5</code> (if created)</td>
+
<td>XFS recommended, alternatively ext4</td>
+
<td>83</td>
+
<td>8300</td>
+
</tr><tr>
+
<td>LVM (optional)</td>
+
<td>If you want to create an LVM volume.</td>
+
<td><code>/dev/sda4</code> (PV, if created)</td>
+
<td><code>/dev/sda5</code> (PV, if created)</td>
+
<td>LVM PV</td>
+
<td>8E</td>
+
<td>8E00</td>
+
</tr>{{TableEnd}}
+
 
+
===== Partitioning Using fdisk (MBR) =====
+
 
+
{{fancyimportant|If you need to create a GPT partition table, see [[Partitioning using gdisk]] or [[Partitioning using parted]].}}
+
 
+
{{fancynote|These install instructions assume you are installing Funtoo Linux to an hard disk using Master Boot Record partition tables (MBR). If you are installing Funtoo Linux on a machine where another OS is installed, there is an existing Linux distribution on your system that you want to keep or any other scenario (such as differing swap size requirements), then you will need to adapt these instructions to suit your needs.}}
+
 
+
<code>fdisk</code> is the tool used to create an MBR partition table. MBR is well-supported on PCs and is recommended if your system disk is 2TB or smaller.
+
 
+
====== Preparation ======
+
 
+
First, it's a good idea to make sure that you've found the correct hard disk to partition. Try this command and verify that <code>/dev/sda</code> is the disk that you want to partition:
+
 
+
<console>
+
# ##i##fdisk -l /dev/sda
+
 
+
Disk /dev/sda: 640.1 GB, 640135028736 bytes, 1250263728 sectors
+
Units = sectors of 1 * 512 = 512 bytes
+
Sector size (logical/physical): 512 bytes / 512 bytes
+
I/O size (minimum/optimal): 512 bytes / 512 bytes
+
Disk label type: gpt
+
 
+
 
+
#        Start          End    Size  Type            Name
+
1        2048  1250263694  596.2G  Linux filesyste Linux filesystem
+
</console>
+
 
+
Now, it's recommended that you erase any existing MBR or GPT partition tables on the disk, which could confuse the system's BIOS at boot time. We do this using <code>sgdisk</code>:
+
{{fancywarning|This will make any existing partitions inaccessible! You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}
+
 
+
<console>
+
# ##i##sgdisk --zap-all /dev/sda
+
 
+
Creating new GPT entries.
+
GPT data structures destroyed! You may now partition the disk using fdisk or
+
other utilities.
+
</console>
+
 
+
This output is also nothing to worry about, as the command still succeded:
+
 
+
<console>
+
***************************************************************
+
Found invalid GPT and valid MBR; converting MBR to GPT format
+
in memory.
+
***************************************************************
+
</console>
+
 
+
====== Partitioning ======
+
 
+
Now we will use <code>fdisk</code> to create the MBR partition table and partitions:
+
 
+
<console>
+
# ##i##fdisk /dev/sda
+
</console>
+
 
+
Within <code>fdisk</code>, follow these steps:
+
 
+
'''Empty the partition table''':
+
 
+
<console>
+
Command (m for help): ##i##o ↵
+
</console>
+
 
+
'''Create Partition 1''' (boot):
+
 
+
<console>
+
Command (m for help): ##i##n ↵
+
Partition type (default p): ##i##↵
+
Partition number (1-4, default 1): ##i##↵
+
First sector: ##i##↵
+
Last sector: ##i##+128M ↵
+
</console>
+
 
+
'''Create Partition 2''' (swap):
+
 
+
<console>
+
Command (m for help): ##i##n ↵
+
Partition type (default p): ##i##↵
+
Partition number (2-4, default 2): ##i##↵
+
First sector: ##i##↵
+
Last sector: ##i##+2G ↵
+
Command (m for help): ##i##t ↵
+
Partition number (1,2, default 2): ##i## ↵
+
Hex code (type L to list all codes): ##i##82 ↵
+
</console>
+
 
+
'''Create the root partition:'''
+
 
+
<console>
+
Command (m for help): ##i##n ↵
+
Partition type (default p): ##i##↵
+
Partition number (3,4, default 3): ##i##↵
+
First sector: ##i##↵
+
Last sector: ##i##↵
+
</console>
+
 
+
'''Verify the partition table:'''
+
 
+
<console>
+
Command (m for help): ##i##p
+
 
+
Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors
+
Units: sectors of 1 * 512 = 512 bytes
+
Sector size (logical/physical): 512 bytes / 512 bytes
+
I/O size (minimum/optimal): 512 bytes / 512 bytes
+
Disklabel type: dos
+
Disk identifier: 0x82abc9a6
+
 
+
Device    Boot    Start      End    Blocks  Id System
+
/dev/sda1          2048    264191    131072  83 Linux
+
/dev/sda2        264192  4458495  2097152  82 Linux swap / Solaris
+
/dev/sda3        4458496 625142447 310341976  83 Linux
+
</console>
+
 
+
'''Write the parition table to disk:'''
+
 
+
<console>
+
Command (m for help): ##i##w
+
</console>
+
 
+
Your new MBR partition table will now be written to your system disk.
+
 
+
==== Creating filesystems ====
+
 
+
Before your newly-created partitions can be used, the block devices need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.
+
 
+
You will not create a filesystem on your swap partition, but will initialize it using the <code>mkswap</code> command so that it can be used as disk-based virtual memory. Then we'll run the <code>swapon</code> command to make your newly-initialized swap space active within the live CD environment, in case it is needed during the rest of the install process.
+
 
+
Note that we will not create a filesystem on the GRUB boot loader partition, as GRUB writes binary data directly to that partition when the boot loader is installed, which we'll do later.
+
 
+
You can see the commands you will need to type below. Like the rest of this document, it assumes that you are using a GPT partitioning scheme. If you are using MBR, your root filesystem will likely be created on <code>/dev/sda3</code> instead and you will need to adjust the target block devices. If you are following our recommendations, then simply do this:
+
 
+
'''We generally recommend XFS for root filesystems, although ext4 is also a good choice.''' This tutorial assumes the use of XFS. If you want to use ext4, then be sure that your <code>/etc/fstab</code> file reflects this.
+
 
+
{{fancywarning|1=
+
When deploying an OpenVZ host, please use ext4 exclusively. The Parallels development team tests extensively with ext4, and modern versions of <code>openvz-rhel6-stable</code> are '''not''' compatible with XFS, and you may experience kernel bugs.
+
 
}}
 
}}
  
'''To use ext4 as your root filesystem:'''
+
==== Sync ====
 
+
<console>
+
# ##i##mke2fs -t ext2 /dev/sda1
+
# ##i##mkfs.ext4 /dev/sda3
+
# ##i##mkswap /dev/sda2
+
# ##i##swapon /dev/sda2
+
</console>
+
 
+
'''To use XFS as your root filesystem:'''
+
 
+
<console>
+
# ##i##mke2fs -t ext2 /dev/sda1
+
# ##i##mkfs.xfs /dev/sda3
+
# ##i##mkswap /dev/sda2
+
# ##i##swapon /dev/sda2
+
</console>
+
 
+
==== Mounting filesystems ====
+
 
+
Mount the newly-created filesystems as follows, creating <code>/mnt/funtoo</code> as the installation mount point:
+
 
+
<console>
+
# ##i##mkdir /mnt/funtoo
+
# ##i##mount /dev/sda3 /mnt/funtoo
+
# ##i##mkdir /mnt/funtoo/boot
+
# ##i##mount /dev/sda1 /mnt/funtoo/boot
+
</console>
+
  
Optionally, if you have a separate filesystem for <code>/home</code> or anything else:
+
Sync a specific overlays ebuilds:
 +
<console>###i## layman -s <overlay name></console>
  
<console>
+
Sync all overlays:
# ##i##mkdir /mnt/funtoo/home
+
<console>###i## layman -S</console>
# ##i##mount /dev/sda4 /mnt/funtoo/home
+
</console>
+
  
If you have <code>/tmp</code> or <code>/var/tmp</code> on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:
+
Sync all overlays via eix:
 +
<console>###i## eix-sync</console>
  
<console>
+
=== Troubleshooting ===
# ##i##chmod 1777 /mnt/funtoo/tmp
+
Problem:
</console>
+
Warning: an installed db file was not found at: ['/var/lib/layman/cache***.xml']
  
{{:Install/Stage3}}
+
Solution:
 +
<console>###i## layman -L</console>
  
{{:Install/Chroot}}
+
{{EbuildFooter}}

Revision as of 12:00, February 3, 2015

app-portage/layman


Source Repository:Gentoo Portage Tree
Homepage

Summary: Tool to manage Gentoo overlays

Use Flags

bazaar
Support dev-vcs/bzr based overlays
cvs
Support dev-vcs/cvs based overlays
darcs
Support dev-vcs/darcs based overlays
g-sorcery
Support app-portage/g-sorcery based overlays
git
Support dev-vcs/git based overlays
gpg
Support app-crypt/gnupg signed overlays lists and manifests
mercurial
Support dev-vcs/mercurial based overlays
squashfs
Support mounting squashfs image overlays locally read-only
subversion
Support dev-vcs/subversion based overlays
sync-plugin-portage
Install the sys-apps/portage sync module

News

Drobbins

RSS/Atom Support

You can now follow this news feed at http://www.funtoo.org/news/atom.xml .
10 February 2015 by Drobbins
Drobbins

Creating a Friendly Funtoo Culture

This news item details some recent steps that have been taken to help ensure that Funtoo is a friendly and welcoming place for our users.
2 February 2015 by Drobbins
Mgorny

CPU FLAGS X86

CPU_FLAGS_X86 are being introduced to group together USE flags managing CPU instruction sets.
31 January 2015 by Mgorny
View More News...

Layman

Tip

This is a wiki page. To edit it, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Layman is an "overlay" external repository management tool.

Installation

# emerge layman

make.conf must source laymans overlays for emerge to pull in packages from external sources. This line needs to be below everything else in make.conf.

# echo "source /var/lib/layman/make.conf" >> /etc/portage/make.conf

Using Layman

Fetch, and display a list of overlays:

# layman -L

Add an overlay to your system:

# layman -a <overlay name>

Delete an overlay from your system:

# layman -d <overlay name>

Masking Overlay Packages

Overlays have the power to override distro packages. To avoid conflicts, mask everything in the overlay, and unmask the packages that are necessary to your system.

/etc/portage/package.mask - mask all packages in an overlay
*/*::overlay-name
/etc/portage/package.unmask - unmask packages to be used
cat-egory/pack-age1
cat-egory/pack-age2

Sync

Sync a specific overlays ebuilds:

# layman -s <overlay name>

Sync all overlays:

# layman -S

Sync all overlays via eix:

# eix-sync

Troubleshooting

Problem: Warning: an installed db file was not found at: ['/var/lib/layman/cache***.xml']

Solution:

# layman -L