Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:lpic:21:450:l104 [2022/10/07 09:59] – admin | elearning:workbooks:lpic:21:450:l104 [2022/11/01 07:26] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
Updated : ~~LASTMOD~~ | Updated : ~~LASTMOD~~ | ||
- | ======Topic | + | ======Topic |
- | FIXME: Add smartd\\ | + | |
- | FIXME: Add autofs\\ | + | |
- | + | ||
- | =====Contenu du Module===== | + | |
- | + | ||
- | | + | |
- | * Contenu du Module | + | |
* LAB #1 - Linux File Hierarchy System | * LAB #1 - Linux File Hierarchy System | ||
* 1.1 - Types de Fichiers | * 1.1 - Types de Fichiers | ||
Ligne 22: | Ligne 16: | ||
* Périphériques de stockage | * Périphériques de stockage | ||
* Partitions | * Partitions | ||
- | | + | * LAB #2 - Partitionnement de votre Disque avec fdisk |
- | | + | |
- | * LAB #3 - Modifier les Drapeaux des Partitions | + | |
* Systèmes de Fichiers Journalisés | * Systèmes de Fichiers Journalisés | ||
* Présentation | * Présentation | ||
* Ext3 | * Ext3 | ||
* Gestion d'Ext3 | * Gestion d'Ext3 | ||
- | * LAB #4 - Convertir un Système de Fichiers Ext3 en Ext2 | + | * LAB #3 - Convertir un Système de Fichiers Ext3 en Ext2 |
- | * LAB #5 - Convertir un Système de Fichiers Ext2 en Ext3 | + | * LAB #4 - Convertir un Système de Fichiers Ext2 en Ext3 |
- | * LAB #6 - Placer le Journal sur un autre Partition | + | * LAB #5 - Placer le Journal sur un autre Partition |
- | * LAB #7 - Modifier la Fréquence de Vérification du Système de Fichiers Ext3 | + | * LAB #6 - Modifier la Fréquence de Vérification du Système de Fichiers Ext3 |
* Ext4 | * Ext4 | ||
- | * LAB #8 - Créer un Système de Fichiers Ext4 | + | * LAB #7 - Créer un Système de Fichiers Ext4 |
- | * LAB #9 - Ajouter une Étiquette au Système de Fichiers Ext4 | + | * LAB #8 - Ajouter une Étiquette au Système de Fichiers Ext4 |
- | * LAB #10 - Convertir un Système de Fichiers Ext3 en Ext4 | + | * LAB #9 - Convertir un Système de Fichiers Ext3 en Ext4 |
* XFS | * XFS | ||
- | * LAB #11 - Créer un Système de Fichiers XFS | + | * LAB #10 - Créer un Système de Fichiers XFS |
- | * LAB #12 - Ajouter une Étiquette au Système de Fichiers XFS | + | * LAB #11 - Ajouter une Étiquette au Système de Fichiers XFS |
- | * Autres Systèmes | + | * ReiserFS |
- | * ReiserFS | + | * LAB #12 - Créer un Système |
- | * JFS | + | * LAB #13 - Ajouter une Étiquette au Système de Fichiers |
- | * Btrfs | + | * JFS |
+ | * LAB #14 - Créer un Système de Fichiers | ||
+ | * LAB #15 - Ajouter une Étiquette au Système de Fichiers JFS | ||
+ | * Btrfs | ||
+ | * LAB #16 - Créer un Système de Fichiers Btrfs | ||
+ | * LAB #17 - Convertir un Système de Fichiers Ext4 en Brtfs | ||
+ | * LAB #18 - Créer un Snapshot | ||
+ | * LAB #19 - Ajouter une Étiquette au Système de Fichiers | ||
* Comparaison des Commandes par Système de Fichiers | * Comparaison des Commandes par Système de Fichiers | ||
- | * LAB #13 - Créer un Système de Fichiers | + | |
- | * La Commande | + | |
+ | * LAB #21 - Créer un Système de Fichiers Chiffré avec LUKS | ||
+ | * Le Swap | ||
+ | * Taille du swap | ||
+ | * Partitions de swap | ||
+ | * La Commande | ||
+ | * La Commande swapoff | ||
+ | * LAB #22 - Créer un Fichier de Swap | ||
+ | * LAB #23 - Commandes Diverses | ||
+ | * La Commande sync | ||
+ | * La Commande fstrim | ||
+ | * La Daemon smartd | ||
=====LAB #1 - Linux File Hierarchy System===== | =====LAB #1 - Linux File Hierarchy System===== | ||
Ligne 53: | Ligne 63: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ cd / |
- | [trainee@centos8 | + | trainee@debian11:/$ ls -l |
- | total 18 | + | total 60 |
- | lrwxrwxrwx. 1 root root 7 May 10 2019 bin -> usr/bin | + | lrwxrwxrwx |
- | dr-xr-xr-x. | + | drwxr-xr-x 3 root root |
- | drwxr-xr-x. 19 root root 3020 Sep 6 07:59 dev | + | drwxr-xr-x |
- | drwxr-xr-x. 91 root root 8192 Sep 6 07:59 etc | + | drwxr-xr-x |
- | drwxr-xr-x. 3 root root 21 May 8 07:42 home | + | drwxr-xr-x |
- | lrwxrwxrwx. | + | lrwxrwxrwx |
- | lrwxrwxrwx. 1 root root 9 May 10 2019 lib64 -> usr/lib64 | + | lrwxrwxrwx |
- | drwxr-xr-x. | + | lrwxrwxrwx |
- | drwxr-xr-x. 2 root root 6 May 10 2019 mnt | + | lrwxrwxrwx |
- | drwxr-xr-x. 2 root root 6 May 10 2019 opt | + | lrwxrwxrwx |
- | dr-xr-xr-x. 126 root root 0 Sep 6 07:59 proc | + | lrwxrwxrwx |
- | dr-xr-x---. | + | drwx------ |
- | drwxr-xr-x. 29 root root 860 Sep 6 08:00 run | + | drwxr-xr-x |
- | lrwxrwxrwx. 1 root root 8 May 10 2019 sbin -> usr/sbin | + | drwxr-xr-x |
- | drwxr-xr-x. 2 root root 6 May 10 2019 srv | + | drwxr-xr-x |
- | dr-xr-xr-x. 13 root root 0 Sep 6 07:59 sys | + | dr-xr-xr-x |
- | drwxrwxrwt. | + | drwx------ 3 root root |
- | drwxr-xr-x. 12 root root | + | drwxr-xr-x |
- | drwxr-xr-x. 21 root root 4096 May 8 08:13 var | + | lrwxrwxrwx |
+ | drwxr-xr-x | ||
+ | dr-xr-xr-x | ||
+ | drwxrwxrwt | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | lrwxrwxrwx | ||
+ | lrwxrwxrwx | ||
</ | </ | ||
- | * **/bin** : est une abréviation de // | + | * **/bin** : est une abréviation de // |
* **/boot** : contient les fichiers nécessaires au démarrage du système. | * **/boot** : contient les fichiers nécessaires au démarrage du système. | ||
* **/dev** : contient les nœuds utilisés pour accéder à tout type de matériel tel /dev/fd0 pour le lecteur de disquette. C'est le binaire //udev// qui se charge de créer et supprimer d'une manière dynamique les nœuds. | * **/dev** : contient les nœuds utilisés pour accéder à tout type de matériel tel /dev/fd0 pour le lecteur de disquette. C'est le binaire //udev// qui se charge de créer et supprimer d'une manière dynamique les nœuds. | ||
* **/etc** : contient des fichiers de configuration tels passwd pour les mots de passe et fstab qui est la liste des systèmes de fichiers à monter lors du démarrage du système. | * **/etc** : contient des fichiers de configuration tels passwd pour les mots de passe et fstab qui est la liste des systèmes de fichiers à monter lors du démarrage du système. | ||
* **/home** : contient les répertoires de chaque utilisateur sauf l’utilisateur root. | * **/home** : contient les répertoires de chaque utilisateur sauf l’utilisateur root. | ||
- | * **/lib** : contient les bibliothèques 32 bits communes utilisées par les programmes ainsi que les modules. Sous CentOS 8 il s'agit d'un lien symbolique qui pointe vers / | + | * **/lib** : contient les bibliothèques 32 bits communes utilisées par les programmes ainsi que les modules. Sous Debian 11 il s'agit d'un lien symbolique qui pointe vers / |
- | * **/lib64** : contient les bibliothèques 64 bits communes utilisées par les programmes ainsi que les modules. Sous CentOS 8 il s'agit d'un lien symbolique qui pointe vers / | + | * **/lib64** : contient les bibliothèques 64 bits communes utilisées par les programmes ainsi que les modules. Sous Debian 11 il s'agit d'un lien symbolique qui pointe vers / |
* **/media** : contient des répertoires pour chaque système de fichiers monté ( accessible au système linux ) tels floppy, cdrom etc. | * **/media** : contient des répertoires pour chaque système de fichiers monté ( accessible au système linux ) tels floppy, cdrom etc. | ||
* **/mnt** : contient des répertoires pour chaque système de fichiers monté temporairement par root. | * **/mnt** : contient des répertoires pour chaque système de fichiers monté temporairement par root. | ||
Ligne 90: | Ligne 107: | ||
* **/root** : le home de root, l’administrateur système. | * **/root** : le home de root, l’administrateur système. | ||
* **/run** : remplace le répertoire /var/run. | * **/run** : remplace le répertoire /var/run. | ||
- | * **/sbin** : contient des binaires, donc programmes, pour l’administration du système local. | + | * **/sbin** : contient des binaires, donc programmes, pour l’administration du système local. |
* **/srv** : contient des données pour les **s**e**r****v**ices hébergés par le système tels ftp, bases de données, web etc. | * **/srv** : contient des données pour les **s**e**r****v**ices hébergés par le système tels ftp, bases de données, web etc. | ||
* **/sys** : contient un système de fichiers virtuel dont le rôle est de décrire le matériel pour udev. | * **/sys** : contient un système de fichiers virtuel dont le rôle est de décrire le matériel pour udev. | ||
Ligne 122: | Ligne 139: | ||
ou **/ | ou **/ | ||
+ | |||
+ | <WRAP center round todo> | ||
+ | **A faire** : Connectez-vous à votre machine virtuelle en tant que **trainee** avec le mot de passe **trainee**. Ouvrez un terminal via les menus **Applications > Favorites > Terminal**. Tapez la commande **su -** et appuyez sur la touche < | ||
+ | </ | ||
Dans le cas où la commande **mount** est utilisée sans options, le système retourne une liste de tous les systèmes de fichiers actuellement montés : | Dans le cas où la commande **mount** est utilisée sans options, le système retourne une liste de tous les systèmes de fichiers actuellement montés : | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:/$ su - |
Password: fenestros | Password: fenestros | ||
- | [root@centos8 | + | root@debian11:~# mount |
- | sysfs on /sys type sysfs (rw, | + | sysfs on /sys type sysfs (rw, |
proc on /proc type proc (rw, | proc on /proc type proc (rw, | ||
- | devtmpfs | + | udev on /dev type devtmpfs (rw,nosuid,relatime,size=1989872k,nr_inodes=497468,mode=755) |
+ | devpts on /dev/pts type devpts (rw, | ||
+ | tmpfs on /run type tmpfs (rw, | ||
+ | /dev/sda1 on / type ext4 (rw, | ||
securityfs on / | securityfs on / | ||
- | tmpfs on /dev/shm type tmpfs (rw, | + | tmpfs on /dev/shm type tmpfs (rw, |
- | devpts on /dev/pts type devpts (rw, | + | tmpfs on /run/lock type tmpfs (rw, |
- | tmpfs on /run type tmpfs (rw, | + | cgroup2 |
- | tmpfs on / | + | pstore on / |
- | cgroup | + | none on /sys/fs/bpf type bpf (rw, |
- | pstore on / | + | systemd-1 |
- | bpf on /sys/fs/bpf type bpf (rw, | + | tracefs |
- | cgroup | + | mqueue |
- | cgroup on /sys/fs/cgroup/ | + | debugfs |
- | cgroup on / | + | hugetlbfs |
- | cgroup | + | configfs on / |
- | cgroup | + | fusectl on / |
- | cgroup | + | tmpfs on /run/user/113 type tmpfs (rw, |
- | cgroup | + | tmpfs on /run/user/1000 type tmpfs (rw, |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | none on / | + | |
- | configfs on / | + | |
- | / | + | |
- | selinuxfs on / | + | |
- | systemd-1 on / | + | |
- | mqueue on /dev/mqueue type mqueue (rw, | + | |
- | debugfs on / | + | |
- | hugetlbfs on / | + | |
- | fusectl on / | + | |
- | /dev/sda1 on /boot type ext4 (rw,relatime,seclabel) | + | |
- | sunrpc on / | + | |
- | tmpfs on /run/user/1000 type tmpfs (rw, | + | |
- | tmpfs on /run/user/42 type tmpfs (rw, | + | |
- | gvfsd-fuse on / | + | |
</ | </ | ||
Ligne 170: | Ligne 176: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# cat /etc/mtab |
- | sysfs /sys sysfs rw,seclabel, | + | sysfs /sys sysfs rw, |
proc /proc proc rw, | proc /proc proc rw, | ||
- | devtmpfs | + | udev /dev devtmpfs rw,nosuid,relatime,size=1989872k,nr_inodes=497468, |
+ | devpts /dev/pts devpts rw, | ||
+ | tmpfs /run tmpfs rw, | ||
+ | /dev/sda1 / ext4 rw, | ||
securityfs / | securityfs / | ||
- | tmpfs /dev/shm tmpfs rw,seclabel, | + | tmpfs /dev/shm tmpfs rw, |
- | devpts /dev/pts devpts rw, | + | tmpfs /run/lock tmpfs rw, |
- | tmpfs /run tmpfs rw,seclabel, | + | cgroup2 |
- | tmpfs / | + | pstore / |
- | cgroup | + | none /sys/fs/bpf bpf rw, |
- | pstore / | + | systemd-1 |
- | bpf /sys/fs/bpf bpf rw, | + | tracefs |
- | cgroup | + | mqueue |
- | cgroup | + | debugfs |
- | cgroup / | + | hugetlbfs |
- | cgroup / | + | configfs / |
- | cgroup | + | fusectl / |
- | cgroup | + | tmpfs /run/user/113 tmpfs rw, |
- | cgroup | + | tmpfs /run/user/1000 tmpfs rw, |
- | cgroup | + | |
- | cgroup / | + | |
- | cgroup / | + | |
- | cgroup / | + | |
- | none / | + | |
- | configfs / | + | |
- | / | + | |
- | selinuxfs / | + | |
- | systemd-1 / | + | |
- | mqueue /dev/mqueue mqueue rw, | + | |
- | debugfs / | + | |
- | hugetlbfs / | + | |
- | fusectl / | + | |
- | /dev/sda1 /boot ext4 rw,seclabel,relatime 0 0 | + | |
- | sunrpc / | + | |
- | tmpfs /run/user/1000 tmpfs rw,seclabel, | + | |
- | tmpfs /run/user/42 tmpfs rw,seclabel, | + | |
- | gvfsd-fuse / | + | |
</ | </ | ||
- | ainsi que dans le fichier **/ | + | et aussi dans le fichier **/ |
< | < | ||
- | [root@centos8 | + | root@debian11:~# cat / |
- | sysfs /sys sysfs rw,seclabel, | + | sysfs /sys sysfs rw, |
proc /proc proc rw, | proc /proc proc rw, | ||
- | devtmpfs | + | udev /dev devtmpfs rw,nosuid,relatime,size=8173092k,nr_inodes=2043273, |
+ | devpts /dev/pts devpts rw, | ||
+ | tmpfs /run tmpfs rw, | ||
+ | /dev/sda1 / ext4 rw, | ||
securityfs / | securityfs / | ||
- | tmpfs /dev/shm tmpfs rw,seclabel, | + | tmpfs /dev/shm tmpfs rw, |
- | devpts /dev/pts devpts rw, | + | tmpfs /run/lock tmpfs rw, |
- | tmpfs /run tmpfs rw,seclabel, | + | cgroup2 |
- | tmpfs / | + | pstore / |
- | cgroup | + | none /sys/fs/bpf bpf rw, |
- | pstore / | + | systemd-1 |
- | bpf /sys/fs/bpf bpf rw, | + | debugfs |
- | cgroup | + | fusectl |
- | cgroup | + | mqueue |
- | cgroup / | + | tracefs |
- | cgroup / | + | hugetlbfs |
- | cgroup | + | configfs |
- | cgroup | + | tmpfs /run/user/1000 tmpfs rw, |
- | cgroup | + | binfmt_misc |
- | cgroup | + | tmpfs /run/user/113 tmpfs rw, |
- | cgroup | + | |
- | cgroup | + | |
- | cgroup | + | |
- | none / | + | |
- | configfs / | + | |
- | / | + | |
- | selinuxfs / | + | |
- | systemd-1 / | + | |
- | hugetlbfs | + | |
- | debugfs / | + | |
- | mqueue /dev/mqueue mqueue rw, | + | |
- | fusectl | + | |
- | /dev/sda1 /boot ext4 rw,seclabel,relatime 0 0 | + | |
- | sunrpc / | + | |
- | tmpfs /run/user/1000 tmpfs rw,seclabel, | + | |
- | tmpfs / | + | |
- | gvfsd-fuse / | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Les options de la commande |
- | **Important** : Notez que le système de fichiers de /dev/sda1 est **ext4** tandis que que le système de fichiers de / | + | |
- | </ | + | |
- | ====1.3 - La Commande umount===== | + | < |
+ | root@debian11: | ||
+ | |||
+ | Usage: | ||
+ | mount [-lhV] | ||
+ | mount -a [options] | ||
+ | mount [options] [--source] < | ||
+ | mount [options] < | ||
+ | mount < | ||
+ | |||
+ | Mount a filesystem. | ||
+ | |||
+ | Options: | ||
+ | -a, --all mount all filesystems mentioned in fstab | ||
+ | -c, --no-canonicalize | ||
+ | -f, --fake | ||
+ | -F, --fork | ||
+ | -T, --fstab < | ||
+ | -i, --internal-only | ||
+ | -l, --show-labels | ||
+ | -n, --no-mtab | ||
+ | | ||
+ | what to do with options loaded from fstab | ||
+ | | ||
+ | mount options source | ||
+ | | ||
+ | force use of options from fstab/ | ||
+ | -o, --options < | ||
+ | -O, --test-opts < | ||
+ | -r, --read-only | ||
+ | -t, --types < | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -v, --verbose | ||
+ | -w, --rw, --read-write | ||
+ | -N, --namespace < | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | Source: | ||
+ | -L, --label < | ||
+ | -U, --uuid < | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | Operations: | ||
+ | -B, --bind | ||
+ | -M, --move | ||
+ | -R, --rbind | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | For more details see mount(8). | ||
+ | </ | ||
+ | |||
+ | ====1.3 - La Commande umount==== | ||
Pour démonter un système de fichiers, on utilise la commande umount : | Pour démonter un système de fichiers, on utilise la commande umount : | ||
- | | + | < |
+ | # umount / | ||
+ | </code> | ||
- | ou | + | ou |
- | | + | < |
+ | # umount /dev/cdrom | ||
+ | </ | ||
- | ====1.4 - Le Fichier / | ||
- | Dans le cas où la commande **mount** est utilisée avec l’option **–a**, tous les systèmes de fichiers mentionnés dans un fichier spécial dénommé **/ | + | Les options de la commande **umount** sont : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# umount --help |
+ | Usage: | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Unmount filesystems. | ||
+ | |||
+ | Options: | ||
+ | -a, --all | ||
+ | -A, --all-targets | ||
+ | | ||
+ | -c, --no-canonicalize | ||
+ | -d, --detach-loop | ||
+ | | ||
+ | -f, --force | ||
+ | -i, --internal-only | ||
+ | -n, --no-mtab | ||
+ | -l, --lazy | ||
+ | -O, --test-opts < | ||
+ | -R, --recursive | ||
+ | -r, --read-only | ||
+ | -t, --types < | ||
+ | -v, --verbose | ||
+ | -q, --quiet | ||
+ | -N, --namespace < | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | For more details see umount(8). | ||
+ | </ | ||
+ | |||
+ | ====1.4 - Le Fichier / | ||
+ | |||
+ | Dans le cas où la commande **mount** est utilisée avec l’option **–a**, tous les systèmes de fichiers mentionnés dans un fichier spécial dénommé **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | # /etc/fstab: static file system information. | ||
# | # | ||
- | # /etc/fstab | + | # Use ' |
- | # Created by anaconda on Wed Jun 16 06:21:32 2021 | + | # device; this may be used with UUID= as a more robust way to name devices |
- | # | + | # that works even if disks are added and removed. See fstab(5). |
- | # Accessible filesystems, | + | |
- | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. | + | |
# | # | ||
- | # After editing | + | # systemd generates mount units based on this file, see systemd.mount(5). |
- | # units generated from this file. | + | # Please |
# | # | ||
- | /dev/mapper/ | + | # <file system> <mount point> |
- | UUID=1c04981e-5317-4b73-9695-3ce25246835d | + | # / was on /dev/sda1 during installation |
- | /dev/mapper/ | + | UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e |
+ | # swap was on /dev/sda5 during installation | ||
+ | UUID=1f9439f5-4b19-49b1-b292-60c2c674cee9 none | ||
+ | / | ||
</ | </ | ||
Ligne 412: | Ligne 500: | ||
=====Partitionnement===== | =====Partitionnement===== | ||
- | ====LAB #2 - Partitionnement de votre Disque avec fdisk==== | + | ====LAB #1 - Partitionnement de votre Disque avec fdisk==== |
- | Pour procéder au partitionnement de votre disque ou de vos disques, | + | Pour procéder au partitionnement de votre disque ou de vos disques, |
Lancez fdisk en fournissant en argument le fichier de référence de votre premier disque dur, par exemple : | Lancez fdisk en fournissant en argument le fichier de référence de votre premier disque dur, par exemple : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# fdisk /dev/sdc |
- | Welcome to fdisk (util-linux 2.32.1). | + | Welcome to fdisk (util-linux 2.36.1). |
Changes will remain in memory only, until you decide to write them. | Changes will remain in memory only, until you decide to write them. | ||
Be careful before using the write command. | Be careful before using the write command. | ||
Device does not contain a recognized partition table. | Device does not contain a recognized partition table. | ||
- | Created a new DOS disklabel with disk identifier | + | Created a new DOS disklabel with disk identifier |
Command (m for help): | Command (m for help): | ||
Ligne 473: | Ligne 561: | ||
- | Command (m for help): | + | Command (m for help): |
</ | </ | ||
Ligne 481: | Ligne 569: | ||
^ Partition ^ Type ^ Taille de la Partition ^ | ^ Partition ^ Type ^ Taille de la Partition ^ | ||
- | | /dev/sdb1 | Primaire | 100 Mo | | + | | /dev/sdc1 | Primaire | 100 Mo | |
- | | /dev/sdb2 | Primaire | 100 Mo | | + | | /dev/sdc2 | Primaire | 100 Mo | |
- | | /dev/sdb3 | Primaire | 100 Mo | | + | | /dev/sdc3 | Primaire | 100 Mo | |
- | | /dev/sdb4 | Extended | Du premier secteur disponible au dernier secteur du disque | | + | | /dev/sdc4 | Extended | Du premier secteur disponible au dernier secteur du disque | |
- | | /dev/sdb5 | Logique | 500 Mo | | + | | /dev/sdc5 | Logique | 500 Mo | |
- | | /dev/sdb6 | Logique | 200 Mo | | + | | /dev/sdc6 | Logique | 200 Mo | |
- | | /dev/sdb7 | Logique | 300 Mo | | + | | /dev/sdc7 | Logique | 300 Mo | |
- | | /dev/sda8 | Logique | 500 Mo | | + | | /dev/sdc8 | Logique | 500 Mo | |
- | | /dev/sdb9 | Logique | 400 Mo | | + | | /dev/sdc9 | Logique | 400 Mo | |
- | | /dev/sdb10 | Logique | 500 Mo | | + | | /dev/sdc10 | Logique | 500 Mo | |
- | | /dev/sdb11 | Logique | 500 Mo | | + | | /dev/sdc11 | Logique | 500 Mo | |
- | | /dev/sdb12 | Logique | 200 Mo | | + | | /dev/sdc12 | Logique | 200 Mo | |
Créez d' | Créez d' | ||
Ligne 506: | Ligne 594: | ||
Partition number (1-4, default 1): | Partition number (1-4, default 1): | ||
First sector (2048-8388607, | First sector (2048-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 1 of type ' | Created a new partition 1 of type ' | ||
Ligne 519: | Ligne 607: | ||
Partition number (2-4, default 2): | Partition number (2-4, default 2): | ||
First sector (206848-8388607, | First sector (206848-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 2 of type ' | Created a new partition 2 of type ' | ||
Ligne 532: | Ligne 620: | ||
Partition number (3,4, default 3): | Partition number (3,4, default 3): | ||
First sector (411648-8388607, | First sector (411648-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 3 of type ' | Created a new partition 3 of type ' | ||
- | Command (m for help): | + | Command (m for help): |
</ | </ | ||
Ligne 546: | Ligne 634: | ||
| | ||
| | ||
- | Select (default e): e | + | Select (default e): |
+ | Using default response e. | ||
Selected partition 4 | Selected partition 4 | ||
First sector (616448-8388607, | First sector (616448-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 4 of type ' | Created a new partition 4 of type ' | ||
- | Command (m for help): | + | Command (m for help): |
</ | </ | ||
Ligne 564: | Ligne 653: | ||
Adding logical partition 5 | Adding logical partition 5 | ||
First sector (618496-8388607, | First sector (618496-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 5 of type ' | Created a new partition 5 of type ' | ||
Ligne 572: | Ligne 661: | ||
Adding logical partition 6 | Adding logical partition 6 | ||
First sector (1644544-8388607, | First sector (1644544-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 6 of type ' | Created a new partition 6 of type ' | ||
Command (m for help): n | Command (m for help): n | ||
+ | |||
All primary partitions are in use. | All primary partitions are in use. | ||
Adding logical partition 7 | Adding logical partition 7 | ||
First sector (2056192-8388607, | First sector (2056192-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 7 of type ' | Created a new partition 7 of type ' | ||
Ligne 588: | Ligne 678: | ||
Adding logical partition 8 | Adding logical partition 8 | ||
First sector (2672640-8388607, | First sector (2672640-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 8 of type ' | Created a new partition 8 of type ' | ||
Ligne 596: | Ligne 686: | ||
Adding logical partition 9 | Adding logical partition 9 | ||
First sector (3698688-8388607, | First sector (3698688-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 9 of type ' | Created a new partition 9 of type ' | ||
- | Command (m for help): n | + | Command (m for help): n |
All primary partitions are in use. | All primary partitions are in use. | ||
Adding logical partition 10 | Adding logical partition 10 | ||
First sector (4519936-8388607, | First sector (4519936-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 10 of type ' | Created a new partition 10 of type ' | ||
Ligne 612: | Ligne 702: | ||
Adding logical partition 11 | Adding logical partition 11 | ||
First sector (5545984-8388607, | First sector (5545984-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 11 of type ' | Created a new partition 11 of type ' | ||
Ligne 620: | Ligne 710: | ||
Adding logical partition 12 | Adding logical partition 12 | ||
First sector (6572032-8388607, | First sector (6572032-8388607, | ||
- | Last sector, +sectors or +size{K, | + | Last sector, +/-sectors or +/-size{K, |
Created a new partition 12 of type ' | Created a new partition 12 of type ' | ||
- | Command (m for help): | + | Command (m for help): |
</ | </ | ||
Ligne 631: | Ligne 721: | ||
< | < | ||
Command (m for help): p | Command (m for help): p | ||
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | Disk /dev/sdc: 4 GiB, 4294967296 bytes, 8388608 sectors |
+ | Disk model: QEMU HARDDISK | ||
Units: sectors of 1 * 512 = 512 bytes | Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/ | Sector size (logical/ | ||
I/O size (minimum/ | I/O size (minimum/ | ||
Disklabel type: dos | Disklabel type: dos | ||
- | Disk identifier: | + | Disk identifier: |
Device | Device | ||
- | /dev/sdb1 | + | /dev/sdc1 |
- | /dev/sdb2 | + | /dev/sdc2 |
- | /dev/sdb3 | + | /dev/sdc3 |
- | /dev/sdb4 | + | /dev/sdc4 |
- | /dev/sdb5 | + | /dev/sdc5 |
- | /dev/sdb6 1644544 2054143 | + | /dev/sdc6 1644544 2054143 |
- | /dev/sdb7 2056192 2670591 | + | /dev/sdc7 2056192 2670591 |
- | /dev/sdb8 2672640 3696639 1024000 | + | /dev/sdc8 2672640 3696639 1024000 |
- | /dev/sdb9 3698688 4517887 | + | /dev/sdc9 3698688 4517887 |
- | /dev/sdb10 | + | /dev/sdc10 |
- | /dev/sdb11 | + | /dev/sdc11 |
- | /dev/sdb12 | + | /dev/sdc12 |
Command (m for help): | Command (m for help): | ||
Ligne 663: | Ligne 754: | ||
Syncing disks. | Syncing disks. | ||
- | [root@centos8 | + | root@debian11:~# partprobe |
- | [root@centos8 ~]# | + | Warning: Unable to open /dev/sr0 read-write (Read-only file system). |
</ | </ | ||
Ligne 670: | Ligne 761: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# fdisk /dev/sdc |
- | Welcome to fdisk (util-linux 2.32.1). | + | Welcome to fdisk (util-linux 2.36.1). |
Changes will remain in memory only, until you decide to write them. | Changes will remain in memory only, until you decide to write them. | ||
Be careful before using the write command. | Be careful before using the write command. | ||
Ligne 678: | Ligne 769: | ||
Command (m for help): p | Command (m for help): p | ||
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | Disk /dev/sdc: 4 GiB, 4294967296 bytes, 8388608 sectors |
+ | Disk model: QEMU HARDDISK | ||
Units: sectors of 1 * 512 = 512 bytes | Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/ | Sector size (logical/ | ||
I/O size (minimum/ | I/O size (minimum/ | ||
Disklabel type: dos | Disklabel type: dos | ||
- | Disk identifier: | + | Disk identifier: |
Device | Device | ||
- | /dev/sdb1 | + | /dev/sdc1 |
- | /dev/sdb2 | + | /dev/sdc2 |
- | /dev/sdb3 | + | /dev/sdc3 |
- | /dev/sdb4 | + | /dev/sdc4 |
- | /dev/sdb5 | + | /dev/sdc5 |
- | /dev/sdb6 1644544 2054143 | + | /dev/sdc6 1644544 2054143 |
- | /dev/sdb7 2056192 2670591 | + | /dev/sdc7 2056192 2670591 |
- | /dev/sdb8 2672640 3696639 1024000 | + | /dev/sdc8 2672640 3696639 1024000 |
- | /dev/sdb9 3698688 4517887 | + | /dev/sdc9 3698688 4517887 |
- | /dev/sdb10 | + | /dev/sdc10 |
- | /dev/sdb11 | + | /dev/sdc11 |
- | /dev/sdb12 | + | /dev/sdc12 |
Command (m for help): | Command (m for help): | ||
Ligne 706: | Ligne 798: | ||
< | < | ||
Command (m for help): d | Command (m for help): d | ||
- | Partition number (1-12, default 12): 12 | + | Partition number (1-12, default 12): |
Partition 12 has been deleted. | Partition 12 has been deleted. | ||
Command (m for help): p | Command (m for help): p | ||
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | Disk /dev/sdc: 4 GiB, 4294967296 bytes, 8388608 sectors |
+ | Disk model: QEMU HARDDISK | ||
Units: sectors of 1 * 512 = 512 bytes | Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/ | Sector size (logical/ | ||
I/O size (minimum/ | I/O size (minimum/ | ||
Disklabel type: dos | Disklabel type: dos | ||
- | Disk identifier: | + | Disk identifier: |
Device | Device | ||
- | /dev/sdb1 | + | /dev/sdc1 |
- | /dev/sdb2 | + | /dev/sdc2 |
- | /dev/sdb3 | + | /dev/sdc3 |
- | /dev/sdb4 | + | /dev/sdc4 |
- | /dev/sdb5 | + | /dev/sdc5 |
- | /dev/sdb6 1644544 2054143 | + | /dev/sdc6 1644544 2054143 |
- | /dev/sdb7 2056192 2670591 | + | /dev/sdc7 2056192 2670591 |
- | /dev/sdb8 2672640 3696639 1024000 | + | /dev/sdc8 2672640 3696639 1024000 |
- | /dev/sdb9 3698688 4517887 | + | /dev/sdc9 3698688 4517887 |
- | /dev/sdb10 | + | /dev/sdc10 |
- | /dev/sdb11 | + | /dev/sdc11 |
Command (m for help): | Command (m for help): | ||
Ligne 741: | Ligne 834: | ||
Command (m for help): q | Command (m for help): q | ||
- | [root@centos8 | + | root@debian11:~# fdisk /dev/sdc |
- | Welcome to fdisk (util-linux 2.32.1). | + | Welcome to fdisk (util-linux 2.36.1). |
Changes will remain in memory only, until you decide to write them. | Changes will remain in memory only, until you decide to write them. | ||
Be careful before using the write command. | Be careful before using the write command. | ||
Ligne 749: | Ligne 842: | ||
Command (m for help): p | Command (m for help): p | ||
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | Disk /dev/sdc: 4 GiB, 4294967296 bytes, 8388608 sectors |
+ | Disk model: QEMU HARDDISK | ||
Units: sectors of 1 * 512 = 512 bytes | Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/ | Sector size (logical/ | ||
I/O size (minimum/ | I/O size (minimum/ | ||
Disklabel type: dos | Disklabel type: dos | ||
- | Disk identifier: | + | Disk identifier: |
Device | Device | ||
- | /dev/sdb1 | + | /dev/sdc1 |
- | /dev/sdb2 | + | /dev/sdc2 |
- | /dev/sdb3 | + | /dev/sdc3 |
- | /dev/sdb4 | + | /dev/sdc4 |
- | /dev/sdb5 | + | /dev/sdc5 |
- | /dev/sdb6 1644544 2054143 | + | /dev/sdc6 1644544 2054143 |
- | /dev/sdb7 2056192 2670591 | + | /dev/sdc7 2056192 2670591 |
- | /dev/sdb8 2672640 3696639 1024000 | + | /dev/sdc8 2672640 3696639 1024000 |
- | /dev/sdb9 3698688 4517887 | + | /dev/sdc9 3698688 4517887 |
- | /dev/sdb10 | + | /dev/sdc10 |
- | /dev/sdb11 | + | /dev/sdc11 |
- | /dev/sdb12 | + | /dev/sdc12 |
- | Command (m for help): | + | Command (m for help): |
</ | </ | ||
- | ====LAB #3 - Modifier les Drapeaux des Partitions avec fdisk==== | + | ====LAB #2 - Modifier les Drapeaux des Partitions avec fdisk==== |
Afin de mettre en place un RAID logiciel ou un volume logique, il est nécessaire de modifier les types de systèmes de fichiers sur les partitions créées. | Afin de mettre en place un RAID logiciel ou un volume logique, il est nécessaire de modifier les types de systèmes de fichiers sur les partitions créées. | ||
Ligne 794: | Ligne 888: | ||
Command (m for help): t | Command (m for help): t | ||
Partition number (1-12, default 12): 5 | Partition number (1-12, default 12): 5 | ||
- | Hex code (type L to list all codes): fd | + | Hex code or alias (type L to list all): fd |
Changed type of partition ' | Changed type of partition ' | ||
Ligne 800: | Ligne 894: | ||
Command (m for help): t | Command (m for help): t | ||
Partition number (1-12, default 12): 6 | Partition number (1-12, default 12): 6 | ||
- | Hex code (type L to list all codes): 8e | + | Hex code or alias (type L to list all): 8e |
Changed type of partition ' | Changed type of partition ' | ||
Ligne 806: | Ligne 900: | ||
Command (m for help): t | Command (m for help): t | ||
Partition number (1-12, default 12): 7 | Partition number (1-12, default 12): 7 | ||
- | Hex code (type L to list all codes): 8e | + | Hex code or alias (type L to list all): 8e |
Changed type of partition ' | Changed type of partition ' | ||
Ligne 812: | Ligne 906: | ||
Command (m for help): t | Command (m for help): t | ||
Partition number (1-12, default 12): 8 | Partition number (1-12, default 12): 8 | ||
- | Hex code (type L to list all codes): fd | + | Hex code or alias (type L to list all): fd |
Changed type of partition ' | Changed type of partition ' | ||
Ligne 818: | Ligne 912: | ||
Command (m for help): t | Command (m for help): t | ||
Partition number (1-12, default 12): 9 | Partition number (1-12, default 12): 9 | ||
- | Hex code (type L to list all codes): 8e | + | Hex code or alias (type L to list all): 8e |
Changed type of partition ' | Changed type of partition ' | ||
Ligne 824: | Ligne 918: | ||
Command (m for help): t | Command (m for help): t | ||
Partition number (1-12, default 12): 10 | Partition number (1-12, default 12): 10 | ||
- | Hex code (type L to list all codes): fd | + | Hex code or alias (type L to list all): fd |
Changed type of partition ' | Changed type of partition ' | ||
Ligne 830: | Ligne 924: | ||
Command (m for help): t | Command (m for help): t | ||
Partition number (1-12, default 12): 11 | Partition number (1-12, default 12): 11 | ||
- | Hex code (type L to list all codes): fd | + | Hex code or alias (type L to list all): fd |
Changed type of partition ' | Changed type of partition ' | ||
+ | |||
+ | Command (m for help): | ||
</ | </ | ||
Ligne 839: | Ligne 935: | ||
< | < | ||
Command (m for help): p | Command (m for help): p | ||
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | Disk /dev/sdc: 4 GiB, 4294967296 bytes, 8388608 sectors |
+ | Disk model: QEMU HARDDISK | ||
Units: sectors of 1 * 512 = 512 bytes | Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/ | Sector size (logical/ | ||
I/O size (minimum/ | I/O size (minimum/ | ||
Disklabel type: dos | Disklabel type: dos | ||
- | Disk identifier: | + | Disk identifier: |
Device | Device | ||
- | /dev/sdb1 | + | /dev/sdc1 |
- | /dev/sdb2 | + | /dev/sdc2 |
- | /dev/sdb3 | + | /dev/sdc3 |
- | /dev/sdb4 | + | /dev/sdc4 |
- | /dev/sdb5 | + | /dev/sdc5 |
- | /dev/sdb6 1644544 2054143 | + | /dev/sdc6 1644544 2054143 |
- | /dev/sdb7 2056192 2670591 | + | /dev/sdc7 2056192 2670591 |
- | /dev/sdb8 2672640 3696639 1024000 | + | /dev/sdc8 2672640 3696639 1024000 |
- | /dev/sdb9 3698688 4517887 | + | /dev/sdc9 3698688 4517887 |
- | /dev/sdb10 | + | /dev/sdc10 |
- | /dev/sdb11 | + | /dev/sdc11 |
- | /dev/sdb12 | + | /dev/sdc12 |
Command (m for help): | Command (m for help): | ||
Ligne 867: | Ligne 964: | ||
< | < | ||
Command (m for help): w | Command (m for help): w | ||
- | The partition table has been altered! | + | The partition table has been altered. |
Calling ioctl() to re-read partition table. | Calling ioctl() to re-read partition table. | ||
- | |||
- | WARNING: Re-reading the partition table failed with error 16: Device or resource busy. | ||
- | The kernel still uses the old table. The new table will be used at | ||
- | the next reboot or after you run partprobe(8) or kpartx(8) | ||
Syncing disks. | Syncing disks. | ||
- | [root@centos8 | + | |
+ | root@debian11:~# partprobe | ||
+ | Warning: Unable to open /dev/sr0 read-write (Read-only file system). | ||
</ | </ | ||
Ligne 883: | Ligne 977: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# fdisk --help |
Usage: | Usage: | ||
- | fdisk [options] < | + | fdisk [options] < |
- | fdisk [options] -l [< | + | fdisk [options] -l [< |
Display or manipulate a disk partition table. | Display or manipulate a disk partition table. | ||
Ligne 898: | Ligne 992: | ||
| | ||
-l, --list | -l, --list | ||
+ | -x, --list-details | ||
+ | -n, --noauto-pt | ||
-o, --output < | -o, --output < | ||
-t, --type < | -t, --type < | ||
Ligne 903: | Ligne 999: | ||
-s, --getsz | -s, --getsz | ||
| | ||
+ | | ||
-w, --wipe < | -w, --wipe < | ||
-W, --wipe-partitions < | -W, --wipe-partitions < | ||
Ligne 957: | Ligne 1054: | ||
Pour plus d' | Pour plus d' | ||
- | ===Gestion d' | + | ===LAB# 3 - Gestion d' |
Notez maintenant le numéro de la dernière partition que vous avez précédemment créée : | Notez maintenant le numéro de la dernière partition que vous avez précédemment créée : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# fdisk -l |
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | Disk /dev/sda: 64 GiB, 68719476736 bytes, 134217728 sectors |
+ | Disk model: QEMU HARDDISK | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | |||
+ | |||
+ | Disk /dev/sdc: 4 GiB, 4294967296 bytes, 8388608 sectors | ||
+ | Disk model: QEMU HARDDISK | ||
Units: sectors of 1 * 512 = 512 bytes | Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/ | Sector size (logical/ | ||
I/O size (minimum/ | I/O size (minimum/ | ||
Disklabel type: dos | Disklabel type: dos | ||
- | Disk identifier: | + | Disk identifier: |
Device | Device | ||
- | /dev/sdb1 | + | /dev/sdc1 |
- | /dev/sdb2 | + | /dev/sdc2 |
- | /dev/sdb3 | + | /dev/sdc3 |
- | /dev/sdb4 | + | /dev/sdc4 |
- | /dev/sdb5 | + | /dev/sdc5 |
- | /dev/sdb6 1644544 2054143 | + | /dev/sdc6 1644544 2054143 |
- | /dev/sdb7 2056192 2670591 | + | /dev/sdc7 2056192 2670591 |
- | /dev/sdb8 2672640 3696639 1024000 | + | /dev/sdc8 2672640 3696639 1024000 |
- | /dev/sdb9 3698688 4517887 | + | /dev/sdc9 3698688 4517887 |
- | /dev/sdb10 | + | /dev/sdc10 |
- | /dev/sdb11 | + | /dev/sdc11 |
- | /dev/sdb12 | + | /dev/sdc12 |
- | Disk /dev/sda: 20 GiB, 21474836480 | + | Disk /dev/sdb: 32 GiB, 34359738368 |
+ | Disk model: QEMU HARDDISK | ||
Units: sectors of 1 * 512 = 512 bytes | Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/ | Sector size (logical/ | ||
I/O size (minimum/ | I/O size (minimum/ | ||
Disklabel type: dos | Disklabel type: dos | ||
- | Disk identifier: | + | Disk identifier: |
- | + | ||
- | Device | + | |
- | / | + | |
- | / | + | |
- | / | + | |
+ | Device | ||
+ | / | ||
+ | / | ||
+ | / | ||
Ligne 1012: | Ligne 1116: | ||
</ | </ | ||
- | Créez un filesystem Ext3 sur /dev/sdb12 en utilisant la commande **mke2fs -j** : | + | Dans ce cas, il s'agit de **/ |
+ | |||
+ | Créez un filesystem Ext3 sur /dev/sdc12 en utilisant la commande **mke2fs -j** : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# mke2fs -j /dev/sdc12 |
- | mke2fs 1.45.6 (20-Mar-2020) | + | mke2fs 1.46.2 (28-Feb-2021) |
+ | Discarding device blocks: done | ||
Creating filesystem with 204800 1k blocks and 51200 inodes | Creating filesystem with 204800 1k blocks and 51200 inodes | ||
- | Filesystem UUID: a2515f45-a32a-4e87-b7e6-170448f3f803 | + | Filesystem UUID: bdea8b16-8d0b-480c-ab37-68d7d2bdb0b8 |
Superblock backups stored on blocks: | Superblock backups stored on blocks: | ||
- | 8193, 24577, 40961, 57345, 73729 | + | |
Allocating group tables: done | Allocating group tables: done | ||
Ligne 1031: | Ligne 1138: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# mke2fs --help |
mke2fs: invalid option -- ' | mke2fs: invalid option -- ' | ||
Usage: mke2fs [-c|-l filename] [-b block-size] [-C cluster-size] | Usage: mke2fs [-c|-l filename] [-b block-size] [-C cluster-size] | ||
- | [-i bytes-per-inode] [-I inode-size] [-J journal-options] | + | |
- | [-G flex-group-size] [-N number-of-inodes] [-d root-directory] | + | [-G flex-group-size] [-N number-of-inodes] [-d root-directory] |
- | [-m reserved-blocks-percentage] [-o creator-os] | + | [-m reserved-blocks-percentage] [-o creator-os] |
- | [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] | + | [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] |
- | [-O feature[, | + | [-O feature[, |
- | [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] | + | [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] |
- | [-jnqvDFSV] device [blocks-count] | + | [-jnqvDFSV] device [blocks-count] |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
- | **Important** : Lors de la mise en place d'un filesystem ext2/ | + | **Important** : Lors de la mise en place d'un filesystem ext2/ |
</ | </ | ||
Ligne 1052: | Ligne 1159: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# dumpe2fs -h /dev/sdc12 |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | dumpe2fs 1.46.2 (28-Feb-2021) |
Filesystem volume name: < | Filesystem volume name: < | ||
Last mounted on: <not available> | Last mounted on: <not available> | ||
- | Filesystem UUID: | + | Filesystem UUID: |
Filesystem magic number: | Filesystem magic number: | ||
Filesystem revision #: 1 (dynamic) | Filesystem revision #: 1 (dynamic) | ||
Ligne 1068: | Ligne 1175: | ||
Block count: | Block count: | ||
Reserved block count: | Reserved block count: | ||
+ | Overhead clusters: | ||
Free blocks: | Free blocks: | ||
Free inodes: | Free inodes: | ||
Ligne 1078: | Ligne 1186: | ||
Inodes per group: | Inodes per group: | ||
Inode blocks per group: | Inode blocks per group: | ||
- | Filesystem created: | + | Filesystem created: |
Last mount time: n/a | Last mount time: n/a | ||
- | Last write time: | + | Last write time: |
Mount count: | Mount count: | ||
Maximum mount count: | Maximum mount count: | ||
- | Last checked: | + | Last checked: |
Check interval: | Check interval: | ||
Reserved blocks uid: 0 (user root) | Reserved blocks uid: 0 (user root) | ||
Reserved blocks gid: 0 (group root) | Reserved blocks gid: 0 (group root) | ||
First inode: | First inode: | ||
- | Inode size: | + | Inode size: |
Journal inode: | Journal inode: | ||
Default directory hash: | Default directory hash: | ||
- | Directory Hash Seed: | + | Directory Hash Seed: |
Journal backup: | Journal backup: | ||
Journal features: | Journal features: | ||
- | Journal | + | Total journal |
- | Journal | + | Total journal blocks: |
+ | Max transaction | ||
+ | Fast commit length: | ||
Journal sequence: | Journal sequence: | ||
Journal start: | Journal start: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Le drapeau **Filesystem features: | **Important** : Le drapeau **Filesystem features: | ||
</ | </ | ||
- | Les options de cette commande sont : | + | Pour supprimer Ext3 sur cette partition, il convient d' |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# dumpe2fs --help | + | |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | |
- | dumpe2fs: invalid option -- ' | + | |
- | Usage: dumpe2fs [-bfghimxV] [-o superblock=< | + | |
- | </ | + | |
- | + | ||
- | Pour supprimer | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# tune2fs -O ^has_journal / | + | |
- | tune2fs 1.45.6 (20-Mar-2020) | + | |
- | </ | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
< | < | ||
- | [root@centos8 | + | root@debian11:~# tune2fs -O ^has_journal /dev/sdc12 |
- | tune2fs 1.45.6 (20-Mar-2020) | + | tune2fs 1.46.2 (28-Feb-2021) |
- | tune2fs: invalid option -- ' | + | |
- | Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-f] [-g group] | + | |
- | [-i interval[d|m|w]] [-j] [-J journal_options] [-l] | + | |
- | [-m reserved_blocks_percent] [-o [^]mount_options[, | + | |
- | [-r reserved_blocks_count] [-u user] [-C mount_count] | + | |
- | [-L volume_label] [-M last_mounted_dir] | + | |
- | [-O [^]feature[, | + | |
- | [-E extended-option[, | + | |
- | [-I new_inode_size] [-z undo_file] device | + | |
</ | </ | ||
Ligne 1139: | Ligne 1224: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# dumpe2fs -h /dev/sdc12 |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | dumpe2fs 1.46.2 (28-Feb-2021) |
Filesystem volume name: < | Filesystem volume name: < | ||
Last mounted on: <not available> | Last mounted on: <not available> | ||
- | Filesystem UUID: | + | Filesystem UUID: |
Filesystem magic number: | Filesystem magic number: | ||
Filesystem revision #: 1 (dynamic) | Filesystem revision #: 1 (dynamic) | ||
Ligne 1155: | Ligne 1240: | ||
Block count: | Block count: | ||
Reserved block count: | Reserved block count: | ||
+ | Overhead clusters: | ||
Free blocks: | Free blocks: | ||
Free inodes: | Free inodes: | ||
Ligne 1165: | Ligne 1251: | ||
Inodes per group: | Inodes per group: | ||
Inode blocks per group: | Inode blocks per group: | ||
- | Filesystem created: | + | Filesystem created: |
Last mount time: n/a | Last mount time: n/a | ||
- | Last write time: | + | Last write time: |
Mount count: | Mount count: | ||
Maximum mount count: | Maximum mount count: | ||
- | Last checked: | + | Last checked: |
Check interval: | Check interval: | ||
Reserved blocks uid: 0 (user root) | Reserved blocks uid: 0 (user root) | ||
Reserved blocks gid: 0 (group root) | Reserved blocks gid: 0 (group root) | ||
First inode: | First inode: | ||
- | Inode size: | + | Inode size: |
Default directory hash: | Default directory hash: | ||
- | Directory Hash Seed: | + | Directory Hash Seed: |
Journal backup: | Journal backup: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Notez que le drapeau **Filesystem features: | **Important** : Notez que le drapeau **Filesystem features: | ||
</ | </ | ||
Ligne 1188: | Ligne 1274: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# fsck /dev/sdc12 |
- | fsck from util-linux 2.32.1 | + | fsck from util-linux 2.36.1 |
- | e2fsck 1.45.6 (20-Mar-2020) | + | e2fsck 1.46.2 (28-Feb-2021) |
- | /dev/sdb12: clean, 11/51200 files, 8013/204800 blocks | + | /dev/sdc12: clean, 11/51200 files, 8013/204800 blocks |
</ | </ | ||
- | Créez | + | Créez un point de montage pour /dev/sdc12 : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mkdir /mnt/sdc12 |
</ | </ | ||
- | Essayez de monter /dev/sdb12 en tant que système de fichiers Ext3. Vous obtiendrez un résultat similaire à celui-ci : | + | Essayez de monter /dev/sdc12 en tant que système de fichiers Ext3. Vous obtiendrez un résultat similaire à celui-ci : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mount -t ext3 /dev/sdc12 /mnt/sdc12 |
- | mount: /mnt/sdb12: wrong fs type, bad option, bad superblock on /dev/sdb12, missing codepage or helper program, or other error. | + | mount: /mnt/sdc12: wrong fs type, bad option, bad superblock on /dev/sdc12, missing codepage or helper program, or other error. |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
Ligne 1214: | Ligne 1300: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# mkdir / |
+ | root@debian11: | ||
+ | mount: /mnt/sdc12: wrong fs type, bad option, bad superblock on /dev/sdc12, missing codepage or helper program, or other error. | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | /dev/sdc12 /mnt/sdc12 ext2 rw,relatime 0 0 | ||
</ | </ | ||
===LAB #5 - Convertir un Système de Fichiers Ext2 en Ext3=== | ===LAB #5 - Convertir un Système de Fichiers Ext2 en Ext3=== | ||
- | Pour replacer le journal sur /dev/sdb12, il convient d' | + | Pour replacer le journal sur /dev/sdc12, il convient d' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# umount /mnt/sdc12 |
- | [root@centos8 | + | root@debian11:~# tune2fs -j /dev/sdc12 |
- | tune2fs 1.45.6 (20-Mar-2020) | + | tune2fs 1.46.2 (28-Feb-2021) |
Creating journal inode: done | Creating journal inode: done | ||
+ | |||
+ | root@debian11: | ||
+ | dumpe2fs 1.46.2 (28-Feb-2021) | ||
+ | Filesystem volume name: < | ||
+ | Last mounted on: <not available> | ||
+ | Filesystem UUID: bdea8b16-8d0b-480c-ab37-68d7d2bdb0b8 | ||
+ | Filesystem magic number: | ||
+ | Filesystem revision #: 1 (dynamic) | ||
+ | Filesystem features: | ||
+ | Filesystem flags: | ||
+ | Default mount options: | ||
+ | Filesystem state: | ||
+ | Errors behavior: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Notez que vous avez du démonter la partition avant d' | **Important** : Notez que vous avez du démonter la partition avant d' | ||
</ | </ | ||
Ligne 1237: | Ligne 1342: | ||
Le journal d'un système de fichiers peut être placé sur un autre périphérique bloc. | Le journal d'un système de fichiers peut être placé sur un autre périphérique bloc. | ||
- | Créez un système de fichiers sur /dev/sdb11 : | + | Créez un système de fichiers sur /dev/sdc11 : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mke2fs -O journal_dev /dev/sdc11 |
- | mke2fs 1.45.6 (20-Mar-2020) | + | |
- | Creating filesystem with 512000 1k blocks and 0 inodes | + | |
- | Filesystem UUID: 23327281-e88a-4da0-bafa-50ee10c52937 | + | |
- | Superblock backups stored on blocks: | + | |
- | + | ||
- | Zeroing journal device: | + | |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
- | Créez maintenant un système de fichiers Ext3 sur /dev/sdb12 en plaçant le journal sur /dev/sdb11 : | + | Créez maintenant un système de fichiers Ext3 sur /dev/sdc12 en plaçant le journal sur /dev/sdc11 : |
- | < | + | < |
- | [root@centos8 | + | root@debian11:~# mke2fs -j -J device=/ |
- | mke2fs 1.45.6 (20-Mar-2020) | + | mke2fs 1.46.2 (28-Feb-2021) |
Using journal device' | Using journal device' | ||
- | /dev/sdb12 contains a ext3 file system | + | /dev/sdc12 contains a ext3 file system |
- | last mounted on Wed Jun 2 08:03:11 2021 | + | last mounted on Tue Apr 26 16:47:45 2022 |
Proceed anyway? (y,N) y | Proceed anyway? (y,N) y | ||
+ | Discarding device blocks: done | ||
Creating filesystem with 204800 1k blocks and 51200 inodes | Creating filesystem with 204800 1k blocks and 51200 inodes | ||
- | Filesystem UUID: 0e783411-6407-4cba-8db5-0e2729000c9e | + | Filesystem UUID: 84363ced-42b4-49b1-8627-49c39bd71ac3 |
Superblock backups stored on blocks: | Superblock backups stored on blocks: | ||
- | 8193, 24577, 40961, 57345, 73729 | + | |
Allocating group tables: done | Allocating group tables: done | ||
Writing inode tables: done | Writing inode tables: done | ||
- | Adding journal to device /dev/sdb11: done | + | Adding journal to device /dev/sdc11: done |
Writing superblocks and filesystem accounting information: | Writing superblocks and filesystem accounting information: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
- | **Important** : Notez que le journal a été placé sur /dev/sdb11 graĉe à l' | + | **Important** : Notez que le journal a été placé sur /dev/sdc11 graĉe à l' |
</ | </ | ||
===LAB #7 - Modifier la Fréquence de Vérification du Système de Fichiers Ext3=== | ===LAB #7 - Modifier la Fréquence de Vérification du Système de Fichiers Ext3=== | ||
- | Pour modifier | + | Pour modifiez |
< | < | ||
- | [root@centos8 | + | root@debian11:~# tune2fs -i 100d /dev/sdc12 |
- | tune2fs 1.45.6 (20-Mar-2020) | + | tune2fs 1.46.2 (28-Feb-2021) |
Setting interval between checks to 8640000 seconds | Setting interval between checks to 8640000 seconds | ||
</ | </ | ||
Ligne 1290: | Ligne 1390: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# dumpe2fs /dev/sdc12| grep UUID |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | dumpe2fs 1.46.2 (28-Feb-2021) |
- | Filesystem UUID: | + | Filesystem UUID: |
- | Journal UUID: 23327281-e88a-4da0-bafa-50ee10c52937 | + | Journal UUID: a9765f56-d8d4-499b-8fc4-db1d665cdfca |
</ | </ | ||
====Ext4==== | ====Ext4==== | ||
- | Le système de fichiers **Ext4** | + | Le système de fichiers **Ext4** |
Ext4 n'est pas une évolution de Ext3. Cependant il a une compatibilité ascendante avec Ext3. | Ext4 n'est pas une évolution de Ext3. Cependant il a une compatibilité ascendante avec Ext3. | ||
Ligne 1318: | Ligne 1418: | ||
===LAB #8 - Créer un Système de Fichiers Ext4=== | ===LAB #8 - Créer un Système de Fichiers Ext4=== | ||
- | Créez un système de fichiers Ext4 sur **/dev/sdb11** : | + | Créez un système de fichiers Ext4 sur **/dev/sdc11** : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mkfs.ext4 /dev/sdc11 |
- | mke2fs 1.45.6 (20-Mar-2020) | + | mke2fs 1.46.2 (28-Feb-2021) |
- | /dev/sdb11 contains a jbd file system | + | /dev/sdc11 contains a jbd file system |
Proceed anyway? (y,N) y | Proceed anyway? (y,N) y | ||
+ | Discarding device blocks: done | ||
Creating filesystem with 512000 1k blocks and 128016 inodes | Creating filesystem with 512000 1k blocks and 128016 inodes | ||
- | Filesystem UUID: 72a6ad08-7023-4561-adcb-d434e00afed1 | + | Filesystem UUID: a590c318-d9ad-4883-abce-4e154c80e521 |
Superblock backups stored on blocks: | Superblock backups stored on blocks: | ||
- | 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 | + | |
Allocating group tables: done | Allocating group tables: done | ||
Ligne 1339: | Ligne 1440: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# mkfs.ext4 --help |
mkfs.ext4: invalid option -- ' | mkfs.ext4: invalid option -- ' | ||
Usage: mkfs.ext4 [-c|-l filename] [-b block-size] [-C cluster-size] | Usage: mkfs.ext4 [-c|-l filename] [-b block-size] [-C cluster-size] | ||
- | [-i bytes-per-inode] [-I inode-size] [-J journal-options] | + | |
- | [-G flex-group-size] [-N number-of-inodes] [-d root-directory] | + | [-G flex-group-size] [-N number-of-inodes] [-d root-directory] |
- | [-m reserved-blocks-percentage] [-o creator-os] | + | [-m reserved-blocks-percentage] [-o creator-os] |
- | [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] | + | [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] |
- | [-O feature[, | + | [-O feature[, |
- | [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] | + | [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] |
- | [-jnqvDFSV] device [blocks-count] | + | [-jnqvDFSV] device [blocks-count] |
</ | </ | ||
Ligne 1354: | Ligne 1455: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# dumpe2fs /dev/sdc11 | more |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | dumpe2fs 1.46.2 (28-Feb-2021) |
Filesystem volume name: < | Filesystem volume name: < | ||
Last mounted on: <not available> | Last mounted on: <not available> | ||
- | Filesystem UUID: | + | Filesystem UUID: |
Filesystem magic number: | Filesystem magic number: | ||
Filesystem revision #: 1 (dynamic) | Filesystem revision #: 1 (dynamic) | ||
- | Filesystem features: | + | Filesystem features: |
- | xtent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize | + | 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize |
- | data_csum | + | |
Filesystem flags: | Filesystem flags: | ||
Default mount options: | Default mount options: | ||
Ligne 1372: | Ligne 1472: | ||
Block count: | Block count: | ||
Reserved block count: | Reserved block count: | ||
+ | Overhead clusters: | ||
Free blocks: | Free blocks: | ||
Free inodes: | Free inodes: | ||
Ligne 1380: | Ligne 1481: | ||
Reserved GDT blocks: | Reserved GDT blocks: | ||
--More-- | --More-- | ||
+ | [q] | ||
</ | </ | ||
Ligne 1387: | Ligne 1489: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# e2label /dev/sdc11 my_ext4 |
- | [root@centos8 | + | root@debian11:~# dumpe2fs /dev/sdc11 | more |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | dumpe2fs 1.46.2 (28-Feb-2021) |
Filesystem volume name: | Filesystem volume name: | ||
Last mounted on: <not available> | Last mounted on: <not available> | ||
- | Filesystem UUID: | + | Filesystem UUID: |
Filesystem magic number: | Filesystem magic number: | ||
Filesystem revision #: 1 (dynamic) | Filesystem revision #: 1 (dynamic) | ||
- | Filesystem features: | + | Filesystem features: |
- | xtent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize | + | 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize |
- | data_csum | + | |
Filesystem flags: | Filesystem flags: | ||
Default mount options: | Default mount options: | ||
Ligne 1406: | Ligne 1507: | ||
Block count: | Block count: | ||
Reserved block count: | Reserved block count: | ||
+ | Overhead clusters: | ||
Free blocks: | Free blocks: | ||
Free inodes: | Free inodes: | ||
Ligne 1414: | Ligne 1516: | ||
Reserved GDT blocks: | Reserved GDT blocks: | ||
--More-- | --More-- | ||
+ | [q] | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Notez que l' | **Important** - Notez que l' | ||
</ | </ | ||
- | Créez un point de montage dans **/mnt** et essayez de monter **/dev/sdb11** en tant qu' | + | Créez un point de montage dans **/mnt** et essayez de monter **/dev/sdc11** en tant qu' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mkdir /mnt/sdc11 |
- | [root@centos8 | + | root@debian11:~# mount -t ext3 /dev/sdc11 /mnt/sdc11 |
- | mount: /mnt/sdb11: wrong fs type, bad option, bad superblock on /dev/sdb11, missing codepage or helper program, or other error.. | + | mount: /mnt/sdc11: wrong fs type, bad option, bad superblock on /dev/sdc11, missing codepage or helper program, or other error. |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Notez l' | **Important** - Notez l' | ||
</ | </ | ||
Ligne 1436: | Ligne 1539: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# mount /dev/sdc11 /mnt/sdc11 |
- | [root@centos8 | + | root@debian11:~# mount | grep sdc11 |
- | /dev/sdb11 on /mnt/sdb11 type ext4 (rw, | + | /dev/sdc11 on /mnt/sdc11 type ext4 (rw, |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Constatez que la partition a été monté en tant qu' | **Important** - Constatez que la partition a été monté en tant qu' | ||
</ | </ | ||
Ligne 1448: | Ligne 1551: | ||
===LAB #10 - Convertir un Système de Fichiers Ext3 en Ext4=== | ===LAB #10 - Convertir un Système de Fichiers Ext3 en Ext4=== | ||
- | Créez un système de fichiers ext3 sur /dev/sdb12 : | + | Créez un système de fichiers ext3 sur /dev/sdc12 : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mkfs.ext3 /dev/sdc12 |
- | mke2fs 1.45.6 (20-Mar-2020) | + | mke2fs 1.46.2 (28-Feb-2021) |
- | /dev/sdb12 contains a ext3 file system | + | /dev/sdc12 contains a ext3 file system |
- | created on Wed Jun 2 08:10:40 2021 | + | created on Wed Apr 27 11:57:30 2022 |
Proceed anyway? (y,N) y | Proceed anyway? (y,N) y | ||
+ | Discarding device blocks: done | ||
Creating filesystem with 204800 1k blocks and 51200 inodes | Creating filesystem with 204800 1k blocks and 51200 inodes | ||
- | Filesystem UUID: b73322d4-f2e4-43bc-96ae-422d4584f3de | + | Filesystem UUID: 62cb630b-25d5-4ca0-bbab-e855fba96a80 |
Superblock backups stored on blocks: | Superblock backups stored on blocks: | ||
- | 8193, 24577, 40961, 57345, 73729 | + | |
Allocating group tables: done | Allocating group tables: done | ||
Writing inode tables: done | Writing inode tables: done | ||
Creating journal (4096 blocks): done | Creating journal (4096 blocks): done | ||
- | Writing superblocks and filesystem accounting information: | + | Writing superblocks and filesystem accounting information: |
</ | </ | ||
- | Montez maintenant **/dev/sdb12** sur /mnt/sdb12 : | + | Montez maintenant **/dev/sdc12** sur /mnt/sdc12 : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mount /dev/sdc12 /mnt/sdc12 |
- | [root@centos8 | + | root@debian11:~# ls -l /mnt/sdc12 |
total 12 | total 12 | ||
- | drwx------. 2 root root 12288 Jun 2 08:42 lost+found | + | drwx------ 2 root root 12288 Apr 27 12:11 lost+found |
</ | </ | ||
- | Créez le fichier **/mnt/sdb12/ | + | Créez le fichier **/mnt/sdc12/ |
< | < | ||
- | [root@centos8 | + | root@debian11:~# touch /mnt/sdc12/check_file |
</ | </ | ||
- | Injectez la chaine **check file** dans le fichier /mnt/sdb12/check_file puis démontez /dev/sdb12 : | + | Injectez la chaine **check file** dans le fichier /mnt/sdc12/check_file puis démontez /dev/sdc12 : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# echo "check file" > /mnt/sdc12/check_file |
- | [root@centos8 | + | root@debian11:~# umount /mnt/sdc12 |
</ | </ | ||
- | Exécutez e2fsck sur /dev/sda12 : | + | Exécutez e2fsck sur /dev/sdc12 : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# e2fsck /dev/sdc12 |
- | e2fsck 1.45.6 (20-Mar-2020) | + | e2fsck 1.46.2 (28-Feb-2021) |
- | /dev/sdb12: clean, 12/51200 files, | + | /dev/sdc12: clean, 12/51200 files, |
</ | </ | ||
- | Convertissez /dev/sdb12 en Ext4 : | + | Convertissez /dev/sdc12 en Ext4 : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# tune2fs -O extents, |
- | tune2fs 1.45.6 (20-Mar-2020) | + | tune2fs 1.46.2 (28-Feb-2021) |
</ | </ | ||
Ligne 1509: | Ligne 1613: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# e2fsck -fDC0 /dev/sdc12 |
- | e2fsck 1.45.6 (20-Mar-2020) | + | e2fsck 1.46.2 (28-Feb-2021) |
Pass 1: Checking inodes, blocks, and sizes | Pass 1: Checking inodes, blocks, and sizes | ||
Pass 2: Checking directory structure | Pass 2: Checking directory structure | ||
Ligne 1518: | Ligne 1622: | ||
Pass 5: Checking group summary information | Pass 5: Checking group summary information | ||
| | ||
- | /dev/sdb12: ***** FILE SYSTEM WAS MODIFIED ***** | + | /dev/sdc12: ***** FILE SYSTEM WAS MODIFIED ***** |
- | /dev/sdb12: 12/51200 files (0.0% non-contiguous), | + | /dev/sdc12: 12/51200 files (0.0% non-contiguous), |
</ | </ | ||
- | Essayez de monter **/dev/sdb12** en tant qu' | + | Essayez de monter **/dev/sdc12** en tant qu' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mount -t ext3 /dev/sdc12 /mnt/sdc12 |
- | mount: /mnt/sdb12: wrong fs type, bad option, bad superblock on /dev/sdb12, missing codepage or helper program, or other error. | + | mount: /mnt/sdc12: wrong fs type, bad option, bad superblock on /dev/sdc12, missing codepage or helper program, or other error. |
</ | </ | ||
- | Montez /dev/sdb12 sans spécifier le type de fichiers Ext3 et vérifiez le contenu du fichier **check_file** : | + | Montez /dev/sdc12 sans spécifier le type de fichiers Ext3 et vérifiez le contenu du fichier **check_file** : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mount /dev/sdc12 /mnt/sdc12 |
- | [root@centos8 | + | root@debian11:~# ls -l /mnt/sdc12 |
- | total 14 | + | total 13 |
- | -rw-r--r--. 1 root root 11 Jun 2 08:45 check_file | + | -rw-r--r-- 1 root root 11 Apr 27 12:15 check_file |
- | drwx------. 2 root root 12288 Jun 2 08:42 lost+found | + | drwx------ 2 root root 12288 Apr 27 12:11 lost+found |
- | [root@centos8 | + | root@debian11:~# cat /mnt/sdc12/check_file |
check file | check file | ||
</ | </ | ||
Ligne 1546: | Ligne 1650: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# dumpe2fs /dev/sdc11 | grep UUID |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | dumpe2fs 1.46.2 (28-Feb-2021) |
- | Filesystem UUID: | + | Filesystem UUID: |
- | [root@centos8 | + | root@debian11:~# dumpe2fs /dev/sdc12 | grep UUID |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | dumpe2fs 1.46.2 (28-Feb-2021) |
- | Filesystem UUID: | + | Filesystem UUID: |
</ | </ | ||
====XFS==== | ====XFS==== | ||
- | XFS est un système de fichiers 64-bit journalisé de haute performance crée par SGI pour son système d' | + | XFS est un système de fichiers 64-bit journalisé de haute performance crée par SGI pour son système d' |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : Le système de fichiers XFS permet l' | + | |
- | </ | + | |
Pour plus d' | Pour plus d' | ||
Ligne 1567: | Ligne 1667: | ||
===LAB #11 - Créer un Système de Fichiers XFS=== | ===LAB #11 - Créer un Système de Fichiers XFS=== | ||
- | Démontez | + | Installez le paquet |
< | < | ||
- | [root@centos8 | + | root@debian11:~# apt-get -y install xfsprogs |
</ | </ | ||
- | Créez un système de fichiers XFS sur la partition **/dev/sdb12** : | + | Créez un système de fichiers XFS sur la partition **/dev/sdc10** : |
< | < | ||
- | [root@centos8 | + | root@debian11:~# mkfs.xfs /dev/sdc10 |
- | meta-data=/ | + | meta-data=/ |
| | ||
| | ||
- | | + | |
- | data | + | data |
| | ||
naming | naming | ||
Ligne 1587: | Ligne 1687: | ||
| | ||
realtime =none | realtime =none | ||
- | </ | + | Discarding blocks...Done. |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - Notez l' | + | |
- | </ | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# mkfs.xfs --help | + | |
- | mkfs.xfs: invalid option -- ' | + | |
- | unknown option -- | + | |
- | Usage: mkfs.xfs | + | |
- | /* blocksize */ [-b size=num] | + | |
- | /* metadata */ [-m crc=0|1, | + | |
- | /* data subvol */ [-d agcount=n, | + | |
- | (sunit=value, | + | |
- | sectsize=num | + | |
- | /* force overwrite */ [-f] | + | |
- | /* inode size */ [-i log=n|perblock=n|size=num, | + | |
- | projid32bit=0|1, | + | |
- | /* no discard */ [-K] | + | |
- | /* log subvol */ [-l agnum=n, | + | |
- | sunit=value|su=num, | + | |
- | /* label */ [-L label (maximum 12 characters)] | + | |
- | /* naming */ [-n size=num, | + | |
- | /* no-op info only */ [-N] | + | |
- | /* prototype file */ [-p fname] | + | |
- | /* quiet */ [-q] | + | |
- | /* realtime subvol */ [-r extsize=num, | + | |
- | /* sectorsize */ [-s size=num] | + | |
- | /* version */ [-V] | + | |
- | devicename | + | |
- | < | + | |
- | <num> is xxx (bytes), xxxs (sectors), xxxb (fs blocks), xxxk (xxx KiB), | + | |
- | xxxm (xxx MiB), xxxg (xxx GiB), xxxt (xxx TiB) or xxxp (xxx PiB). | + | |
- | < | + | |
</ | </ | ||
Ligne 1629: | Ligne 1693: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# xfs_info /dev/sdc10 |
- | meta-data=/ | + | meta-data=/ |
| | ||
| | ||
- | | + | |
- | data | + | data |
| | ||
naming | naming | ||
Ligne 1640: | Ligne 1704: | ||
| | ||
realtime =none | realtime =none | ||
- | </ | ||
- | |||
- | Les options de cette commande sont : | ||
- | |||
- | < | ||
- | [root@centos8 ~]# xfs_info --help | ||
- | / | ||
- | Usage: xfs_info [-V] [-t mtab] [mountpoint|device|file] | ||
</ | </ | ||
Ligne 1655: | Ligne 1711: | ||
< | < | ||
- | [root@centos8 ~]# xfs_admin -L my_xfs / | + | root@debian11:~# xfs_admin -L my_xfs /dev/sdc10 |
- | xfs_admin: /dev/sdb12 contains a mounted filesystem | + | |
- | + | ||
- | fatal error -- couldn' | + | |
- | + | ||
- | [root@centos8 ~]# umount / | + | |
- | + | ||
- | [root@centos8 | + | |
writing all SBs | writing all SBs | ||
new label = " | new label = " | ||
</ | </ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | **Important** - Notez que la partition XFS doit être démonté pour pouvoir utiliser la commande **xfs_admin**. | ||
- | </ | ||
Pour voir l' | Pour voir l' | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# xfs_admin -l /dev/sdc10 |
label = " | label = " | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Notez que l' | **Important** - Notez que l' | ||
</ | </ | ||
- | |||
- | Les options de cette commande sont : | ||
- | |||
- | < | ||
- | [root@centos8 ~]# xfs_admin --help | ||
- | / | ||
- | Usage: xfs_admin [-efjlpuV] [-c 0|1] [-L label] [-U uuid] device | ||
- | </ | ||
Dernièrement, | Dernièrement, | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# xfs_admin -u /dev/sdc10 |
- | UUID = 15db1b62-0866-4aa4-9ac1-3ac325a4e20f | + | UUID = b4d2c2c3-94bc-4408-8284-5b09ab60204e |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - La commande **xfs_metadump** est utilisée pour sauvegarder les méta-données du système de fichiers, tandis que la commande **xfs_mdrestore** est utilisée pour restaurer les les méta-données du système de fichiers. | **Important** - La commande **xfs_metadump** est utilisée pour sauvegarder les méta-données du système de fichiers, tandis que la commande **xfs_mdrestore** est utilisée pour restaurer les les méta-données du système de fichiers. | ||
- | </ | ||
- | |||
- | =====Autres Systèmes de Fichiers===== | ||
- | |||
- | <WRAP center round important 60%> | ||
- | **Important** - Veuillez noter que le support des systèmes de fichiers **ReiserFS**, | ||
</ | </ | ||
Ligne 1715: | Ligne 1746: | ||
Pour plus d' | Pour plus d' | ||
+ | |||
+ | Avant de continuer, installer le paquet **reiserfsprogs** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | ===LAB #13 - Créer un Système de Fichiers ReiserFS=== | ||
+ | |||
+ | Créez un système de fichiers ReiserFS sur la partition **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | mkfs.reiserfs 3.6.27 | ||
+ | |||
+ | Guessing about desired format.. Kernel 5.10.0-13-amd64 is running. | ||
+ | Format 3.6 with standard journal | ||
+ | Count of blocks on the device: 128000 | ||
+ | Number of blocks consumed by mkreiserfs formatting process: 8215 | ||
+ | Blocksize: 4096 | ||
+ | Hash function used to sort names: " | ||
+ | Journal Size 8193 blocks (first block 18) | ||
+ | Journal Max transaction length 1024 | ||
+ | inode generation number: 0 | ||
+ | UUID: 95c81e34-2215-4b96-be47-e5368444f19a | ||
+ | ATTENTION: YOU SHOULD REBOOT AFTER FDISK! | ||
+ | ALL DATA WILL BE LOST ON '/ | ||
+ | Continue (y/n):y | ||
+ | Initializing journal - 0%....20%....40%....60%....80%....100% | ||
+ | Syncing..ok | ||
+ | ReiserFS is successfully created on /dev/sdc8. | ||
+ | </ | ||
+ | |||
+ | Consultez maintenant les caractéristiques du système de fichier : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | debugreiserfs 3.6.27 | ||
+ | |||
+ | |||
+ | Filesystem state: consistent | ||
+ | |||
+ | Reiserfs super block in block 16 on 0x828 of format 3.6 with standard journal | ||
+ | Count of blocks on the device: 128000 | ||
+ | Number of bitmaps: 4 | ||
+ | Blocksize: 4096 | ||
+ | Free blocks (count of blocks - used [journal, bitmaps, data, reserved] blocks): 119785 | ||
+ | Root block: 8211 | ||
+ | Filesystem is clean | ||
+ | Tree height: 2 | ||
+ | Hash function used to sort names: " | ||
+ | Objectid map size 2, max 972 | ||
+ | Journal parameters: | ||
+ | Device [0x0] | ||
+ | Magic [0x345d673e] | ||
+ | Size 8193 blocks (including 1 for journal header) (first block 18) | ||
+ | Max transaction length 1024 blocks | ||
+ | Max batch size 900 blocks | ||
+ | Max commit age 30 | ||
+ | Blocks reserved by journal: 0 | ||
+ | Fs state field: 0x0: | ||
+ | sb_version: 2 | ||
+ | inode generation number: 0 | ||
+ | UUID: 95c81e34-2215-4b96-be47-e5368444f19a | ||
+ | LABEL: | ||
+ | Set flags in SB: | ||
+ | ATTRIBUTES CLEAN | ||
+ | Mount count: 1 | ||
+ | Maximum mount count: 30 | ||
+ | Last fsck run: Wed Apr 27 13:37:02 2022 | ||
+ | Check interval in days: 180 | ||
+ | </ | ||
+ | |||
+ | ===LAB #14 - Ajouter une Etiquette au Système de Fichiers ReiserFS=== | ||
+ | |||
+ | Utilisez la commande **reiserfstune** pour associer une étiquette au système de fichiers : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | reiserfstune: | ||
+ | |||
+ | Current parameters: | ||
+ | |||
+ | Filesystem state: consistent | ||
+ | |||
+ | Reiserfs super block in block 16 on 0x828 of format 3.6 with standard journal | ||
+ | Count of blocks on the device: 128000 | ||
+ | Number of bitmaps: 4 | ||
+ | Blocksize: 4096 | ||
+ | Free blocks (count of blocks - used [journal, bitmaps, data, reserved] blocks): 119785 | ||
+ | Root block: 8211 | ||
+ | Filesystem is clean | ||
+ | Tree height: 2 | ||
+ | Hash function used to sort names: " | ||
+ | Objectid map size 2, max 972 | ||
+ | Journal parameters: | ||
+ | Device [0x0] | ||
+ | Magic [0x345d673e] | ||
+ | Size 8193 blocks (including 1 for journal header) (first block 18) | ||
+ | Max transaction length 1024 blocks | ||
+ | Max batch size 900 blocks | ||
+ | Max commit age 30 | ||
+ | Blocks reserved by journal: 0 | ||
+ | Fs state field: 0x0: | ||
+ | sb_version: 2 | ||
+ | inode generation number: 0 | ||
+ | UUID: 95c81e34-2215-4b96-be47-e5368444f19a | ||
+ | LABEL: my_reiserfs | ||
+ | Set flags in SB: | ||
+ | ATTRIBUTES CLEAN | ||
+ | Mount count: 1 | ||
+ | Maximum mount count: 30 | ||
+ | Last fsck run: Wed Apr 27 13:37:02 2022 | ||
+ | Check interval in days: 180 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** - Notez que l' | ||
+ | </ | ||
+ | |||
+ | Dernièrement, | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | debugreiserfs 3.6.27 | ||
+ | |||
+ | UUID: 95c81e34-2215-4b96-be47-e5368444f19a | ||
+ | </ | ||
====JFS==== | ====JFS==== | ||
Ligne 1721: | Ligne 1880: | ||
Pour plus d' | Pour plus d' | ||
+ | |||
+ | Avant de continuer, installer le paquet **jfsutils** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | ===LAB #21 - Créer un Système de Fichiers JFS=== | ||
+ | |||
+ | Créez un système de fichiers JFS sur **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | mkfs.jfs version 1.1.15, 04-Mar-2011 | ||
+ | Warning! | ||
+ | |||
+ | Continue? (Y/N) y | ||
+ | | | ||
+ | |||
+ | Format completed successfully. | ||
+ | |||
+ | 512000 kilobytes total disk space. | ||
+ | </ | ||
+ | |||
+ | Consultez maintenant les caractéristiques du système de fichier : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | jfs_tune version 1.1.15, 04-Mar-2011 | ||
+ | |||
+ | JFS filesystem superblock: | ||
+ | |||
+ | JFS magic number: | ||
+ | JFS version: | ||
+ | JFS state: | ||
+ | JFS flags: | ||
+ | Aggregate block size: 4096 bytes | ||
+ | Aggregate size: | ||
+ | Physical block size: 512 bytes | ||
+ | Allocation group size: 8192 aggregate blocks | ||
+ | Log device number: | ||
+ | Filesystem creation: | ||
+ | Volume label: | ||
+ | </ | ||
+ | |||
+ | ===LAB #15 - Ajouter une Etiquette au Système de Fichiers JFS=== | ||
+ | |||
+ | Utilisez la commande **jfs_tune** pour associer une étiquette au système de fichiers : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | jfs_tune version 1.1.15, 04-Mar-2011 | ||
+ | Volume label updated successfully. | ||
+ | |||
+ | root@debian11: | ||
+ | jfs_tune version 1.1.15, 04-Mar-2011 | ||
+ | |||
+ | JFS filesystem superblock: | ||
+ | |||
+ | JFS magic number: | ||
+ | JFS version: | ||
+ | JFS state: | ||
+ | JFS flags: | ||
+ | Aggregate block size: 4096 bytes | ||
+ | Aggregate size: | ||
+ | Physical block size: 512 bytes | ||
+ | Allocation group size: 8192 aggregate blocks | ||
+ | Log device number: | ||
+ | Filesystem creation: | ||
+ | Volume label: | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** - Notez que l' | ||
+ | </ | ||
+ | |||
+ | Créez maintenant un UUID pour le système de fichiers : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | jfs_tune version 1.1.15, 04-Mar-2011 | ||
+ | UUID updated successfully. | ||
+ | </ | ||
+ | |||
+ | Dernièrement, | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | File system UUID: | ||
+ | External log UUID: 00000000-0000-0000-d01e-21e2fe7f0000 | ||
+ | </ | ||
====Btrfs==== | ====Btrfs==== | ||
Ligne 1735: | Ligne 1985: | ||
* Btrfs gère le RAID 0 ainsi que le RAID 1 logiciel, | * Btrfs gère le RAID 0 ainsi que le RAID 1 logiciel, | ||
* Btrfs gère la comprssion du système de fichiers. | * Btrfs gère la comprssion du système de fichiers. | ||
+ | |||
+ | Avant de continuer, installer le paquet **btrfs-progs** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | ===LAB #16 - Créer un Système de Fichiers Btrfs=== | ||
+ | |||
+ | Créez un système de fichiers Btrfs sur **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | btrfs-progs v5.10.1 | ||
+ | See http:// | ||
+ | |||
+ | /dev/sdc5 appears to contain an existing filesystem (jfs). | ||
+ | ERROR: use the -f option to force overwrite of /dev/sdc5 | ||
+ | |||
+ | root@debian11: | ||
+ | btrfs-progs v5.10.1 | ||
+ | See http:// | ||
+ | |||
+ | Label: | ||
+ | UUID: | ||
+ | Node size: 16384 | ||
+ | Sector size: 4096 | ||
+ | Filesystem size: 500.00MiB | ||
+ | Block group profiles: | ||
+ | Data: | ||
+ | Metadata: | ||
+ | System: | ||
+ | SSD detected: | ||
+ | Incompat features: | ||
+ | Runtime features: | ||
+ | Checksum: | ||
+ | Number of devices: | ||
+ | Devices: | ||
+ | | ||
+ | 1 | ||
+ | </ | ||
+ | |||
+ | Montez la partition btrfs sur /mnt : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | /dev/sdc5 on /mnt type btrfs (rw, | ||
+ | </ | ||
+ | |||
+ | Sous Btrfs, il est possible de créer des sous volumes. Pour comprendre, comparez notre partition Btrfs à un VG et des sous volumes comme des LV : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Create subvolume '/ | ||
+ | |||
+ | root@debian11: | ||
+ | ID 256 gen 7 top level 5 path volume1 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** - L'ID identifie le volume d'une manière unique. | ||
+ | </ | ||
+ | |||
+ | ===LAB #17 - Convertir un Système de Fichiers Ext4 en Brtfs=== | ||
+ | |||
+ | Créez un système de fichiers Ext4 sur **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | mke2fs 1.46.2 (28-Feb-2021) | ||
+ | /dev/sdc10 contains a ext4 file system | ||
+ | created on Thu Apr 28 05:36:22 2022 | ||
+ | Proceed anyway? (y,N) y | ||
+ | Discarding device blocks: done | ||
+ | Creating filesystem with 128000 4k blocks and 128000 inodes | ||
+ | Filesystem UUID: 592f92f2-9d1b-40bf-89b3-24b35b59621b | ||
+ | Superblock backups stored on blocks: | ||
+ | 32768, 98304 | ||
+ | |||
+ | Allocating group tables: done | ||
+ | Writing inode tables: done | ||
+ | Creating journal (4096 blocks): done | ||
+ | Writing superblocks and filesystem accounting information: | ||
+ | </ | ||
+ | |||
+ | Convertissez maintenant le systèm de fichiers Ext4 en Btrfs : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | create btrfs filesystem: | ||
+ | blocksize: 4096 | ||
+ | nodesize: | ||
+ | features: | ||
+ | checksum: | ||
+ | free space report: | ||
+ | total: | ||
+ | free: 390004736 (74.39%) | ||
+ | creating ext2 image file | ||
+ | creating btrfs metadata | ||
+ | copy inodes [o] [ | ||
+ | conversion complete | ||
+ | </ | ||
+ | |||
+ | Visualisez les systèmes de fichiers Btrfs : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Label: none uuid: 6030b3a7-a3f0-4af8-b00e-988e43c91784 | ||
+ | Total devices 1 FS bytes used 144.00KiB | ||
+ | devid 1 size 500.00MiB used 88.00MiB path /dev/sdc5 | ||
+ | |||
+ | Label: none uuid: ebdf4e62-3dc5-4bd3-8dc2-988ad5e680e8 | ||
+ | Total devices 1 FS bytes used 32.62MiB | ||
+ | devid 1 size 500.00MiB used 163.00MiB path /dev/sdc10 | ||
+ | </ | ||
+ | |||
+ | Ajouter la partition /dev/sdc10 à /mnt : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | /dev/sdc10 appears to contain an existing filesystem (btrfs). | ||
+ | |||
+ | ERROR: use the -f option to force overwrite of /dev/sdc10 | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | Filesystem | ||
+ | udev 1.9G | ||
+ | tmpfs | ||
+ | / | ||
+ | tmpfs | ||
+ | tmpfs | ||
+ | tmpfs | ||
+ | tmpfs | ||
+ | / | ||
+ | |||
+ | root@debian11: | ||
+ | Label: none uuid: 6030b3a7-a3f0-4af8-b00e-988e43c91784 | ||
+ | Total devices 2 FS bytes used 144.00KiB | ||
+ | devid 1 size 500.00MiB used 88.00MiB path /dev/sdc5 | ||
+ | devid 2 size 500.00MiB used 0.00B path /dev/sdc10 | ||
+ | |||
+ | root@debian11: | ||
+ | Data, single: total=8.00MiB, | ||
+ | System, DUP: total=8.00MiB, | ||
+ | Metadata, DUP: total=32.00MiB, | ||
+ | GlobalReserve, | ||
+ | </ | ||
+ | |||
+ | ===LAB #18 - Créer un Snapshot=== | ||
+ | |||
+ | Creéz un snapshot du volume /mnt : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Create a snapshot of '/ | ||
+ | |||
+ | root@debian11: | ||
+ | total 16 | ||
+ | drwxr-xr-x 1 root root 14 Apr 28 05:31 snapshot | ||
+ | drwxr-xr-x 1 root root 0 Apr 28 05:33 volume1 | ||
+ | </ | ||
+ | |||
+ | Démontez le système de fichiers btrfs : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | Montez ensuite le snapshot : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | total 0 | ||
+ | drwxr-xr-x 1 root root 0 Apr 28 05:46 volume1 | ||
+ | |||
+ | root@debian11: | ||
+ | Data, single: total=8.00MiB, | ||
+ | System, DUP: total=8.00MiB, | ||
+ | Metadata, DUP: total=32.00MiB, | ||
+ | GlobalReserve, | ||
+ | </ | ||
+ | |||
+ | ===LAB #19 - Ajouter une Etiquette au Système de Fichiers Btrfs=== | ||
+ | |||
+ | Pour voir les caractéristques du système de fichiers Btrfs, utilisez la commande suivante : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | superblock: bytenr=65536, | ||
+ | --------------------------------------------------------- | ||
+ | csum_type | ||
+ | csum_size | ||
+ | csum 0xc63d381f [match] | ||
+ | bytenr | ||
+ | flags 0x1 | ||
+ | ( WRITTEN ) | ||
+ | magic | ||
+ | fsid 6030b3a7-a3f0-4af8-b00e-988e43c91784 | ||
+ | metadata_uuid | ||
+ | label | ||
+ | generation | ||
+ | root 30441472 | ||
+ | sys_array_size | ||
+ | chunk_root_generation | ||
+ | root_level | ||
+ | chunk_root | ||
+ | chunk_root_level | ||
+ | log_root | ||
+ | log_root_transid | ||
+ | log_root_level | ||
+ | total_bytes | ||
+ | bytes_used | ||
+ | sectorsize | ||
+ | nodesize | ||
+ | leafsize (deprecated) | ||
+ | stripesize | ||
+ | root_dir | ||
+ | num_devices | ||
+ | compat_flags | ||
+ | compat_ro_flags | ||
+ | incompat_flags | ||
+ | ( MIXED_BACKREF | | ||
+ | EXTENDED_IREF | | ||
+ | SKINNY_METADATA ) | ||
+ | cache_generation | ||
+ | uuid_tree_generation | ||
+ | dev_item.uuid | ||
+ | dev_item.fsid | ||
+ | dev_item.type | ||
+ | dev_item.total_bytes | ||
+ | dev_item.bytes_used | ||
+ | dev_item.io_align | ||
+ | dev_item.io_width | ||
+ | dev_item.sector_size | ||
+ | dev_item.devid | ||
+ | dev_item.dev_group | ||
+ | dev_item.seek_speed | ||
+ | dev_item.bandwidth | ||
+ | dev_item.generation | ||
+ | </ | ||
+ | |||
+ | Créez un une etiquette avec la commande **btrfs filesystem label** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | superblock: bytenr=65536, | ||
+ | --------------------------------------------------------- | ||
+ | csum_type | ||
+ | csum_size | ||
+ | csum 0x981c9953 [match] | ||
+ | bytenr | ||
+ | flags 0x1 | ||
+ | ( WRITTEN ) | ||
+ | magic | ||
+ | fsid 6030b3a7-a3f0-4af8-b00e-988e43c91784 | ||
+ | metadata_uuid | ||
+ | label | ||
+ | generation | ||
+ | root 30523392 | ||
+ | sys_array_size | ||
+ | chunk_root_generation | ||
+ | root_level | ||
+ | chunk_root | ||
+ | chunk_root_level | ||
+ | log_root | ||
+ | log_root_transid | ||
+ | log_root_level | ||
+ | total_bytes | ||
+ | bytes_used | ||
+ | sectorsize | ||
+ | nodesize | ||
+ | leafsize (deprecated) | ||
+ | stripesize | ||
+ | root_dir | ||
+ | num_devices | ||
+ | compat_flags | ||
+ | compat_ro_flags | ||
+ | incompat_flags | ||
+ | ( MIXED_BACKREF | | ||
+ | EXTENDED_IREF | | ||
+ | SKINNY_METADATA ) | ||
+ | cache_generation | ||
+ | uuid_tree_generation | ||
+ | dev_item.uuid | ||
+ | dev_item.fsid | ||
+ | dev_item.type | ||
+ | dev_item.total_bytes | ||
+ | dev_item.bytes_used | ||
+ | dev_item.io_align | ||
+ | dev_item.io_width | ||
+ | dev_item.sector_size | ||
+ | dev_item.devid | ||
+ | dev_item.dev_group | ||
+ | dev_item.seek_speed | ||
+ | dev_item.bandwidth | ||
+ | dev_item.generation | ||
+ | </ | ||
+ | |||
+ | Démontez le système de fichiers btrfs : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
=====Comparaison des Commandes par Système de Fichiers===== | =====Comparaison des Commandes par Système de Fichiers===== | ||
Ligne 1746: | Ligne 2306: | ||
| File system debugger | debugfs | debugfs | xfs_db | debugreiserfs | jfs_debugfs | btrfs-debug-tree | | | File system debugger | debugfs | debugfs | xfs_db | debugreiserfs | jfs_debugfs | btrfs-debug-tree | | ||
| Change the label on a filesystem | e2label | e2label | xfs_admin | reiserfstune | jfs_tune | btrfs filesystem label | | | Change the label on a filesystem | e2label | e2label | xfs_admin | reiserfstune | jfs_tune | btrfs filesystem label | | ||
+ | |||
+ | =====Systèmes de Fichiers Chiffrés===== | ||
+ | |||
+ | ====LAB #20 - Créer un Système de Fichiers Chiffré avec encryptfs===== | ||
+ | |||
+ | Commencez par installer le paquet **ecryptfs-utils** dans la machine virtuelle Debian 11 : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | Remontez /mnt/sdc12 sur lui-même en spécifiant le type de fichiers en tant qu' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Select key type to use for newly created files: | ||
+ | 1) tspi | ||
+ | 2) passphrase | ||
+ | Selection: 2 | ||
+ | Passphrase: | ||
+ | Select cipher: | ||
+ | 1) aes: blocksize = 16; min keysize = 16; max keysize = 32 | ||
+ | 2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56 | ||
+ | 3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24 | ||
+ | 4) twofish: blocksize = 16; min keysize = 16; max keysize = 32 | ||
+ | 5) cast6: blocksize = 16; min keysize = 16; max keysize = 32 | ||
+ | 6) cast5: blocksize = 8; min keysize = 5; max keysize = 16 | ||
+ | Selection [aes]: 1 | ||
+ | Select key bytes: | ||
+ | 1) 16 | ||
+ | 2) 32 | ||
+ | 3) 24 | ||
+ | Selection [16]: 1 | ||
+ | Enable plaintext passthrough (y/n) [n]: n | ||
+ | Enable filename encryption (y/n) [n]: y | ||
+ | Filename Encryption Key (FNEK) Signature [91aefde99b5a4977]: | ||
+ | Attempting to mount with the following options: | ||
+ | ecryptfs_unlink_sigs | ||
+ | ecryptfs_fnek_sig=91aefde99b5a4977 | ||
+ | ecryptfs_key_bytes=16 | ||
+ | ecryptfs_cipher=aes | ||
+ | ecryptfs_sig=91aefde99b5a4977 | ||
+ | WARNING: Based on the contents of [/ | ||
+ | it looks like you have never mounted with this key | ||
+ | before. This could mean that you have typed your | ||
+ | passphrase wrong. | ||
+ | |||
+ | Would you like to proceed with the mount (yes/no)? : yes | ||
+ | Would you like to append sig [91aefde99b5a4977] to | ||
+ | [/ | ||
+ | in order to avoid this warning in the future (yes/no)? : yes | ||
+ | Successfully appended new sig to user sig cache file | ||
+ | Mounted eCryptfs | ||
+ | </ | ||
+ | |||
+ | Ce montage est visible dans la sortie de la commande **df** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Filesystem | ||
+ | udev 1.9G | ||
+ | tmpfs | ||
+ | / | ||
+ | tmpfs | ||
+ | tmpfs | ||
+ | tmpfs | ||
+ | / | ||
+ | / | ||
+ | tmpfs | ||
+ | </ | ||
+ | |||
+ | Plus de détails sont visibles avec la commande **mount** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | mqueue on /dev/mqueue type mqueue (rw, | ||
+ | hugetlbfs on / | ||
+ | debugfs on / | ||
+ | configfs on / | ||
+ | fusectl on / | ||
+ | tmpfs on / | ||
+ | /dev/sdc11 on /mnt/sdc11 type ext4 (rw, | ||
+ | /dev/sdc12 on /mnt/sdc12 type ext4 (rw, | ||
+ | tmpfs on / | ||
+ | /mnt/sdc12 on /mnt/sdc12 type ecryptfs (rw, | ||
+ | </ | ||
+ | |||
+ | Créez maintenant le fichier **encrypt** contenant la chaîne de caractères **fenestros** dans /mnt/sdc12 : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | fenestros | ||
+ | </ | ||
+ | |||
+ | Démontez maintenant /mnt/sdc12 : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | tracefs on / | ||
+ | mqueue on /dev/mqueue type mqueue (rw, | ||
+ | hugetlbfs on / | ||
+ | debugfs on / | ||
+ | configfs on / | ||
+ | fusectl on / | ||
+ | tmpfs on / | ||
+ | /dev/sdc11 on /mnt/sdc11 type ext4 (rw, | ||
+ | /dev/sdc12 on /mnt/sdc12 type ext4 (rw, | ||
+ | tmpfs on / | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** : Notez que /dev/sdc12 est toujours monté sur /mnt/sdc12. | ||
+ | </ | ||
+ | |||
+ | Constatez maintenant le contenu de /mnt/sdc12 : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | total 25 | ||
+ | -rw-r--r-- 1 root root 11 Apr 27 12:15 check_file | ||
+ | -rw-r--r-- 1 root root 12288 Apr 28 06:12 ECRYPTFS_FNEK_ENCRYPTED.FWaFfjrdapd7RkRCT3OFIdaE.-6mxquDYm8R4p7VFuV0SGgSJauuQJ2hEE-- | ||
+ | drwx------ 2 root root 12288 Apr 27 12:11 lost+found | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** : Notez que le nom du fichier **encrypt** a été chiffré. | ||
+ | </ | ||
+ | |||
+ | Constatez maintenant le contenu du fichier **ECRYPTFS_FNEK_ENCRYPTED.FWaFfjrdapd7RkRCT3OFIdaE.-6mxquDYm8R4p7VFuV0SGgSJauuQJ2hEE--** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | KnwM | ||
+ | " | ||
+ | qF3|2m& | ||
+ | N۟ hʿ | ||
+ | ? | ||
+ | ڹe|\Z۰_NIBik1> | ||
+ | JЮI/2\H[pi | ||
+ | )B亭v]? | ||
+ | v/ | ||
+ | uAc~anvͺ | ||
+ | 2ۼ|tΑ=\{5+4_z+oF | ||
+ | L& | ||
+ | хِ: | ||
+ | > | ||
+ | (@' | ||
+ | L | ||
+ | M+LMw | ||
+ | ' | ||
+ | p/& | ||
+ | *a+n | ||
+ | ]HDuƢ:# | ||
+ | | ||
+ | %' | ||
+ | n | ||
+ | BD^DoskY}N8S7ۉɜ^b]1W-? | ||
+ | x]Ҁ@0خ) | ||
+ | | ||
+ | m^xveʧfo|ȃ' | ||
+ | $f6YWƐٛK4m0|c$!y | ||
+ | / | ||
+ | | ||
+ | | ||
+ | d(< | ||
+ | :UؚX*d | ||
+ | KmPem& | ||
+ | q6fuSf93 | ||
+ | pe5 | ||
+ | kf, | ||
+ | eI\1Nx^} | ||
+ | G9+|NhKp֊hƌ-dJh< | ||
+ | _4QԈ$Nn: | ||
+ | 73F5 | ||
+ | 3ּl: | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** : Notez que le contenu du fichier **encrypt** a été chiffré. Pour pouvoir lire le nom et le contenu de ce fichier de nouveau, il faut remonter /mnt/sdc12 en spécifiant les mêmes options ainsi que la même passphrase. Notez que si vous vous trompez au niveau de la passphrase ceci n’empêchera pas le processus de montage. Par contre vous ne pourrez ni lire le nom ni lire le contenu du fichier chiffré. | ||
+ | </ | ||
+ | |||
+ | ====LAB #28 - Créer un Système de Fichiers Chiffré avec LUKS===== | ||
+ | |||
+ | ===Présentation=== | ||
+ | |||
+ | **LUKS** ( Linux Unified Key Setup ) permet de chiffrer l' | ||
+ | |||
+ | ==Mise en Place== | ||
+ | |||
+ | Commencez par installer le paquet **cryptsetup** : | ||
+ | |||
+ | < | ||
+ | root@debian11:/# | ||
+ | </ | ||
+ | |||
+ | Remplissez la partition /dev/sdc11 avec des données aléatoires : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | shred: /dev/sdc11: pass 1/1 (random)... | ||
+ | shred: /dev/sdc11: pass 1/1 (random)...474MiB/ | ||
+ | shred: /dev/sdc11: pass 1/1 (random)...500MiB/ | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** : L' | ||
+ | </ | ||
+ | |||
+ | Démontez /dev/sdc11 : | ||
+ | |||
+ | < | ||
+ | root@debian11:/# | ||
+ | </ | ||
+ | |||
+ | Initialisez la partition avec LUKS : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | WARNING! | ||
+ | ======== | ||
+ | This will overwrite data on /dev/sdc11 irrevocably. | ||
+ | |||
+ | Are you sure? (Type ' | ||
+ | Enter passphrase for /dev/sdc11: fenestros123456789 | ||
+ | Verify passphrase: fenestros123456789 | ||
+ | Key slot 0 created. | ||
+ | Command successful. | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** : La passphrase ne sera pas en claire. Elle l'est ici pour vous montrer un mot de passe acceptable pour LUKS. | ||
+ | </ | ||
+ | |||
+ | Ouvrez la partition LUKS en lui donnant le nom **sdc11** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Enter passphrase for /dev/sdc11: fenestros123456789 | ||
+ | </ | ||
+ | |||
+ | Vérifiez que le système voit la partition : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | lrwxrwxrwx 1 root root 7 Apr 28 06:26 sdc11 -> ../dm-2 | ||
+ | </ | ||
+ | |||
+ | Créez maintenant un système de fichiers sur **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | mke2fs 1.46.2 (28-Feb-2021) | ||
+ | Creating filesystem with 495616 1k blocks and 123952 inodes | ||
+ | Filesystem UUID: cc35e698-6915-4cb3-a0ca-e76bce705be1 | ||
+ | Superblock backups stored on blocks: | ||
+ | 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 | ||
+ | |||
+ | Allocating group tables: done | ||
+ | Writing inode tables: done | ||
+ | Creating journal (8192 blocks): done | ||
+ | Writing superblocks and filesystem accounting information: | ||
+ | </ | ||
+ | |||
+ | Montez la partition LUKS : | ||
+ | |||
+ | < | ||
+ | root@debian11:/# | ||
+ | </ | ||
+ | |||
+ | Vérifiez la présence du montage : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Editez le fichier **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | # <target name> <source device> | ||
+ | sdc11 /dev/sdc11 none | ||
+ | </ | ||
+ | |||
+ | Modifiez le fichier **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | # /etc/fstab: static file system information. | ||
+ | # | ||
+ | # Use ' | ||
+ | # device; this may be used with UUID= as a more robust way to name devices | ||
+ | # that works even if disks are added and removed. See fstab(5). | ||
+ | # | ||
+ | # systemd generates mount units based on this file, see systemd.mount(5). | ||
+ | # Please run ' | ||
+ | # | ||
+ | # <file system> <mount point> | ||
+ | # / was on /dev/sda1 during installation | ||
+ | UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e / | ||
+ | # swap was on /dev/sda5 during installation | ||
+ | UUID=1f9439f5-4b19-49b1-b292-60c2c674cee9 none swap sw 0 0 | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ==Ajouter une deuxième Passphrase== | ||
+ | |||
+ | Pour ajouter une deuxième passphrase, utilisez la commande cryptsetup avec la sous-commande **luksAddKey** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Enter any existing passphrase: fenestros123456789 | ||
+ | Enter new passphrase for key slot: debian123456789 | ||
+ | Verify passphrase: debian123456789 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** : Les passphrases ne seront pas en claire. Elle le sont ici pour vous montrer des mots de passe acceptables pour LUKS. | ||
+ | </ | ||
+ | |||
+ | ==Supprimer une Passphrase== | ||
+ | |||
+ | Pour supprimer une passphrase, utilisez la commande cryptsetup avec la sous-commande **luksRemoveKey** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Enter passphrase to be deleted: debian123456789 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **NE PAS FAIRE** : Lors du démarrage de la machine virtuelle, le système vous demandera d' | ||
+ | </ | ||
=====Le Swap===== | =====Le Swap===== | ||
Ligne 1949: | Ligne 2854: | ||
rm: remove regular file '/ | rm: remove regular file '/ | ||
</ | </ | ||
+ | |||
+ | =====Commandes Diverses===== | ||
+ | |||
+ | ====La Commande sync==== | ||
+ | |||
+ | La commande sync synchronise les données de fichier correspondantes dans la mémoire volatile et le stockage permanent. Les écritures en cache sont immédiatement écrites sur le disque. | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# sync --help | ||
+ | Usage: sync [OPTION] [FILE]... | ||
+ | Synchronize cached writes to persistent storage | ||
+ | |||
+ | If one or more files are specified, sync only them, | ||
+ | or their containing file systems. | ||
+ | |||
+ | -d, --data | ||
+ | -f, --file-system | ||
+ | --help | ||
+ | --version | ||
+ | |||
+ | GNU coreutils online help: < | ||
+ | Full documentation at: < | ||
+ | or available locally via: info ' | ||
+ | </ | ||
+ | |||
+ | ====La Commande fstrim==== | ||
+ | |||
+ | La commande **fstrim** est utilisée sur un système de fichiers monté pour abandonner (ou rogner) les blocs qui ne sont pas utilisés par le système de fichiers. C'est pratique pour les SSD et l' | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# fstrim --help | ||
+ | |||
+ | Usage: | ||
+ | | ||
+ | |||
+ | Discard unused blocks on a mounted filesystem. | ||
+ | |||
+ | Options: | ||
+ | -a, --all trim all mounted filesystems that are supported | ||
+ | -o, --offset < | ||
+ | -l, --length < | ||
+ | -m, --minimum <num> the minimum extent length to discard | ||
+ | -v, --verbose | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | For more details see fstrim(8). | ||
+ | </ | ||
+ | |||
+ | ====Le Daemon smartd==== | ||
+ | |||
+ | SMART (Self-Monitoring, | ||
+ | |||
----- | ----- | ||
Copyright © 2022 Hugh Norris. | Copyright © 2022 Hugh Norris. | ||