meta données pour cette page
  •  

Ceci est une ancienne révision du document !


Gestion disques & partitions

Partition non LVM
  • rafraichissement disque iSCSI étendu
[root@hyper-v2 ~]# rescan-scsi-bus.sh -s
Scanning SCSI subsystem for new devices
Searching for resized LUNs
RESIZED: Host: scsi6 Channel: 00 Id: 00 Lun: 00
  Vendor: OSNEXUS  Model: QuantaStor       Rev: 380
  Type:   Direct-Access                    ANSI SCSI revision: 06
0 new or changed device(s) found.
1 remapped or resized device(s) found.
        [6:0:0:0]
 
0 device(s) removed.
  • création ou extention de partition (avec outil graphique)
cfdisk /dev/vdb
  • resize de partition
[root@hyper-v2 ~]# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 111,8G  0 disk
├─sda1        8:1    0   600M  0 part /boot/efi
├─sda2        8:2    0     1G  0 part /boot
└─sda3        8:3    0 110,2G  0 part
  ├─ol-root 252:0    0    70G  0 lvm  /
  └─ol-home 252:1    0  40,2G  0 lvm  /home
sdb           8:16   0   200G  0 disk
└─sdb1        8:17   0   100G  0 part /VM1
 
[root@hyper-v2 ~]# growpart /dev/sdb 1
CHANGED: partition=1 start=2048 old: size=209711104 end=209713151 new: size=419428319 end=419430366
 
[root@hyper-v2 ~]# xfs_growfs /dev/sdb1
meta-data=/dev/sdb1              isize=512    agcount=4, agsize=6553472 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=0
data     =                       bsize=4096   blocks=26213888, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=16384, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 26213888 to 52428539
 
[root@hyper-v2 ~]# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 111,8G  0 disk
├─sda1        8:1    0   600M  0 part /boot/efi
├─sda2        8:2    0     1G  0 part /boot
└─sda3        8:3    0 110,2G  0 part
  ├─ol-root 252:0    0    70G  0 lvm  /
  └─ol-home 252:1    0  40,2G  0 lvm  /home
sdb           8:16   0   200G  0 disk
└─sdb1        8:17   0   200G  0 part /VM1
  • Formater une partition
[root@oracle1 ~]# mkfs.xfs -f /dev/vdb1
meta-data=/dev/vdb1              isize=512    agcount=4, agsize=655295 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=2621179, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=25600, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
Discarding blocks...Done.
  • charger modification FSTAB sans rebooter
mount -a


Partition LVM

Nous avons provisionné 10Gb de plus au niveau VM sur le disque OS, on passe donc de 20GB à 30GB sur xvda

  • on vérifie la taille actuelle de la partition physique
xvda        202:0    0   30G  0 disk
├─xvda1     202:1    0  600M  0 part /boot/efi
├─xvda2     202:2    0    1G  0 part /boot
└─xvda3     202:3    0 18,4G  0 part
  ├─ol-root 252:0    0 16,4G  0 lvm  /
  └─ol-swap 252:1    0    2G  0 lvm  [SWAP]
 
 
[root@oracle2 ~]# pvdisplay /dev/xvda3
  --- Physical volume ---
  PV Name               /dev/xvda3
  VG Name               ol
  PV Size               18,41 GiB / not usable 0
  Allocatable           yes (but full)
  PE Size               4,00 MiB
  Total PE              4713
  Free PE               0
  Allocated PE          4713
  PV UUID               7Bl461-rgRZ-Jlp8-Sq5F-DeNe-5C60-neFQ7X
[root@oracle2 ~]# lvscan
  ACTIVE            '/dev/ol/swap' [2,00 GiB] inherit
  ACTIVE            '/dev/ol/root' [16,41 GiB] inherit