Gerenciamento de Disco no Windows Server 2012 Server Core
Vou demostrar como fazemos o gerenciamento de disco pela linha de comando.
Vamos acessar o menu de gerenciamento de disco
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART>
Agora vamos listar os discos para sabermos qual vamos manipular
DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 40 GB 0 B Disk 1 Online 20 GB 20 GB DISKPART>
No meu caso vou utilizar o disco 1 que está com 20 GB livre, então vamos selecionar ele
DISKPART> select disk 1 Disk 1 is now the selected disk. DISKPART>
Agora vamos tirar o atributo de somente leitura do disco
DISKPART> attributes disk clear readonly Disk attributes cleared successfully. DISKPART>
Agora vamos torar o disco on-line
DISKPART> online disk Virtual Disk Service error: This disk is already online. DISKPART>Como pode ser notado tivemos um erro, pois o disco já estava on-line, temos casos onde o disco fica como off-line, com isso precisamos ativar ele para poder manipular.
Agora vamos criar uma partição primaria no disco
DISKPART> create partition primary DiskPart succeeded in creating the specified partition. DISKPART>
Como pode ser notado foi criada a partição com sucesso vamos listar agora os volumes.
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- ------- Volume 0 D CD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 100 MB Healthy System Volume 2 C NTFS Partition 39 GB Healthy Boot * Volume 3 RAW Partition 19 GB Healthy DISKPART>
Como pode ser notado temos um * no Volume 3 que significa que é o disco que está selecionado no momento, podemos selecionar outro volume da seguinte forma
DISKPART> select volume 2 Volume 2 is the selected volume. DISKPART>
Agora vamos listar os volumes novamente
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 D CD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 100 MB Healthy System * Volume 2 C NTFS Partition 39 GB Healthy Boot Volume 3 RAW Partition 19 GB Healthy DISKPART>
Como pode ser notado o * está agora no volume 2, selecione novamente o volume 3 e vamos agora atribuir uma letra ao nosso volume.
DISKPART> assign letter=E DiskPart successfully assigned the drive letter or mount point. DISKPART>
Agora vamos listar os volumes novamente para verificarmos as letras
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 D CD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 100 MB Healthy System Volume 2 C NTFS Partition 39 GB Healthy Boot * Volume 3 E RAW Partition 19 GB Healthy DISKPART>
Como pode ser notado temos a letra E atribuida ao volume 3 porém ainda não temos um sistema de arquivos nesse volume então vamos sair do diskpart agora.
DISKPART> exit Leaving DiskPart... C:\Users\Administrator>
Agora vamos criar o sistema de arquivos NTFS em nosso volume 3
C:\Users\Administrator>format E: /v:Dados /Q The type of the file system is RAW. The new file system is NTFS. WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE E: WILL BE LOST Proceed with Format (Y/N)? y QuickFormatting 20478M Creating file system structures. Format complete. 20,0 GB total disk space. 19,9 GB are available. C:\Users\Administrator>
Aqui nós utilizamos a opção /v para definir o Label do volume e o /Q que é a forma de formatação rápida outras opções podem ser observadas abaixo.
C:\Users\Administrator>format /? Formats a disk for use with Windows. FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X] [/P:passes] [/S:state] FORMAT volume [/V:label] [/Q] [/F:size] [/P:passes] FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors] [/P:passes] FORMAT volume [/V:label] [/Q] [/P:passes] FORMAT volume [/Q] volume Specifies the drive letter (followed by a colon), mount point, or volume name. /FS:filesystem Specifies the type of the file system (FAT, FAT32, exFAT, NTFS , or UDF). /V:label Specifies the volume label. /Q Performs a quick format. Note that this switch overrides /P. /C NTFS only: Files created on the new volume will be compressed by default. /X Forces the volume to dismount first if necessary. All opened handles to the volume would no longer be valid. /R:revision UDF only: Forces the format to a specific UDF version (1.02, 1.50, 2.00, 2.01, 2.50). The default revision is 2.01. /D UDF 2.50 only: Metadata will be duplicated. /A:size Overrides the default allocation unit size. Default settings are strongly recommended for general use. NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K. FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes). FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes). exFAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M. Note that the FAT and FAT32 files systems impose the following restrictions on the number of clusters on a volume: FAT: Number of clusters <= 65526 FAT32: 65526 < Number of clusters < 4177918 Format will immediately stop processing if it decides that the above requirements cannot be met using the specified cluster size. NTFS compression is not supported for allocation unit sizes above 4096. /F:size Specifies the size of the floppy disk to format (1.44) /T:tracks Specifies the number of tracks per disk side. /N:sectors Specifies the number of sectors per track. /P:passes Zero every sector on the volume passes times. This switch is not valid with /Q /S:state Where "state" is either "enable" or "disable" Short names are enabled by default
Agora vamos verificar a nossa tabela de volumes
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 D CD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 100 MB Healthy System Volume 2 C NTFS Partition 39 GB Healthy Boot Volume 3 E Dados NTFS Partition 19 GB Healthy DISKPART> exit Leaving DiskPart...
Agora como pode ser notado temos o sistema de arquivos NTFS no volume 3 e o nosso label está la.
Agora se precisamos trocar o label é simples podemos fazer da seguinte forma
C:\Users\Administrator>label E: Arquivos C:\Users\Administrator>
Como pode ser notado já temos o comando label no sistema então é só especificar qual o volume e o novo label para ele, vamos listar agora os volumes novamente para verificar se a alteração ocorreu.
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 D CD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 100 MB Healthy System Volume 2 C NTFS Partition 39 GB Healthy Boot Volume 3 E Arquivos NTFS Partition 19 GB Healthy
Como pode ser notado o nosso label foi alterado com sucesso.
Tipos de partições podem ser consultados pelos links abaixo.
http://pt.wikipedia.org/wiki/Parti%C3%A7%C3%A3o
Agora vamo ver como fazemos para efetuar a conversão de tipo de disco, vamos converter o nosso disco de básico para dinâmico, primeiro vamos listar os nossos discos.
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 40 GB 0 B Disk 1 Online 20 GB 0 B DISKPART>
Como pode ser notado não temos a flag em Dyn de dinâmico e nem GPT GUID Partition Table.
Vamos selecionar o nosso disco agora
DISKPART> select disk 1 Disk 1 is now the selected disk. DISKPART>
Agora já podemos efetuar a conversão de básico para dinâmico
DISKPART> convert dynamic DiskPart successfully converted the selected disk to dynamic format. DISKPART>
Agora vamos listar os discos para verificar se ele foi setado com a flat de dyn.
DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 40 GB 0 B * Disk 1 Online 20 GB 0 B * DISKPART>
Como pode ser notado agora temos um * na flag dyn.
Agora vamos tentar converter o nosso disco dinâmico para basico
DISKPART> convert basic Virtual Disk Service error: The disk is not empty. DISKPART>
Como pode ser notado só poderiamos fazer isso com um disco vazio sem partição e sistema de arquivo.
Então planeje a sua implementação antes de manipular os discos.
Agora vamos tentar setar a flag de GPT no disco.
A GPT, dentre outros recursos, possibilita a redundância, a verificação de integridade, um grande número de partições (a Microsoft limita em 128, mas a especificação não) e os campos de endereçamento e tamanho da partição aumentaram de quatro bytes (32 bits) para oito (64 bits) – que permitem partições de 8.589.934.592 TiB (8 x 270 bytes ou 8 ZiB).
DISKPART> convert gpt Virtual Disk Service error: The specified disk is not convertible. CDROMs and DVDs are examples of disks that are not convertable. DISKPART>
Como podemos notar o disco não aceita esta modificação a mesma coisa que converter de dinâmico para basic.
Agora vamos ver como podemos criar uma partição de 10GB o valor de size é sempre passado em MB.
DISKPART> create partition primary size=10240
Abaixo opções para a criação de partições
DISKPART> help create partition primary Creates a primary partition on the basic disk with focus. Syntax: CREATE PARTITION PRIMARY [SIZE=<N>] [OFFSET=<N>] [ID={<BYTE> | <GUID>}] [ALIGN=<N>] [NOERR] SIZE=<N> The size of the partition in megabytes (MB). If no size is given, the partition continues until there is no more unallocated space in the current region. OFFSET=<N> The offset, in kilobytes (KB), at which the partition is created . If no offset is given, the partition is placed in the first disk extent that is large enough to hold it. ID={<BYTE> | <GUID>} Specifies the partition type. Intended for Original Equipment Manufacturer (OEM) use only. For master boot record (MBR) disks, you can specify a partition type byte, in hexadecimal form, for the partition. If this parameter is not specified for an MBR disk, the command creates a partition of type 0x06 (specifies no file system is installed) . LDM data partition: 0x42 Recovery partition: 0x27 Recognized OEM Ids: 0x12 0x84 0xDE 0xFE 0xA0 For GUID partition table (GPT) disks you can specify a partition type GUID for the partition you want to create. Recognized GUIDs include: EFI System partition: c12a7328-f81f-11d2-ba4b-00a0c93ec93b Microsoft Reserved partition: e3c9e316-0b5c-4db8-817d-f92df00215ae Basic data partition: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 LDM Metadata partition on a dynamic disk: 5808c8aa-7e8f-42e0-85d2-e1e90434cfb3 LDM Data partition on a dynamic disk: af9b60a0-1431-4f62-bc68-3311714a69ad Recovery partition: de94bba4-06d1-4d40-a16a-bfd50179d6ac If this parameter is not specified for a GPT disk, the command creates a basic data partition. Any partition type byte or GUID can be specified with this parameter. DiskPart does not check the partition type for validity except to ensure that it is a byte in hexadecimal form or a GUID. Caution: Creating partitions with this parameter might cause your computer to fail or be unable to start up. Unless you are an OEM or an IT professional experienced with GPT disks, do not create partitions on GPT disks using this parameter. Instead, always use the CREATE PARTITION EFI command to create EFI System partitions, the CREATE PARTITION MSR command to create Microsoft Reserved partitions, and the CREATE PARTITION PRIMARY command without this parameter to create primary partitions on GPT disks. ALIGN=<N> Typically used with hardware RAID Logical Unit Number (LUN) arrays to improve performance. The partition offset will be a multiple of <N>. If the OFFSET parameter is specified, it will be rounded to the closest multiple of <N>. NOERR For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without the NOERR parameter, an error causes DiskPart to exit with an error code. After you create the partition, the focus automatically shifts to the new partition. The partition does not receive a drive letter. You must use the assign command to assign a drive letter to the partition. A basic disk must be selected for this operation to succeed. Example: CREATE PARTITION PRIMARY SIZE=1000 CREATE PARTITION PRIMARY SIZE=128 ID=c12a7328-f81f-11d2-ba4b-00a0c93ec93b CREATE PARTITION PRIMARY SIZE=10000 ID=12 CREATE PARTITION PRIMARY SIZE=10000 ID=DE DISKPART>
OBS: Não podemos criar uma partição extendida em um disco do tipo GPT.
Agora vamos criar um disco dinâmico agora para extendermos ele como teste, vou acrescentar mais um disco no meu servidor para efetuar o teste.
Vamos listar os discos
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 40 GB 0 B Disk 1 Online 20 GB 0 B * Disk 2 Online 20 GB 20 GB DISKPART>
Agora temos mais um disco vamos selecionar o disco 2
DISKPART> select disk 2 Disk 2 is now the selected disk. DISKPART>
Agora vamos precisar converter ele para dinâmico para podermos utilizar outros tipos de volumes fora o simples.
DISKPART> convert dynamic DiskPart successfully converted the selected disk to dynamic format. DISKPART>
Agora vamos criar um volume simples de 3Gb para teste, lembrando que o size é sempre em MB
DISKPART> create volume simple size=3072 DiskPart successfully created the volume. DISKPART>
Agora vamos atribuir uma letra ao nosso novo volume
DISKPART> assign letter=F DiskPart successfully assigned the drive letter or mount point. DISKPART>
Agora vamos listar os nossos volumes
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 E Arquivos NTFS Simple 19 GB Healthy Volume 1 D CD-ROM 0 B No Media Volume 2 System Rese NTFS Partition 100 MB Healthy System Volume 3 C NTFS Partition 39 GB Healthy Boot * Volume 4 F RAW Simple 3072 MB Healthy DISKPART>
Agora vamos criar o sistema de arquivos nesse volume
C:\Users\Administrator>format F: /v:Extender /Q The type of the file system is RAW. The new file system is NTFS. WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE F: WILL BE LOST Proceed with Format (Y/N)? y QuickFormatting 3072M Creating file system structures. Format complete. 3,0 GB total disk space. 3,0 GB are available.
Agora vamos listar os nosso volumes
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 F Extender NTFS Simple 3072 MB Healthy Volume 1 E Arquivos NTFS Simple 19 GB Healthy Volume 2 D CD-ROM 0 B No Media Volume 3 System Rese NTFS Partition 100 MB Healthy System * Volume 4 C NTFS Partition 39 GB Healthy Boot DISKPART>
Agora vamos ver como extendemos um volume, vamos primeiro listar os nossos discos
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 40 GB 0 B Disk 1 Online 20 GB 0 B * Disk 2 Online 20 GB 16 GB *
Como podemos notar o disco 2 ainda temos 16GBs livres então vamos utilizar ele para extender o nosso volume.
Vamos selecionar o disco 2 que é o disco que tem espaço e vamos selecionar o volume 0 que é o que queremos aumentar.
DISKPART> select disk 2 Disk 2 is now the selected disk. DISKPART> select volume 0 Volume 0 is the selected volume. DISKPART>
Agora vamos extender o nosso volume
DISKPART> extend size=2048 DiskPart successfully extended the volume. DISKPART>
Agora temos que extender o nosso sistema de arquivos
DISKPART> extend filesystem DiskPart successfully extended the file system on the volume.
Agora vamos listar o nosso volume novamente
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- * Volume 0 F Extender NTFS Simple 5120 MB Healthy Volume 1 E Arquivos NTFS Simple 19 GB Healthy Volume 2 D CD-ROM 0 B No Media Volume 3 System Rese NTFS Partition 100 MB Healthy System Volume 4 C NTFS Partition 39 GB Healthy Boot DISKPART>
Como pode ser visto modificamos a partição com o sistema em funcionamento sem erros.
ATENÇÃO: Sempre faça backup dos dados antes de extender um volume em um servidor em produção
Vamos ver a criação de RAID
Vamos utilizar 2 discos para utilizar o RAID 0 que é a distribuição de dados por 2 discos como se fosse um não é tolerante a falha porém, vamos conseguir aumentar o tamanho da partição para o valor total de 2 discos.
Vamos primeiro converter os 2 discos para dinâmicos, vamos listar os discos
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 40 GB 0 B Disk 1 Online 10 GB 10 GB Disk 2 Online 10 GB 10 GB DISKPART>
Agora temos 2 discos de 10 GB para criar o nosso RAID 0 que é o STRIPE, vamos converter os 2 discos para dinâmicos.
DISKPART> select disk 1 Disk 1 is now the selected disk. DISKPART> convert dynamic DiskPart successfully converted the selected disk to dynamic format. DISKPART> select disk 2 Disk 2 is now the selected disk. DISKPART> convert dynamic DiskPart successfully converted the selected disk to dynamic format. DISKPART>
Agora que convertemos os nossos discos vamos criar o nosso STRIPE.
DISKPART> create volume STRIPE DISK=1,2 DiskPart successfully created the volume. DISKPART>
Criamos o nosso volume com o tamanho total dos dois disco porém poderiamos ter especificado o tamanho com o parâmetro size. da seguinte forma par acriar um STRIPE de 10 GB
create volume size=10240 STRIPE DISK=1,2
Agora vamos listar os nossos volumes
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- ------- Volume 0 D CD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 100 MB Healthy System Volume 2 C NTFS Partition 39 GB Healthy Boot * Volume 3 RAW Stripe 19 GB Healthy DISKPART>exit
Como pode ser notado temos o volume 3 que é a soma dos discos 1 e 2.
Agora vamos inserir uma letra para o nosso volume
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 RAW Stripe 19 GB Healthy Volume 1 D CD-ROM 0 B No Media Volume 2 System Rese NTFS Partition 100 MB Healthy System Volume 3 C NTFS Partition 39 GB Healthy Boot DISKPART> select volume 0 Volume 0 is the selected volume. DISKPART> assign letter=F DiskPart successfully assigned the drive letter or mount point. DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- * Volume 0 F RAW Stripe 19 GB Healthy Volume 1 D CD-ROM 0 B No Media Volume 2 System Rese NTFS Partition 100 MB Healthy System Volume 3 C NTFS Partition 39 GB Healthy Boot DISKPART>exit
Agora vamos criar um sistema de arquivos em nosso volume F.
C:\Users\Administrator>format F: /v:RAID-0 /Q The type of the file system is RAW. The new file system is NTFS. WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE F: WILL BE LOST Proceed with Format (Y/N)? y QuickFormatting 20476M Creating file system structures. Format complete. 20,0 GB total disk space. 19,9 GB are available. C:\Users\Administrator>
Agora já temos a nossa partição no sistema com o tamanho de 20GB, vamos listar ela no diskpart
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 F RAID-0 NTFS Stripe 19 GB Healthy Volume 1 D CD-ROM 0 B No Media Volume 2 System Rese NTFS Partition 100 MB Healthy System Volume 3 C NTFS Partition 39 GB Healthy Boot DISKPART>
Como pode ser notado temos o nosso volume 0 com a letra F com 19 GB.
Agora vamos criar um RAID 1 que é o MIRROR, aqui temos a redundância pois vamos estar espelhando os discos em caso de falha de um disco teremos os dados no segundo disco, porém o espaço em disco é a metade do valor ex: Se tenho 2 discos de 10 e vou espelhar eles vou ter um espaço para armazenamento de 10 porque um disco é espelho do outro.
Vamos utilizar aqui também 2 disco.
Vamos listar os nossos discos
DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 40 GB 0 B Disk 1 Online 10 GB 10 GB Disk 2 Online 10 GB 10 GB DISKPART>
Agora vamos converter os nossos discos para dinâmicos
DISKPART> select disk 1 Disk 1 is now the selected disk. DISKPART> convert dynamic DiskPart successfully converted the selected disk to dynamic format. DISKPART> select disk 2 Disk 2 is now the selected disk. DISKPART> convert dynamic DiskPart successfully converted the selected disk to dynamic format. DISKPART>
Agora que convertemos os nossos discos vamos criar o nosso RAID 1.
DISKPART> create volume mirror disk=1,2 DiskPart successfully created the volume. DISKPART>
Agora vamos listar os nossos volumes
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 D CD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 100 MB Healthy System Volume 2 C NTFS Partition 39 GB Healthy Boot * Volume 3 RAW Mirror 9 GB Healthy DISKPART>
Agora vamos setar uma letra para o nosso volume raid 1
DISKPART> select volume 3 Volume 3 is the selected volume. DISKPART> assign letter=F DiskPart successfully assigned the drive letter or mount point. DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 D CD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 100 MB Healthy System Volume 2 C NTFS Partition 39 GB Healthy Boot * Volume 3 F RAW Mirror 9 GB Healthy DISKPART>
Como pode ser notado setamos a letra para o nosso volume raid 1 que ídentificado no sistema como Mirror, agora precisamos criar um sistema de arquivos para esse nosso Mirro.
C:\Users\Administrator>format F: /v:RAID-1 /Q The type of the file system is RAW. The new file system is NTFS. WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE F: WILL BE LOST Proceed with Format (Y/N)? y QuickFormatting 10238M Creating file system structures. Format complete. 10,0 GB total disk space. 9,9 GB are available. C:\Users\Administrator>
Como pode ser notado foi criado o nosso sistema de arquivo e como pode ser notado de 2 discos de 10GB ficamos com um tamanho total depois do RAID 1 de 10 GB por que os discos foram espelhado para termos uma redundância.
Agora vamos listar os nosso volumes
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- ------- Volume 0 F RAID-1 NTFS Mirror 9 GB Healthy Volume 1 D CD-ROM 0 B No Media Volume 2 System Rese NTFS Partition 100 MB Healthy System Volume 3 C NTFS Partition 39 GB Healthy Boot DISKPART>Como pode ser notado temos o nosso volume de RAID 1 com o sistema de arquivos NTFS.
Para verificarmos quando de espaço temos livre em um determinado volume podemos utilizar o seguinte comando
C:\Users\Administrator>fsutil volume diskfree f: Total # of free bytes : 10652229632 Total # of bytes : 10735316992 Total # of avail free bytes : 10652229632 C:\Users\Administrator>
Agora vamos ver como montamos o RAID 5.
O RAID 5 é frequentemente usado e funciona similarmente ao RAID 4, mas supera alguns dos problemas mais comuns sofridos por esse tipo. As informações sobre paridade para os dados do array são distribuídas ao longo de todos os discos do array , ao invés de serem armazenadas num disco dedicado, oferecendo assim mais desempenho que o RAID 4, e, simultaneamente, tolerância a falhas.
Para efetuarmos essa implementação nescessitamos de pelo menos 3 discos.
Vamos listar os nossos discos
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 40 GB 0 B Disk 1 Online 10 GB 10 GB Disk 2 Online 10 GB 10 GB Disk 3 Online 10 GB 10 GB DISKPART>
Agora vamos converter os nossos discos para dinâmicos
DISKPART> select disk 1 Disk 1 is now the selected disk. DISKPART> convert dynamic DiskPart successfully converted the selected disk to dynamic format. DISKPART> select disk 2 Disk 2 is now the selected disk. DISKPART> convert dynamic DiskPart successfully converted the selected disk to dynamic format. DISKPART> select disk 3 Disk 3 is now the selected disk. DISKPART> convert dynamic DiskPart successfully converted the selected disk to dynamic format. DISKPART>
Agora vamos criar o nosso raid 5 isso pode demorar dependendo do tamanho dos discos.
DISKPART> create volume RAID DISK=1,2,3 DiskPart successfully created the volume. DISKPART>
Agora vamos listar os nosso volumes
DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 D CD-ROM 0 B No Media Volume 1 System Rese NTFS Partition 100 MB Healthy System Volume 2 C NTFS Partition 39 GB Healthy Boot * Volume 3 RAW RAID-5 19 GB Healthy DISKPART>
Agora vamos atribuir uma letra para o nosso volume, aqui o tamanho total é o tamanho dos 3 discos -1 que em nosso caso deu 20 GB pois cada disco tem 10 GB
DISKPART> select volume 3 Volume 3 is the selected volume. DISKPART> assign letter=F DiskPart successfully assigned the drive letter or mount point. DISKPART> exit Leaving DiskPart...
Agora vamos criar o sistema de arquivos para o nosso volume RAID 5
C:\Users\Administrator>format F: /v:RAID-5 /Q The type of the file system is RAW. The new file system is NTFS. WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE F: WILL BE LOST Proceed with Format (Y/N)? y QuickFormatting 20476M Creating file system structures. Format complete. 20,0 GB total disk space. 19,9 GB are available. C:\Users\Administrator>
Agora vamos listar os nossos volumes
C:\Users\Administrator>diskpart Microsoft DiskPart version 6.2.8400 Copyright (C) 1999-2012 Microsoft Corporation. On computer: WIN2012-C01 DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- ------- Volume 0 F RAID-5 NTFS RAID-5 19 GB Healthy Volume 1 D CD-ROM 0 B No Media Volume 2 System Rese NTFS Partition 100 MB Healthy System Volume 3 C NTFS Partition 39 GB Healthy Boot DISKPART> exit Leaving DiskPart...
Mais opções sobre criação de volumes pode ser observadas abaixo.
DISKPART> help CREATE VOLUME Microsoft DiskPart version 6.2.8400 RAID - Create a software RAID-5 volume set. SIMPLE - Create a simple volume. STRIPE - Create a stripe volume set. MIRROR - Create a mirror volume set. DISKPART> help CREATE VOLUME RAID Creates a RAID-5 volume using three or more specified dynamic disks. Syntax: CREATE VOLUME RAID [SIZE=<N>] DISK=<N>,<N>,<N>[,<N>[,...]] [ALIGN=<N>] [NOERR] SIZE=<N> The amount of disk space, in megabytes (MB), that the volume will occupy on each disk. If no size is given, the largest possible RAID-5 volume will be created. The disk with the smallest available contiguous free space determines the size for the RAID-5 volume and the same amount of space is allocated from each disk. The actual amount of usable disk space in the RAID-5 volume is less than the combined amount of disk space because some of the disk space is required for parity. DISK=<N>,<N>,<N>[,<N>[,...]] The dynamic disks on which to create the RAID-5 volume. You need at least three dynamic disks in order to create a RAID-5 volume. An amount of space equal to the size specified in SIZE=<N> is allocated on each disk. ALIGN=<N> Typically used with hardware RAID Logical Unit Number (LUN) arrays to improve performance. Aligns all volume extents to the closest alignment boundary. The extent offsets will be a multiple of <N>. NOERR For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without the NOERR parameter, an error causes DiskPart to exit with an error code. After you create the volume, the focus automatically shifts to the new volume. Fault-tolerant volumes such as RAID-5 and mirrored volumes are not supported in any edition of Windows Vista. Example: CREATE VOLUME RAID SIZE=1000 DISK=1,2,3 DISKPART>