[Megacli] Créer un disque logique et étendre partition existante

 

Créer un disque logique et étendre partition existante

 

 

Rajout de 2 disques physiques de 600GO


Commencer par vérifier le nombre de raid logique présent

# megacli -LDInfo -Lall -a0
Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :Virtual Disk 0
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 558.375 GB
Sector Size         : 512
Mirror Data         : 558.375 GB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAhead, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAhead, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Enabled
Encryption Type     : None
Bad Blocks Exist: No
Is VD Cached: Yes
Cache Cade Type : Read Only

Vérifier les disques déjà utilises

# megacli -ldpdinfo -a0
Adapter #0

Number of Virtual Disks: 1
Virtual Drive: 0 (Target Id: 0)
Name                :Virtual Disk 0
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 558.375 GB
Sector Size         : 512
Mirror Data         : 558.375 GB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAhead, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAhead, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Enabled
Encryption Type     : None
Bad Blocks Exist: No
Is VD Cached: Yes
Cache Cade Type : Read Only
Number of Spans: 1
Span: 0 - Number of PDs: 2

PD: 0 Information
Enclosure Device ID: 32
Slot Number: 0
Drive's position: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: N/A
Device Id: 0
WWN: 50014EE70000FFC5
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 558.911 GB [0x45dd2fb0 Sectors]
Non Coerced Size: 558.411 GB [0x45cd2fb0 Sectors]
Coerced Size: 558.375 GB [0x45cc0000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: D1V9
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x50014ee70000ffc6
SAS Address(1): 0x0
Connected Port Number: 1(path0) 
Inquiry Data: WD      WD6000BKHG      D1V9WXF1E81NAEV4        
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive Temperature :34C (93.20 F)
PI Eligibility:  No 
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Port-1 :
Port status: Active
Port's Linkspeed: Unknown 
Drive has flagged a S.M.A.R.T alert : No

PD: 1 Information
Enclosure Device ID: 32
Slot Number: 1
Drive's position: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: N/A
Device Id: 1
WWN: 50014EE755565665
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 558.911 GB [0x45dd2fb0 Sectors]
Non Coerced Size: 558.411 GB [0x45cd2fb0 Sectors]
Coerced Size: 558.375 GB [0x45cc0000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: D1V9
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x50014ee755565666
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: WD      WD6000BKHG      D1V9WXP1E51DNLX7        
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive Temperature :35C (95.00 F)
PI Eligibility:  No 
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Port-1 :
Port status: Active
Port's Linkspeed: Unknown 
Drive has flagged a S.M.A.R.T alert : No

Créer le raid avec les diques portant l’id 2 et 3

# megacli -CfgLdAdd -r1[32:2,32:3] -Cache -a0
Adapter 0: Created VD 1
CacheCade is not supported

Vérifier le nombre de raid, il doit en ressortir 2

# megacli -LDGetNum -a0
Number of Virtual Drives Configured on Adapter 0: 2

Verifier la conf du 2eme raid (L1)

# megacli -ldinfo -L1 -a0
Adapter 0 -- Virtual Drive Information:
Virtual Drive: 1 (Target Id: 1)
Name                :
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 558.375 GB
Sector Size         : 512
Mirror Data         : 558.375 GB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Ongoing Progresses:
  Background Initialization: Completed 0%, Taken 7 min.
Encryption Type     : None
Bad Blocks Exist: No
Is VD Cached: Yes
Cache Cade Type : Read Only

Facultatif, mais on peux nommer un raid (pas d’espace)

# megacli -LDSetProp -Name Virtual_Drive_1 -L1 -a0
Set name to Virtual_Drive_1 on Adapter 0, VD 1 (target id: 1) success

Il faut ensuite initialiser le raid

# megacli -LDInit -Start -L1 -a0
Start Initialization on Virtual Drive 1 (target id: 1) Success.

Si failed

Start Initialization on Virtual Drive 1 (target id: 1) Failed.

FW error description: 
The requested virtual drive operation cannot be performed because consistency check is in progress.

Vérifier avec -ldinfo que le process n’est pas deja en cours

(Background Initialization: Completed 2%, Taken 3 min)

Lister les disques et les partitions

# lsblk
NAME                         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                            8:0    0 558.4G  0 disk 
├─sda1                         8:1    0  37.3G  0 part 
│ ├─mainvg-root (dm-0)       253:0    0   9.3G  0 lvm  /
│ ├─mainvg-swap (dm-1)       253:1    0   3.7G  0 lvm  [SWAP]
│ ├─mainvg-boot (dm-3)       253:3    0   952M  0 lvm  /boot
│ ├─mainvg-var (dm-4)        253:4    0   7.5G  0 lvm  /var
│ ├─mainvg-usr (dm-5)        253:5    0   4.7G  0 lvm  /usr
│ ├─mainvg-tmp (dm-6)        253:6    0   4.7G  0 lvm  /tmp
│ └─mainvg-home--root (dm-7) 253:7    0   3.7G  0 lvm  /root
└─sda2                         8:2    0 521.1G  0 part 
  └─vms-vz (dm-2)            253:2    0 521.1G  0 lvm  /var/lib/vz
sr0                           11:0    1  1024M  0 rom  
sdb                            8:16   0 558.4G  0 disk

Vérifier l’état du lvm actuel

# pvs
File descriptor 63 (pipe:[121442165]) leaked on pvs invocation. Parent PID 803076: -bash
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda1  mainvg lvm2 a--   37.25g 2.80g
  /dev/sda2  vms    lvm2 a--  521.12g    0

Créer le partionnement pour le disque sdb

# pvcreate /dev/sdb
File descriptor 63 (pipe:[121443141]) leaked on pvcreate invocation. Parent PID 803076: -bash
  Physical volume "/dev/sdb" successfully created

Rattacher le volume vms au disque sdb

# vgextend /dev/vms /dev/sdb
File descriptor 63 (pipe:[121444214]) leaked on vgextend invocation. Parent PID 803076: -bash
  Volume group "vms" successfully extended

Vérifiez le résultat avec la commande vgs, il y a maintenant 600GO d’espace libre

# vgs
File descriptor 63 (pipe:[121444519]) leaked on vgs invocation. Parent PID 803076: -bash
  VG     #PV #LV #SN Attr   VSize  VFree  
  mainvg   1   7   0 wz--n- 37.25g   2.80g
  vms      2   1   0 wz--n-  1.05t 558.37g

Il faut maintenant retailler la partition en allouant 100% de l’espace libre

# lvresize -r -l+100%FREE /dev/vms/vz
File descriptor 63 (pipe:[121445016]) leaked on lvresize invocation. Parent PID 803076: -bash
  Extending logical volume vz to 1.05 TiB
  Logical volume vz successfully resized
resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/mapper/vms-vz is mounted on /var/lib/vz; on-line resizing required
old_desc_blocks = 33, new_desc_blocks = 68
Performing an on-line resize of /dev/mapper/vms-vz to 282981376 (4k) blocks.

The filesystem on /dev/mapper/vms-vz is now 282981376 blocks long.

On reverifie avec la commande vgs que la partition est a bien ete augmenté

# vgs
File descriptor 63 (pipe:[121448097]) leaked on vgs invocation. Parent PID 803076: -bash
  VG     #PV #LV #SN Attr   VSize  VFree
  mainvg   1   7   0 wz--n- 37.25g 2.80g
  vms      2   1   0 wz--n-  1.05t    0

Reverifier l’etat du lvm

# pvs
File descriptor 63 (pipe:[121448265]) leaked on pvs invocation. Parent PID 803076: -bash
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda1  mainvg lvm2 a--   37.25g 2.80g
  /dev/sda2  vms    lvm2 a--  521.12g    0 
  /dev/sdb   vms    lvm2 a--  558.37g    0

Enfin on reliste les partitions et on voit que le sdb est bien concaténer

# lsblk
NAME                         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                            8:0    0 558.4G  0 disk 
├─sda1                         8:1    0  37.3G  0 part 
│ ├─mainvg-root (dm-0)       253:0    0   9.3G  0 lvm  /
│ ├─mainvg-swap (dm-1)       253:1    0   3.7G  0 lvm  [SWAP]
│ ├─mainvg-boot (dm-3)       253:3    0   952M  0 lvm  /boot
│ ├─mainvg-var (dm-4)        253:4    0   7.5G  0 lvm  /var
│ ├─mainvg-usr (dm-5)        253:5    0   4.7G  0 lvm  /usr
│ ├─mainvg-tmp (dm-6)        253:6    0   4.7G  0 lvm  /tmp
│ └─mainvg-home--root (dm-7) 253:7    0   3.7G  0 lvm  /root
└─sda2                         8:2    0 521.1G  0 part 
  └─vms-vz (dm-2)            253:2    0   1.1T  0 lvm  /var/lib/vz
sr0                           11:0    1  1024M  0 rom  
sdb                            8:16   0 558.4G  0 disk 
└─vms-vz (dm-2)              253:2    0   1.1T  0 lvm  /var/lib/vz

 

 

No votes yet.
Please wait...

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.