export vgname=$(vgscan | grep "Found volume" | cut -f 6 -d " " | sed -e "s/\"//g") export disk_max=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $2/1000}' | cut -d "M" -f1 | awk 'END{print}') export disk_min=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $1/1000}' | cut -d "M" -f1 | awk 'END{print}') parted -s /dev/sda unit gb mkpart primary $disk_min $disk_max export partition_number=$(parted -s /dev/sda unit mb print | sort -nk1 | tail -n1 | awk '{ print $1}') vgextend $vgname /dev/sda$partition_number lvextend -l +100%FREE /dev/$vgname/root Redimensionner le système de fichiers CentOS 7 (systèmes xfs): xfs_growfs /dev/$vgname/root Pour toutes les autres système d'exploitation (ext4) resize2fs /dev/$vgname/rootRedimensionner le système de fichiers CentOS 7 (systèmes xfs):
xfs_growfs /dev/$vgname/rootPour tous les systèmes d'opération (systèmes ext4)
resize2fs /dev/$vgname/root
DEBIAN 8 /UBUNTU 14.04 # Ajout d'une partition secondaire sur le disque principal (Debian8/Ubuntu14.04) export vgname=$(vgscan | grep "Found volume" | cut -f 6 -d " " | sed -e "s/\"//g") export disk_max=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $2/1000}' | cut -d "M" -f1 | awk 'END{print}') export disk_min=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $1/1000}' | cut -d "M" -f1 | awk 'END{print}') parted/dev/sda unit GB resizepart 2 $disk_max parted/dev/sda unit GB resizepart 5 $disk_max pvresize/dev/sda5 lvextend -l +100%FREE /dev/$vgname/root resize2fs /dev/$vgname/root
DEBIAN/UBUNTU # Ajout d'une partition secondaire sur le disque principal (Debian/Ubuntu) export disk_max=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $2/1000}' | cut -d "M" -f1 | awk 'END{print}') export disk_min=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $1/1000}' | cut -d "M" -f1 | awk 'END{print}') parted /dev/sda unit GB mkpart primary $disk_min $disk_max export last_partition=$(parted -s /dev/sda print | grep -v "^$" | awk 'END{print $1}') vgextend vg01 /dev/sda$last_partition lvextend -l +100%FREE /dev/vg01/root resize2fs /dev/vg01/root
CENTOS 6 # Ajout d'une partition secondaire sur le disque principal (CentOs 6) export disk_max=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $2/1000}' | cut -d "M" -f1 | awk 'END{print}') export disk_min=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $1/1000}' | cut -d "M" -f1 | awk 'END{print}') parted /dev/sda unit GB mkpart primary $disk_min $disk_max reboot export last_partition=$(parted -s /dev/sda print | grep -v "^$" | awk 'END{print $1}') vgextend vg01 /dev/sda$last_partition lvextend -l +100%FREE /dev/vg01/lv_root resize2fs /dev/vg01/lv_root
CENTOS 7 # Ajout d'une partition secondaire sur le disque principal (CentOs 7) export disk_max=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $2/1000}' | cut -d "M" -f1 | awk 'END{print}') export disk_min=$(parted -s /dev/sda unit mb print free | grep -Ei 'libre|libero|Livre|free' | awk '{print $1/1000}' | cut -d "M" -f1 | awk 'END{print}') parted /dev/sda unit GB mkpart primary $disk_min $disk_max export last_partition=$(parted -s /dev/sda print | grep -v "^$" | awk 'END{print $1}') vgextend vg01 /dev/sda$last_partition lvextend -l +100%FREE /dev/vg01/root xfs_growfs /dev/vg01/root
Contactez nos experts, ils vous aideront avec plaisir.
Contacter