meta données pour cette page
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 | ||
| linux:gestion_disques_partition [20/05/2024 08:47] – mdl | linux:gestion_disques_partition [13/01/2025 19:20] (Version actuelle) – mdl | ||
|---|---|---|---|
| Ligne 86: | Ligne 86: | ||
| ---- | ---- | ||
| - | | + | |
| - | Nous avons provisionné 10Gb de plus au niveau VM sur le disque OS, on passe donc de 20GB à 30GB sur //xvda// | + | |
| - | On doit ici étendre le swap. | + | |
| - | * on vérifie la taille actuelle de la partition | ||
| <code bash> | <code bash> | ||
| - | xvda 202:0 0 | + | [root@oracle4 sources]# lsblk |
| - | ├─xvda1 | + | |
| - | ├─xvda2 | + | |
| - | └─xvda3 | + | |
| - | ├─ol-root 252:0 0 16,4G 0 lvm / | + | |
| - | └─ol-swap 252:1 0 2G 0 lvm | + | |
| + | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | ||
| + | sr0 11:0 1 10G 0 rom | ||
| + | xvda 202:0 0 20G 0 disk | ||
| + | ├─xvda1 | ||
| + | └─xvda2 | ||
| + | ├─ol-root 252:0 0 17G 0 lvm / | ||
| + | └─ol-swap 252:1 0 | ||
| + | xvdb 202: | ||
| - | [root@oracle2 ~]# pvdisplay | + | |
| - | --- Physical volume | + | [root@oracle4 sources]# cfdisk |
| - | | + | |
| - | VG Name | + | |
| - | PV Size 18,41 GiB / not usable 0 | + | [root@oracle4 sources]# pvcreate /dev/xvdb |
| - | | + | Physical volume "/ |
| - | | + | |
| - | Total PE | + | [root@oracle4 sources]# vgcreate vg_u01 /dev/xvdb |
| - | | + | Volume group " |
| - | | + | |
| - | | + | [root@oracle4 sources]# vgdisplay |
| + | | ||
| + | VG Name vg_u01 | ||
| + | System ID | ||
| + | Format | ||
| + | Metadata Areas 1 | ||
| + | Metadata Sequence No 1 | ||
| + | | ||
| + | VG Status | ||
| + | MAX LV 0 | ||
| + | Cur LV 0 | ||
| + | Open LV | ||
| + | Max PV 0 | ||
| + | Cur PV 1 | ||
| + | Act PV 1 | ||
| + | VG Size <15,00 GiB | ||
| + | | ||
| + | | ||
| + | Alloc PE / Size 0 / 0 | ||
| + | Free | ||
| + | VG UUID kZqQI9-s9FN-z2lV-b7N9-kvgV-Arhm-Bi53U9 | ||
| + | |||
| + | [root@oracle4 sources]# lvcreate -n lv_u01 -L 14g vg_u01 | ||
| + | Logical volume " | ||
| + | |||
| + | [root@oracle4 sources]# lvdisplay | ||
| + | --- Logical volume --- | ||
| + | LV Path / | ||
| + | LV Name lv_u01 | ||
| + | VG Name vg_u01 | ||
| + | LV UUID c9kGnB-9LGE-VxrO-UHVE-7zYu-JEMb-HzsmYI | ||
| + | LV Write Access | ||
| + | LV Creation host, time oracle4.labo.local, | ||
| + | LV Status | ||
| + | # open 0 | ||
| + | LV Size 14,00 GiB | ||
| + | Current LE | ||
| + | Segments | ||
| + | Allocation | ||
| + | Read ahead sectors | ||
| + | - currently set to | ||
| + | Block device | ||
| + | |||
| + | |||
| + | [root@oracle4 sources]# mkfs -t ext4 / | ||
| + | mke2fs 1.45.6 (20-Mar-2020) | ||
| + | En train de créer un système de fichiers avec 3670016 4k blocs et 917504 i-noeuds. | ||
| + | UUID de système de fichiers=899c9a48-e4b5-4145-95b1-42b51948587a | ||
| + | Superblocs de secours stockés sur les blocs : | ||
| + | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208 | ||
| + | |||
| + | Allocation des tables de groupe : complété | ||
| + | Écriture des tables d' | ||
| + | Création du journal (16384 blocs) : complété | ||
| + | Écriture des superblocs et de l' | ||
| + | fichiers : | ||
| + | |||
| + | |||
| + | [root@oracle4 sources]# lsblk | ||
| + | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | ||
| + | sr0 11:0 1 10G 0 rom | ||
| + | xvda 202:0 0 20G 0 disk | ||
| + | ├─xvda1 | ||
| + | └─xvda2 | ||
| + | ├─ol-root | ||
| + | └─ol-swap | ||
| + | xvdb 202: | ||
| + | └─vg_u01-lv_u01 252:2 0 14G 0 lvm | ||
| + | |||
| + | |||
| + | [root@oracle4 sources]# mkdir /u01 | ||
| + | [root@oracle4 sources]# vi / | ||
| + | mount: (hint) your fstab has been modified, but systemd still uses | ||
| + | the old version; use ' | ||
| + | / | ||
| </ | </ | ||
| - | * information sur les volumes logiques | + | \\ |
| + | |||
| + | == Extension d'un LVM == | ||
| + | |||
| + | * on rafraîchit le storage via cfdisk (on ne fait rien, ouvrir et quitter pour forcer le rafraichissement du storage) | ||
| <code bash> | <code bash> | ||
| - | [root@oracle2 ~]# lvscan | + | cfdisk |
| - | ACTIVE | + | |
| - | ACTIVE | + | |
| </ | </ | ||
| - | * désactivation du //SWAP// et du LVM //SWAP// | + | * on rafraîchit le lvm |
| <code bash> | <code bash> | ||
| - | swapoff / | + | [root@oracle2 ~]# pvscan |
| - | lvchange -a n / | + | [root@oracle2 ~]# lvscan |
| </ | </ | ||
| - | * on valide sa désactivation | + | * on étend le PV |
| <code bash> | <code bash> | ||
| - | [root@oracle2 ~]# lvscan | + | [root@oracle2 ~]# |
| - | inactive | + | |
| - | ACTIVE | + | |
| </ | </ | ||
| - | | + | * on étend |
| <code bash> | <code bash> | ||
| - | + | [root@oracle2 ~]# lvextend | |
| </ | </ | ||
| + | * on étend le FS (EXT4) | ||
| <code bash> | <code bash> | ||
| - | + | [root@oracle2 ~]# lvextend | |
| </ | </ | ||
| + | * ou on étend le FS (XFS) | ||
| <code bash> | <code bash> | ||
| - | + | [root@oracle2 ~]# xfs_growfs / | |
| </ | </ | ||
| - | < | + | \\ |
| - | + | == Extension LVM Swap == | |
| + | |||
| + | < | ||
| + | pvresize / | ||
| + | lvextend / | ||
| + | |||
| + | swapon --show | ||
| + | swapoff -v / | ||
| + | mkswap / | ||
| + | swapon -va | ||
| + | lsblk | ||
| </ | </ | ||