ll /dev/sdb
# ll /sys/class/scsi_host/ total 0 lrwxrwxrwx 1 root root 0 14 juin 16:20 host0 -> ../../devices/pci0000:00/0000:00:10.0/host0/scsi_host/host0 lrwxrwxrwx 1 root root 0 14 juin 16:20 host1 -> ../../devices/pci0000:00/0000:00:07.1/host1/scsi_host/host1 lrwxrwxrwx 1 root root 0 14 juin 16:20 host2 -> ../../devices/pci0000:00/0000:00:07.1/host2/scsi_host/host2 #Pour chaque répertoire "host" : echo "- - -" >/sys/class/scsi_host/host0/scan echo "- - -" >/sys/class/scsi_host/host1/scan echo "- - -" >/sys/class/scsi_host/host2/scan
fdisk -l
#On va créer une partition primaire (type LVM) sur l'ensemble du disque /dev/sdb fdisk /dev/sdb n --> créer nouvelle partition p --> partition primaire 1 --> numéro de partition entrer --> 1er secteur entrer --> dernier secteur t --> type de partition --> 8e LVM w --> ecrire
pvcreate /dev/sdb1
pvdisplay --- Physical volume --- "/dev/sdb1" is a new physical volume of "25.00 GiB" --- NEW Physical volume --- PV Name /dev/sdb1 VG Name PV Size 25.00 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID Jzj5NJ-z0pL-k1b9-gZSq-Qqw5-Y9QJ-QG1Ua2
vgcreate nomDeVolumeGroup /dev/sdb1
vgdisplay --- Volume group --- VG Name nomDeVolumeGroup System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 24.97 GiB PE Size 32.00 MiB Total PE 799 Alloc PE / Size 0 / 0 Free PE / Size 799 / 24.97 GiB VG UUID yk0ubQ-yi9V-iniz-ilIc-uwcq-Etyq-WIMJCu
lvcreate -L 10G -n nomDePartition nomDeVolumeGroup --> en precisant la taille ou lvcreate -l 100%FREE -n nomDePartition nomDeVolumeGroup --> en prenant toute la place disponible mkfs.xfs /dev/nomDeVolumeGroup/nomDePartition
lvdisplay --- Logical volume --- LV Path /dev/nomDeVolumeGroup/nomDePartition LV Name nomDePartition VG Name nomDeVolumeGroup LV UUID 6AR39c-dDUK-EPpo-ifF0-cAnV-wWMQ-0QfWpQ LV Write Access read/write LV Creation host, time xxx, 2016-04-07 17:43:59 +0200 LV Status available # open 0 LV Size 10.00 GiB Current LE 320 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:2
#Ajouter à /etc/fstab/ /dev/mapper/nomDeVolumeGroup-nomDePartition /pointDeMontage/ xfs defaults 0 0 # Créer le répertoire : mkdir /pointDeMontage/ #Recharger la table de partition : mount -a
lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert nomDePartition1 vg0 -wi-ao 5.00G nomDePartition2 vg0 -wi-ao 512.00M nomDePartition nomDeVolumeGroup -wi-ao 10.00G
lvextend -L30G /dev/nomDeVolumeGroup/nomDePartition Extending logical volume nomDePartition to 30.00 GB Logical volume nomDePartition successfully resized
xfs_growfs /dev/mapper/nomDeVolumeGroup-nomDePartition
lvextend -l +100%FREE /dev/nomDeVolumeGroup/nomDePartition ...
lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert nomDePartition vg0 -wi-ao 5.00G lvol1 vg0 -wi-ao 512.00M nomDePartition nomDeVolumeGroup -wi-ao 30.00G
lvrename /dev/nomDeVolumeGroup/nomDePartition /dev/nomDeVolumeGroup/nouveauNomDePartition