Difference between pages "Install/fr/Partitioning" and "Package:Boot-Update"

< Install‎ | fr(Difference between pages)
 
 
Line 1: Line 1:
<noinclude>
+
{{Ebuild
{{InstallPart|création et partitionnement des fichiers du système}}
+
|Summary=Funtoo Core Boot Framework for global boot loader configuration
</noinclude>
+
|CatPkg=sys-boot/boot-update
=== Préparation du disque ===
+
|Maintainer=Drobbins
 +
|Repository=Funtoo Overlay
 +
|Organization=Funtoo Technologies
 +
|Overlay=Funtoo
 +
}}
 +
Funtoo boot-update provides a unified mechanism for configuring the GRUB 1.9x ({{Package|sys-boot/grub}}) and GRUB 0.97 ({{Package|sys-boot/grub-legacy}}) boot loaders. It is the recommended, official way to configure Funtoo Linux systems for booting.
  
==== Introduction ====
+
=== Current Version ===
  
Il fut un temps où il n'y avait qu'une seule façon de démarrer un PC compatible. Tous les postes de travail ainsi que les serveurs utilisaient un BIOS standard. Le Master Boot Records se retrouvait sur tous les disques durs et le partitionnement reposait sur un schéma MBR.
+
* {{Package|sys-boot/boot-update}}
  
Les temps ont bien changé depuis. La technologie évoluant, de nouveaux firmwares, EFI et UEFI, sont apparus. Ils sont conçus pour amorcer les systèmes d'exploitation et pour prendre en charge le mode de partitionnement GPT. Celui-ci supporte le partitionnement des disques de très grande capacité, 2,2 To et plus. Nous nous retrouvons ainsi devant un large éventail d'options pour démarrer un système d'exploitation. Ce qui était jadis unique et simple apporte maintenant son lot de complexité.
+
=== Man Pages ===
 +
Consult the following man pages for detailed, up-to-date information on configuration file settings and command-line arguments:
  
Regardons d'un peu plus près les options d'amorçage disponibles. Ce guide d'installation utilise et recommande la méthode dite de la vieille école, soit le démarrage BIOS et le partitionnement MBR. Il n'y a rien de mal là-dedans et ça fonctionne. Si vos disques sont d'une capacité de stockage de 2 To et moins, vous n'aurez aucune contrainte à en utiliser toute leur capacité.
+
* boot-update(8)
 +
* boot.conf(5)
  
Il y a toutefois des situations où la méthode dite de la vieille école ne se révèle pas optimale. Par exemple, si vous possédez un disque d'une capacité de stockage supérieure à 2 To, le mode de partitionnement MBR vous empêche de profiter de toute cette capacité. Il y a aussi des PC dont la carte mère ne reconnaît pas l'amorçage BIOS. Pour ces raisons, ce guide d'installation traite également de la méthode d'amorçage UEFI.
+
{{:Install/BootLoader}}
  
Nous continuons à recommander la méthode d'amorçage BIOS et le partitionnement MBR sauf si vous avez des raisons de procéder autrement. Nous appelons cette méthode la méthode '''BIOS + GRUB(MBR)'''. C'est la façon traditionnelle de mettre en place un mécanisme d'amorçage Linux.
+
=== GRUB 0.97 (grub-legacy) Quick Start ===
  
Si vous devez utiliser le mode UEFI pour démarrer, nous recommandons de ne pas utiliser le partitionnement MBR. Certaines cartes mère le supportent mais d'autres non. Nous recommandons plutôt l'utilisation de UEFI pour amorcer GRUB qui en retour lancera Linux. Nous référons à cette méthode en l'appelant '''UEFI + GRUB(GPT)'''.
+
If using <code>sys-boot/grub-legacy-0.97</code>, perform the following steps:
  
'''La grande question est : quelle méthode d'amorçage dois-je utiliser ?'''. En voici la réponse.
+
* Partition disk using MBR partitions '''(GPT not supported)'''
 
+
* Install kernel/initrd to <code>/boot</code>
;Principe #1 - Vieille école: Si vous démarrez votre PC en amorçant sur System Rescue CD et que vous voyez un menu bleu pâle, c'est que l'amorçage se fait en mode BIOS. Cela signifie que vous pouvez lancer Funtoo Linux en utilisant BIOS. Allez-y avec la méthode dite de la vieille école. Par contre si le disque dur est d'une capacité de 2,2 To et plus, il faut alors y aller avec la méthode dite de la nouvelle école. Appliquez le principe #2.
+
 
+
;Principe #2 - Nouvelle école: Le système sur la carte mère est conçu pour le support UEFI quand l'amorçage avec System Rescue CD affiche un menu en noir et blanc. Vous pouvez donc installer Funtoo Linux avec une configuration d'amorçage en mode UEFI. Vous pourriez être capable de configurer un amorçage en mode BIOS, mais essayez UEFI en premier. Fouillez un peu dans la configuration BIOS pour faire les ajustements nécessaires.
+
 
+
;Quelle est la grande différence entre Vieille école et Nouvelle école ?: Quand vous appliquez la méthode vieille école, partitionnement MBR, votre partition <code>/boot</code> sera formatée avec le système de fichiers ext2 et les partitions seront créées avec l'utilitaire <code>fdisk</code>. Quand vous y allez avec la méthode nouvelle école, partitionnement GPT et amorçage UEFI, votre partition <code>/boot</code> sera formaté au système de fichiers vfat car UEFI ne reconnaît que celui-ci. Vous utilisez l'utilitaire <code>gdisk</code> pour créer vos partitions selon le mode de partitionnement GPT. L'installation de l'amorceur GRUB se réalise différemment dans le cas d'un démarrage UEFI.
+
 
+
{{Note|'''Certaines cartes mère semblent supporter UEFI, mais ne le font pas.''' Faites quelques recherches. Par exemple, une carte mère va permettre d'amorcer un système en mode UEFI si vous démarrez le PC à partir d'un CD/DVD amorçable. Cette même carte mère refusera d'amorcer la machine en mode UEFI quand le démarrage se fait à partir du disque dur. Cela nous amène à un troisième principe : il faut connaître notre matériel.}}
+
 
+
==== (BIOS/MBR) Méthode dite de la vieille école ====
+
 
+
{{Note|Appliquez cette méthode si vous démarrez en mode BIOS et si le menu initial de System Rescue CD est bleu pâle. Si vous devez plutôt appliquer la méthode dite de la vieille école, [[#(UEFI/GPT) Méthode dite de la nouvelle école|cliquez ici.]]}}
+
 
+
===== Préparation =====
+
 
+
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>
 
<console>
# ##i##fdisk -l /dev/sda
+
###i## emerge sys-boot/boot-update
 
+
###i## emerge ">=sys-boot/grub-legacy-0.97-r11"
Disk /dev/sda: 640.1 GB, 640135028736 bytes, 1250263728 sectors
+
###i## grub-install-legacy /dev/sda
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>
 
</console>
 
+
Due to an issue with <code>grub-legacy</code>, you may see the following message:
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>
 
<console>
# ##i##sgdisk --zap-all /dev/sda
+
###i## grub-install-legacy /dev/sda
 
+
The file /boot/grub-legacy/stage1 not read correctly.
Creating new GPT entries.
+
GPT data structures destroyed! You may now partition the disk using fdisk or
+
other utilities.
+
 
</console>
 
</console>
 
+
Should you receive this message, you will have to install <code>grub-legacy</code> from the grub shell.
This output is also nothing to worry about, as the command still succeded:
+
Assuming <code>/boot</code> is the partition <code>/dev/sda1</code> and you want to install grub to the MBR, you would run the following:
 
+
 
<console>
 
<console>
***************************************************************
+
###i## grub-legacy
Found invalid GPT and valid MBR; converting MBR to GPT format
+
root (hd0,0)
in memory.
+
setup (hd0)
***************************************************************
+
quit
 
</console>
 
</console>
 
+
When adjusting to fit your setup, remember 'root' is the location of your boot partition, 'setup' is where you want to install grub, and don't forget about grub's unique naming conventions for hard drives / partitions. For more information run:
===== Partitionnement =====
+
 
+
Now we will use <code>fdisk</code> to create the MBR partition table and partitions:
+
 
+
 
<console>
 
<console>
# ##i##fdisk /dev/sda
+
###i## info grub-legacy
 
</console>
 
</console>
  
Within <code>fdisk</code>, follow these steps:
+
Ensure that <code>/etc/fstab</code> is correct, and edit <code>/etc/boot.conf</code> to reflect your installation.
 
+
Ensure a <code>generate grub-legacy</code> setting in the <code>boot</code> section. Then run:
'''Empty the partition table''':
+
  
 
<console>
 
<console>
Command (m for help): ##i##o ↵
+
###i## boot-update
 
</console>
 
</console>
 +
This will auto-generate the <code>/boot/grub-legacy/grub.conf</code> required for booting. Note that <code>grub-legacy-0.97-r11</code> and later stores <code>grub.conf</code> in the <code>/boot/grub-legacy</code> directory.
  
'''Create Partition 1''' (boot):
+
Re-run <code>boot-update</code> every time your available kernels / initrds or <code>/etc/boot.conf</code> configuration changes.
  
<console>
+
[[Category:Projects]]
Command (m for help): ##i##n ↵
+
[[Category:Funtoo features]]
Partition type (default p): ##i##↵
+
{{EbuildFooter}}
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.
+
 
+
{{Note|You're done with partitioning! Now, jump over to [[#Creating filesystems|Creating filesystems]].}}
+
 
+
==== (UEFI/GPT) Méthode dite de la nouvelle école ====
+
 
+
{{Note|Use this method if you are booting using UEFI, and if your System Rescue CD initial boot menu was black and white. If it was light blue, this method will not work.}}
+
 
+
The <tt>gdisk</tt> commands to create a GPT partition table are as follows. Adapt sizes as necessary, although these defaults will work for most users. Start <code>gdisk</code>:
+
 
+
<console>
+
# ##i##gdisk
+
</console>
+
 
+
Within <tt>gdisk</tt>, follow these steps:
+
 
+
'''Create a new empty partition table''' (This ''will'' erase all data on the disk when saved):
+
 
+
<console>
+
Command: ##i##o ↵
+
This option deletes all partitions and creates a new protective MBR.
+
Proceed? (Y/N): ##i##y ↵
+
</console>
+
 
+
'''Create Partition 1''' (boot):
+
 
+
<console>
+
Command: ##i##n ↵
+
Partition Number: ##i##1 ↵
+
First sector: ##i##↵
+
Last sector: ##i##+500M ↵
+
Hex Code: ##i##↵
+
</console>
+
 
+
'''Create Partition 2''' (swap):
+
 
+
<console>
+
Command: ##i##n ↵
+
Partition Number: ##i##2 ↵
+
First sector: ##i##↵
+
Last sector: ##i##+4G ↵
+
Hex Code: ##i##8200 ↵
+
</console>
+
 
+
'''Create Partition 3''' (root):
+
 
+
<console>
+
Command: ##i##n ↵
+
Partition Number: ##i##3 ↵
+
First sector: ##i##↵
+
Last sector: ##i##↵##!i## (for rest of disk)
+
Hex Code: ##i##↵
+
</console>
+
 
+
Along the way, you can type "<tt>p</tt>" and hit Enter to view your current partition table. If you make a mistake, you can type "<tt>d</tt>" to delete an existing partition that you created. When you are satisfied with your partition setup, type "<tt>w</tt>" to write your configuration to disk:
+
 
+
'''Write Partition Table To Disk''':
+
 
+
<console>
+
Command: ##i##w ↵
+
Do you want to proceed? (Y/N): ##i##Y ↵
+
</console>
+
 
+
The partition table will now be written to disk and <tt>gdisk</tt> will close.
+
 
+
Now, your GPT/GUID partitions have been created, and will show up as the following ''block devices'' under Linux:
+
 
+
* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem,
+
* <tt>/dev/sda2</tt>, which will be used for swap space, and
+
* <tt>/dev/sda3</tt>, which will hold your root filesystem.
+
 
+
==== Création des fichiers du système (formatage) ====
+
 
+
{{Note|This section covers both BIOS ''and'' UEFI installs. Don't skip it!}}
+
 
+
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.
+
 
+
Let's keep this simple. Are you using old-school MBR partitions? If so, let's create an ext2 filesystem on /dev/sda1:
+
 
+
<console>
+
# ##i##mkfs.ext2 /dev/sda1
+
</console>
+
 
+
If you're using new-school GPT partitions for UEFI, you'll want to create a vfat filesystem on /dev/sda1, because this is what UEFI is able to read:
+
 
+
<console>
+
# ##i##mkfs.vfat -F 32 /dev/sda1
+
</console>
+
 
+
Now, let's create a swap partition. This partition will be used as disk-based virtual memory for your Funtoo Linux system.
+
 
+
You will not create a filesystem on your swap partition, since it is not used to store files. But it is necessary to initialize it using the <code>mkswap</code> command. Then we'll run the <code>swapon</code> command to make your newly-initialized swap space immediately active within the live CD environment, in case it is needed during the rest of the install process:
+
 
+
<console>
+
# ##i##mkswap /dev/sda2
+
# ##i##swapon /dev/sda2
+
</console>
+
 
+
Now, we need to create a root filesystem. This is where Funtoo Linux will live. We generally recommend ext4 or XFS root filesystems. If you're not sure, choose ext4. Here's how to create a root ext4 filesystem:
+
 
+
<console>
+
# ##i##mkfs.ext4 /dev/sda3
+
</console>
+
 
+
...and here's how to create an XFS root filesystem, if you choose to use XFS:
+
 
+
<console>
+
# ##i##mkfs.xfs /dev/sda3
+
</console>
+
 
+
Your filesystems (and swap) have all now been initialized, so that that can be mounted (attached to your existing directory heirarchy) and used to store files. We are ready to begin installing Funtoo Linux on these brand-new filesystems.
+
 
+
{{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.
+
}}
+
 
+
==== Montage des partitions ====
+
 
+
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:
+
 
+
<console>
+
# ##i##mkdir /mnt/funtoo/home
+
# ##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:
+
 
+
<console>
+
# ##i##chmod 1777 /mnt/funtoo/tmp
+
</console>
+

Latest revision as of 18:19, January 11, 2015

sys-boot/boot-update


Current Maintainer(s):Daniel Robbins
Source Repository:Repository:Funtoo Overlay


Summary: Funtoo Core Boot Framework for global boot loader configuration


News

Drobbins

ARM Rebuild

ARM systems will use new stage3's that are not compatible with earlier versions.
2015-06-27 by Drobbins
Drobbins

ABI X86 64 and 32

Funtoo Linux has new 32-bit compatibility libraries inherited from Gentoo. Learn about them here.
2015-06-18 by Drobbins
Drobbins

Pre-built kernels!

Funtoo stage3's are now starting to offer pre-built kernels for ease of install. read more....
2015-05-12 by Drobbins
More...

Boot-Update

Tip

We welcome improvements to this page. To edit this page, 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.

Funtoo boot-update provides a unified mechanism for configuring the GRUB 1.9x (No results) and GRUB 0.97 (No results) boot loaders. It is the recommended, official way to configure Funtoo Linux systems for booting.

Current Version

Man Pages

Consult the following man pages for detailed, up-to-date information on configuration file settings and command-line arguments:

  • boot-update(8)
  • boot.conf(5)


Installing a Bootloader

These install instructions show you how to use GRUB to boot using BIOS (old-school) or UEFI (new-school). As of boot-update-1.7.2, now in Portage, the steps are very similar.

First, emerge boot-update. This will also cause grub-2 and efibootmgr to be merged, since they are dependencies:

(chroot) # emerge boot-update

Then, edit /etc/boot.conf using nano and specify "Funtoo Linux genkernel" as the default setting at the top of the file, replacing "Funtoo Linux".

/etc/boot.conf should now look like this:

boot {
	generate grub
	default "Funtoo Linux genkernel" 
	timeout 3 
}

"Funtoo Linux" {
	kernel bzImage[-v]
}

"Funtoo Linux genkernel" {
	kernel kernel[-v]
	initrd initramfs[-v]
	params += real_root=auto 
} 

"Funtoo Linux better-initramfs" {
	kernel vmlinuz[-v]
	initrd /initramfs.cpio.gz
}

If you are booting a custom or non-default kernel, please read man boot.conf for information on the various options available to you.

Old School (BIOS) MBR

When using "old school" BIOS booting, run the following command to install GRUB to your MBR, and generate the /boot/grub/grub.cfg configuration file that GRUB will use for booting:

(chroot) # grub-install --target=i386-pc --no-floppy /dev/sda
(chroot) # boot-update

New School (UEFI) Boot Entry

If you're using "new school" UEFI booting, run of the following sets of commands, depending on whether you are installing a 64-bit or 32-bit system. This will add GRUB as a UEFI boot entry.

For x86-64bit systems:

(chroot) # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
(chroot) # boot-update

For x86-32bit systems:

(chroot) # grub-install --target=i386-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
(chroot) # boot-update

First Boot, and in the future...

OK -- you are ready to boot!

You only need to run grub-install when you first install Funtoo Linux, but you need to re-run boot-update every time you modify your /etc/boot.conf file or add new kernels to your system. This will regenerate /boot/grub/grub.cfg so that you will have new kernels available in your GRUB boot menu, the next time you reboot.

GRUB 0.97 (grub-legacy) Quick Start

If using sys-boot/grub-legacy-0.97, perform the following steps:

  • Partition disk using MBR partitions (GPT not supported)
  • Install kernel/initrd to /boot
# emerge sys-boot/boot-update
# emerge ">=sys-boot/grub-legacy-0.97-r11"
# grub-install-legacy /dev/sda

Due to an issue with grub-legacy, you may see the following message:

# grub-install-legacy /dev/sda
The file /boot/grub-legacy/stage1 not read correctly.

Should you receive this message, you will have to install grub-legacy from the grub shell. Assuming /boot is the partition /dev/sda1 and you want to install grub to the MBR, you would run the following:

# grub-legacy
root (hd0,0)
setup (hd0)
quit

When adjusting to fit your setup, remember 'root' is the location of your boot partition, 'setup' is where you want to install grub, and don't forget about grub's unique naming conventions for hard drives / partitions. For more information run:

# info grub-legacy

Ensure that /etc/fstab is correct, and edit /etc/boot.conf to reflect your installation. Ensure a generate grub-legacy setting in the boot section. Then run:

# boot-update

This will auto-generate the /boot/grub-legacy/grub.conf required for booting. Note that grub-legacy-0.97-r11 and later stores grub.conf in the /boot/grub-legacy directory.

Re-run boot-update every time your available kernels / initrds or /etc/boot.conf configuration changes.