Commit 93334d75 authored by Freezed's avatar Freezed 馃嚝馃嚪

馃攢 Merge '5-all-items-are-translations' into 'production'

Resolve "All items are translations"

Closes #5

See merge request !9
parents ca825d0b 8c34d282
Pipeline #240239350 passed with stages
in 30 seconds
Title: Extend a ZFS root pool after Ubuntu installation
Date: 2021-01-03 21:55
Summary: 1st step after installing Ubuntu on ZFS
Category: Bloc-notes
Tags: zfs, ubuntu, admin, shell, cli, performance, logiciel libre,
Status:聽Published
Translation: true
Lang: en
Slug: extend-zfs-root-pool-after-ubuntu-installation
Since [Eoan Ermine (Ubuntu 19.10)](https://ubuntu.com/blog/enhancing-our-zfs-support-on-ubuntu-19-10-an-introduction), Ubuntu installer (for desktop) can use [ZFS](https://github.com/openzfs/zfs) as root file-system.
The current LTS, [Focal Fossa (Ubuntu 20.04)](https://ubuntu.com/blog/zfs-focus-on-ubuntu-20-04-lts-whats-new) provides only a mono-disk installation, here's how to enhance a mono-disk installation into a mirrored-disk installation to use data resilience provided by ZFS.
馃毀 _ZFS on root is still experimental_ 馃毀
馃敡 Howto
--------
* `sda` is the disk used by installer
* `sdb` is the disk we're going to add to create a mirror
```
user@focal:~$ lsblk -a
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931,5G 0 disk
鈹溾攢sda1 8:1 0 513M 0 part
鈹溾攢sda2 8:2 0 1K 0 part
鈹溾攢sda5 8:5 0 2G 0 part [SWAP]
鈹溾攢sda6 8:6 0 2G 0 part
鈹斺攢sda7 8:7 0 927G 0 part
sdb 8:16 0 931,5G 0 disk
```
```bash
user@focal:~$ blkid
/dev/sda1: UUID="BFE4-2413" TYPE="vfat" PARTUUID="f0771fca-01"
/dev/sda5: UUID="42456868-afc5-4dea-8b73-11257b84890e" TYPE="swap" PARTUUID="f0771fca-05"
/dev/sda6: LABEL="bpool" UUID="11578277722432725130" UUID_SUB="9520999198366150859" TYPE="zfs_member" PARTUUID="f0771fca-06"
/dev/sda7: LABEL="rpool" UUID="13693210375688435814" UUID_SUB="8709443765040685487" TYPE="zfs_member" PARTUUID="f0771fca-07"
```
Ubuntu creates 2 [`pools`](https://www.freebsd.org/doc/handbook/zfs-term.html#zfs-term-pool)鈥:
1. `bpool`鈥: containing boot _pool_
1. `rpool`鈥: containing root _pool_, with all file-system
```bash
user@focal:~$ zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
bpool 1,88G 91,2M 1,79G - - 0% 4% 1.00x ONLINE -
rpool 920G 3,19G 917G - - 0% 0% 1.00x ONLINE -
```
```bash
user@focal:~$ zpool status
pool: bpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
bpool ONLINE 0 0 0
f0771fca-06 ONLINE 0 0 0
errors: No known data errors
pool: rpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
f0771fca-07 ONLINE 0 0 0
```
Run `fdisk` to copy `sda` partition table to `sdb` using sfdisk compatible script files ([_see manpage_](https://manpages.ubuntu.com/manpages/focal/en/man8/fdisk.8.html#script%20files)).
```bash
user@focal:~$ fdisk /dev/sda #copy to file with O
user@focal:~$ fdisk /dev/sdb #import from file with I
```
```bash
user@focal:~$ lsblk -a
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931,5G 0 disk
鈹溾攢sda1 8:1 0 513M 0 part
鈹溾攢sda2 8:2 0 1K 0 part
鈹溾攢sda5 8:5 0 2G 0 part [SWAP]
鈹溾攢sda6 8:6 0 2G 0 part
鈹斺攢sda7 8:7 0 927G 0 part
sdb 8:16 0 931,5G 0 disk
鈹溾攢sdb1 8:17 0 513M 0 part
鈹溾攢sdb2 8:18 0 1K 0 part
鈹溾攢sdb5 8:21 0 2G 0 part
鈹溾攢sdb6 8:22 0 2G 0 part
鈹斺攢sdb7 8:23 0 927G 0 part
```
[Attach](https://www.freebsd.org/doc/handbook/zfs-zpool.html#zfs-zpool-attach) the twin partitions on pools :
```bash
user@focal:~$ sudo zpool attach bpool f0771fca-06 /dev/sdb6
user@focal:~$ sudo zpool attach rpool f0771fca-07 /dev/sdb7
```
馃帀 Tada!
```bash
user@focal:~$ zpool status
pool: bpool
state: ONLINE
scan: resilvered 92,2M in 0 days 00:00:01 with 0 errors on Sun Jan 3 22:22:09 2021
config:
NAME STATE READ WRITE CKSUM
bpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
f0771fca-06 ONLINE 0 0 0
sdb6 ONLINE 0 0 0
errors: No known data errors
pool: rpool
state: ONLINE
scan: resilvered 4,05G in 0 days 00:01:06 with 0 errors on Sun Jan 3 22:24:05 2021
remove: Removal of vdev 1 copied 3,36M in 0h0m, completed on Sun Jan 3 21:14:16 2021
456 memory used for removed device mappings
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
f0771fca-07 ONLINE 0 0 0
sdb7 ONLINE 0 0 0
errors: No known data errors
```
---
馃敄 References
-------------
1. [_ZFS Features and Terminology_](https://www.freebsd.org/doc/handbook/zfs-term.html) - `www.freebsd.org`
1. [_The Z File System (ZFS)_](https://www.freebsd.org/doc/handbook/zfs-quickstart.html) - `www.freebsd.org`
1. [_OpenZFS_](https://github.com/openzfs/zfs) - `github.com`
1. [_Enhancing our ZFS support on Ubuntu 19.10 鈥 an introduction_](https://ubuntu.com/blog/enhancing-our-zfs-support-on-ubuntu-19-10-an-introduction) - `ubuntu.com`
1. [_ZFS focus on Ubuntu 20.04 LTS: what鈥檚 new?_]() - `ubuntu.com`
1. [_zpool manpage_](https://manpages.ubuntu.com/manpages/focal/en/man8/zpool.8.html) - `manpages.ubuntu.com`
1. [_zfs manpage_](https://manpages.ubuntu.com/manpages/focal/en/man8/zfs.8.html) - `manpages.ubuntu.com`
Title: 脡tendre une 芦pool禄 ZFS racine apr猫s une installation Ubuntu
Date: 2021-01-03 21:55
Summary: 1猫re 茅tape apr猫s une installation d'Ubuntu sur ZFS
Category: Bloc-notes
Tags: zfs, ubuntu, admin, shell, cli, performance, logiciel libre,
Status:聽Published
Lang: fr
Slug: extend-zfs-root-pool-after-ubuntu-installation
Depuis [Eoan Ermine (Ubuntu 19.10)](https://ubuntu.com/blog/enhancing-our-zfs-support-on-ubuntu-19-10-an-introduction), l'installeur Ubuntu (pour _desktop_) peut utiliser [ZFS](https://github.com/openzfs/zfs) comme syst猫me de fichier racine.
La version LTS du moment, [Focal Fossa (Ubuntu 20.04)](https://ubuntu.com/blog/zfs-focus-on-ubuntu-20-04-lts-whats-new) propose seulement une installation mono-disque, voici comment transformer une installation mono-disque en une installation 脿 _disques miroirs_ pour utiliser la r茅silience des donn茅es fournie par ZFS.
馃毀 _ZFS on root reste exp茅rimental_ 馃毀
馃敡 Mode d'emploi
----------------
* `sda` est le disque utilis茅 par l'installeur
* `sdb` est le disque que l'on va ajouter pour cr茅er un miroir
```
user@focal:~$ lsblk -a
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931,5G 0 disk
鈹溾攢sda1 8:1 0 513M 0 part
鈹溾攢sda2 8:2 0 1K 0 part
鈹溾攢sda5 8:5 0 2G 0 part [SWAP]
鈹溾攢sda6 8:6 0 2G 0 part
鈹斺攢sda7 8:7 0 927G 0 part
sdb 8:16 0 931,5G 0 disk
```
```bash
user@focal:~$ blkid
/dev/sda1: UUID="BFE4-2413" TYPE="vfat" PARTUUID="f0771fca-01"
/dev/sda5: UUID="42456868-afc5-4dea-8b73-11257b84890e" TYPE="swap" PARTUUID="f0771fca-05"
/dev/sda6: LABEL="bpool" UUID="11578277722432725130" UUID_SUB="9520999198366150859" TYPE="zfs_member" PARTUUID="f0771fca-06"
/dev/sda7: LABEL="rpool" UUID="13693210375688435814" UUID_SUB="8709443765040685487" TYPE="zfs_member" PARTUUID="f0771fca-07"
```
Ubuntu cr茅e 2 [`pools`](https://www.freebsd.org/doc/handbook/zfs-term.html#zfs-term-pool)鈥:
1. `bpool`鈥: coontient la _pool_ de `boot`
1. `rpool`鈥: contient la _pool_ avec tout le syst猫me de fichier
```bash
user@focal:~$ zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
bpool 1,88G 91,2M 1,79G - - 0% 4% 1.00x ONLINE -
rpool 920G 3,19G 917G - - 0% 0% 1.00x ONLINE -
```
```bash
user@focal:~$ zpool status
pool: bpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
bpool ONLINE 0 0 0
f0771fca-06 ONLINE 0 0 0
errors: No known data errors
pool: rpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
f0771fca-07 ONLINE 0 0 0
```
Lancer `fdisk` pour copier la table de partition de `sda` vers `sdb` avec un fichier de script compatible `sfdisk` ([_voir la page de manuel_](https://manpages.ubuntu.com/manpages/focal/en/man8/fdisk.8.html#script%20files)).
```bash
user@focal:~$ fdisk /dev/sda #copy to file with O
user@focal:~$ fdisk /dev/sdb #import from file with I
```
```bash
user@focal:~$ lsblk -a
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931,5G 0 disk
鈹溾攢sda1 8:1 0 513M 0 part
鈹溾攢sda2 8:2 0 1K 0 part
鈹溾攢sda5 8:5 0 2G 0 part [SWAP]
鈹溾攢sda6 8:6 0 2G 0 part
鈹斺攢sda7 8:7 0 927G 0 part
sdb 8:16 0 931,5G 0 disk
鈹溾攢sdb1 8:17 0 513M 0 part
鈹溾攢sdb2 8:18 0 1K 0 part
鈹溾攢sdb5 8:21 0 2G 0 part
鈹溾攢sdb6 8:22 0 2G 0 part
鈹斺攢sdb7 8:23 0 927G 0 part
```
[Attacher](https://www.freebsd.org/doc/handbook/zfs-zpool.html#zfs-zpool-attach) les partitions jumelles a leur _pool_ :
```bash
user@focal:~$ sudo zpool attach bpool f0771fca-06 /dev/sdb6
user@focal:~$ sudo zpool attach rpool f0771fca-07 /dev/sdb7
```
馃帀 Tada!
```bash
user@focal:~$ zpool status
pool: bpool
state: ONLINE
scan: resilvered 92,2M in 0 days 00:00:01 with 0 errors on Sun Jan 3 22:22:09 2021
config:
NAME STATE READ WRITE CKSUM
bpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
f0771fca-06 ONLINE 0 0 0
sdb6 ONLINE 0 0 0
errors: No known data errors
pool: rpool
state: ONLINE
scan: resilvered 4,05G in 0 days 00:01:06 with 0 errors on Sun Jan 3 22:24:05 2021
remove: Removal of vdev 1 copied 3,36M in 0h0m, completed on Sun Jan 3 21:14:16 2021
456 memory used for removed device mappings
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
f0771fca-07 ONLINE 0 0 0
sdb7 ONLINE 0 0 0
errors: No known data errors
```
---
馃敄 R茅f茅rences
-------------
1. [_ZFS Features and Terminology_](https://www.freebsd.org/doc/handbook/zfs-term.html) - `www.freebsd.org`
1. [_The Z File System (ZFS)_](https://www.freebsd.org/doc/handbook/zfs-quickstart.html) - `www.freebsd.org`
1. [_OpenZFS_](https://github.com/openzfs/zfs) - `github.com`
1. [_Enhancing our ZFS support on Ubuntu 19.10 鈥 an introduction_](https://ubuntu.com/blog/enhancing-our-zfs-support-on-ubuntu-19-10-an-introduction) - `ubuntu.com`
1. [_ZFS focus on Ubuntu 20.04 LTS: what鈥檚 new?_]() - `ubuntu.com`
1. [_zpool manpage_](https://manpages.ubuntu.com/manpages/focal/en/man8/zpool.8.html) - `manpages.ubuntu.com`
1. [_zfs manpage_](https://manpages.ubuntu.com/manpages/focal/en/man8/zfs.8.html) - `manpages.ubuntu.com`
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment