Ampliar Volumen Microsoft S2D por Powershell
Hoy vamos a enseñaros como ampliar un volumen Microsoft S2D (Storage Space Direct) en caliente y mediante Powershell. Partimos de tener un volumen S2D ya montado, el cual se nos ha quedado corto en espacio y nos empieza a dar problemas.
Simplemente queremos ampliar ese espacio en disco. Para eso lo voy a hacer remotamente por Powershell. Abrimos sesión en el servidor remoto y obtenemos los discos que tiene. Nuestro disco S2D se llama Volume2 y tiene inicialmente 500GB sobre un Hyper-V. La idea es ir recopilando datos mediante diferentes comandos:
1 2 3 4 5 6 7 8 9 |
PS C:\Users\administrador> Enter-PSSession -ComputerName SRVS2D01 [SRVS2D01]: PS C:\Users\Administrador\Documents> Get-Disk Number Friendly Name Serial Number HealthStatus OperationalStatus Total Size Partition Style ------ ------------- ------------- ------------ ----------------- ---------- ---------- 0 HPE LOGICA... PEYHC0CRHAY088 Healthy Online 223.54 GB GPT 4 Generic- S... 2012062914345300 Healthy Online 59.62 GB GPT 5 Volume2 {7e751d7b-232b-46cb-9b2f-5be0... Healthy Online 500 GB GPT |
Obtenemos los discos físicos:
1 2 3 4 5 6 7 8 9 10 11 12 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-PhysicalDisk FriendlyName SerialNumber CanPool OperationalStatus HealthStatus Usage Size ------------ ------------ ------- ----------------- ------------ ----- ---- HPE LOGICAL VOLUME PEYHC0CRHAY088 False OK Healthy Auto-Select 223.54 GB Generic- SD/MMC CRW 2012062914345300 False OK Healthy Auto-Select 59.62 GB ATA MK000960GWCFA S3EANX0K300924 True OK Healthy Auto-Select 894.25 GB ATA MK000960GWCFA S3EANX0K300918 False OK Healthy Auto-Select 894.25 GB ATA MK000960GWCFA S3EANX0K300927 False OK Healthy Auto-Select 894.25 GB ATA MK000960GWCFA S3EANX0K300935 False OK Healthy Auto-Select 894.25 GB ATA MK000960GWCFA S3EANX0K300925 False OK Healthy Auto-Select 894.25 GB ATA MK000960GWCFA S3EANX0K300952 True OK Healthy Auto-Select 894.25 GB |
Obtenemos los datos de los volúmenes:
1 2 3 4 5 6 7 8 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-Volume DriveLetter FileSystemLabel FileSystem DriveType HealthStatus OperationalStatus SizeRemaining Size ----------- --------------- ---------- --------- ------------ ----------------- ------------- ---- Recovery NTFS Fixed Healthy OK 1.92 GB 2.24 GB D SDCARD NTFS Removable Healthy OK 21.8 GB 59.62 GB C Windows NTFS Fixed Healthy OK 117.3 GB 220.69 GB Volume2 CSVFS Fixed Unhealthy OK 1.32 GB 499.81 GB |
Obtenemos los Virtual Disk:
1 2 3 4 5 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-VirtualDisk FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach Size ------------ --------------------- ----------------- ------------ -------------- ---- Volume2 Mirror OK Healthy True 500 GB |
1 2 3 4 5 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-VirtualDisk Volume2 | Get-Disk | Get-Partition | Get-Volume DriveLetter FileSystemLabel FileSystem DriveType HealthStatus OperationalStatus SizeRemaining Size ----------- --------------- ---------- --------- ------------ ----------------- ------------- ---- Volume2 CSVFS Fixed Unhealthy OK 1.32 GB 499.81 GB |
1 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-VirtualDisk Volume2 | Get-StorageTier |
https://s2dcalc.blob.core.windows.net/www/index.html
Hay que poner el tamaño final del volumen, no lo que queremos subir. La primera acción es redimensionar el disco virtual:
1 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-VirtualDisk Volume2 | Resize-VirtualDisk -Size 700GB |
Verificamos que se ha hecho bien:
1 2 3 4 5 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-VirtualDisk Volume2 FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach Size ----------- --------------------- ----------------- ------------ -------------- ---- Volume2 Mirror OK Healthy True 700 GB |
Lanzaremos el siguiente comando para obtener el DiskPath:
1 2 3 4 5 6 7 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-VirtualDisk Volume2 | Get-Disk | Get-Partition | Where PartitionNumber -Eq 2 DiskPath: \\?\Disk{7e751d7b-232b-46cb-9b2f-5be0794c446c} PartitionNumber DriveLetter Offset Size Type --------------- ----------- ------ ---- ---- 2 135266304 499.87 GB Basic |
Y ahora ampliamos el volumen:
1 2 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-VirtualDisk Volume2 | Get-Disk | Get-Partition | Where PartitionNumber -Eq 2 | Resize-Partition -Size (Get-VirtualDisk Volume2 | Get-Disk | Get-Partition | Where PartitionNumber -Eq 2 | Get-PartitionSupportedSize).SizeMax |
Comprobamos que ya tenemos el espacio disponible:
1 2 3 4 5 |
[SRVS2D01]: PS C:\Users\Administrador\Documents> Get-VirtualDisk Volume2 FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach Size ------------ --------------------- ----------------- ------------ -------------- ---- Volume2 Mirror OK Healthy True 700 GB |
¿Te ha gustado la entrada SÍGUENOS EN TWITTER?
Te ha gustado la entrada SGUENOS EN TWITTER O INVITANOS A UN CAFE?