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:11:500:l104 [2023/06/09 12:27] – admin | elearning:workbooks:lpic:11:500:l104 [2024/04/05 08:03] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ~~PDF: | ~~PDF: | ||
| - | Version : **2023.01** | + | Version : **2024.01** |
| Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
| Ligne 3956: | Ligne 3956: | ||
| SELINUXTYPE=targeted | SELINUXTYPE=targeted | ||
| </ | </ | ||
| + | |||
| + | ====Déplacer /home==== | ||
| + | |||
| + | Créez une seule partition sur **/ | ||
| + | |||
| + | < | ||
| + | [root@centos7 ~]# fdisk /dev/sdb | ||
| + | Welcome to fdisk (util-linux 2.23.2). | ||
| + | |||
| + | Changes will remain in memory only, until you decide to write them. | ||
| + | Be careful before using the write command. | ||
| + | |||
| + | Device does not contain a recognized partition table | ||
| + | Building a new DOS disklabel with disk identifier 0x88708329. | ||
| + | |||
| + | Command (m for help): n | ||
| + | Partition type: | ||
| + | | ||
| + | | ||
| + | Select (default p): p | ||
| + | Partition number (1-4, default 1): | ||
| + | First sector (2048-41943039, | ||
| + | Using default value 2048 | ||
| + | Last sector, +sectors or +size{K, | ||
| + | Using default value 41943039 | ||
| + | Partition 1 of type Linux and of size 20 GiB is set | ||
| + | |||
| + | Command (m for help): w | ||
| + | The partition table has been altered! | ||
| + | |||
| + | Calling ioctl() to re-read partition table. | ||
| + | Syncing disks. | ||
| + | </ | ||
| + | |||
| + | Créez maintenant un système de fichiers ext4 sur **/ | ||
| + | |||
| + | < | ||
| + | [root@centos7 ~]# mkfs.ext4 /dev/sdb1 | ||
| + | mke2fs 1.42.9 (28-Dec-2013) | ||
| + | Filesystem label= | ||
| + | OS type: Linux | ||
| + | Block size=4096 (log=2) | ||
| + | Fragment size=4096 (log=2) | ||
| + | Stride=0 blocks, Stripe width=0 blocks | ||
| + | 1310720 inodes, 5242624 blocks | ||
| + | 262131 blocks (5.00%) reserved for the super user | ||
| + | First data block=0 | ||
| + | Maximum filesystem blocks=2153775104 | ||
| + | 160 block groups | ||
| + | 32768 blocks per group, 32768 fragments per group | ||
| + | 8192 inodes per group | ||
| + | Superblock backups stored on blocks: | ||
| + | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, | ||
| + | 4096000 | ||
| + | |||
| + | Allocating group tables: done | ||
| + | Writing inode tables: done | ||
| + | Creating journal (32768 blocks): done | ||
| + | Writing superblocks and filesystem accounting information: | ||
| + | </ | ||
| + | |||
| + | Montez **/ | ||
| + | |||
| + | < | ||
| + | [root@centos7 ~]# mount /dev/sdb1 /mnt | ||
| + | </ | ||
| + | |||
| + | Copiez le contenu de /home vers /mnt : | ||
| + | |||
| + | < | ||
| + | [root@centos7 ~]# cp -a /home/* /mnt | ||
| + | </ | ||
| + | |||
| + | Démontez /dev/sdb1 et déplacez /home vers /root : | ||
| + | |||
| + | < | ||
| + | [root@centos7 ~]# umount /mnt | ||
| + | [root@centos7 ~]# mv /home /root | ||
| + | </ | ||
| + | |||
| + | Identifiez l'UUID de /dev/sdb1 : | ||
| + | |||
| + | < | ||
| + | [root@centos7 ~]# ls -l / | ||
| + | lrwxrwxrwx. 1 root root 10 9 août 06:47 a5e2457f-7337-41f4-b958-e403eb419f94 -> ../../sdb1 | ||
| + | </ | ||
| + | |||
| + | Editez le fichier **/ | ||
| + | |||
| + | <file txt / | ||
| + | # | ||
| + | # /etc/fstab | ||
| + | # Created by anaconda on Sat Apr 30 11:27:02 2016 | ||
| + | # | ||
| + | # Accessible filesystems, | ||
| + | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info | ||
| + | # | ||
| + | UUID=e65fe7da-cda8-4f5a-a827-1b5cabe94bed / | ||
| + | UUID=2d947276-66e8-41f4-8475-b64b67d7a249 /boot | ||
| + | UUID=3181601a-7295-4ef0-a92c-f21f76b18e64 swap swap defaults | ||
| + | UUID=a5e2457f-7337-41f4-b958-e403eb419f94 / | ||
| + | |||
| + | </ | ||
| + | |||
| + | Créez le point de montage /home : | ||
| + | |||
| + | < | ||
| + | [root@centos7 ~]# mkdir /home | ||
| + | </ | ||
| + | |||
| + | Montez /dev/sdb1 : | ||
| + | |||
| + | < | ||
| + | [root@centos7 ~]# mount -a | ||
| + | [root@centos7 ~]# mount | ||
| + | sysfs on /sys type sysfs (rw, | ||
| + | proc on /proc type proc (rw, | ||
| + | devtmpfs on /dev type devtmpfs (rw, | ||
| + | securityfs on / | ||
| + | tmpfs on /dev/shm type tmpfs (rw, | ||
| + | devpts on /dev/pts type devpts (rw, | ||
| + | tmpfs on /run type tmpfs (rw, | ||
| + | tmpfs on / | ||
| + | cgroup on / | ||
| + | pstore on / | ||
| + | cgroup on / | ||
| + | cgroup on / | ||
| + | cgroup on / | ||
| + | cgroup on / | ||
| + | cgroup on / | ||
| + | cgroup on / | ||
| + | cgroup on / | ||
| + | cgroup on / | ||
| + | cgroup on / | ||
| + | configfs on / | ||
| + | /dev/sda2 on / type xfs (rw, | ||
| + | selinuxfs on / | ||
| + | systemd-1 on / | ||
| + | debugfs on / | ||
| + | hugetlbfs on / | ||
| + | mqueue on /dev/mqueue type mqueue (rw, | ||
| + | tmpfs on /tmp type tmpfs (rw, | ||
| + | sunrpc on / | ||
| + | nfsd on / | ||
| + | /dev/sda1 on /boot type xfs (rw, | ||
| + | /dev/sdb1 on /home type ext4 (rw, | ||
| + | tmpfs on / | ||
| + | </ | ||
| + | |||
| + | Notez la taille de /home : | ||
| + | |||
| + | < | ||
| + | [trainee@centos7 ~]$ df -h | ||
| + | Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur | ||
| + | / | ||
| + | devtmpfs | ||
| + | tmpfs 245M | ||
| + | tmpfs 245M 4,7M 240M 2% /run | ||
| + | tmpfs 245M | ||
| + | tmpfs 245M | ||
| + | / | ||
| + | / | ||
| + | tmpfs | ||
| + | </ | ||
| + | |||
| + | <WRAP center round todo> | ||
| + | Fermez la session de root et connectez-vous en tant que trainee. | ||
| + | </ | ||
| + | |||
| + | ====Mettre en Place des Quotas==== | ||
| Commencez par vérifiez que le paquet **quota** est bien installé : | Commencez par vérifiez que le paquet **quota** est bien installé : | ||
| Ligne 4353: | Ligne 4523: | ||
| ----- | ----- | ||
| - | Copyright © 2023 Hugh Norris. | + | Copyright © 2024 Hugh Norris. |