![]() Get-Disk |Where-Object PartitionStyle -eq 'RAW' |Initialize-Disk -PartitionStyle MBR -PassThru |New-Partition -AssignDriveLetter -UseMaximumSize |Format-Volume -FileSystem NTFS -Confirm:$false It is convenient to use it when connecting a new disk: The next PowerShell one-liner will initialize all new connected RAW-type disks, create the partition table on them and create an NTFS partitions with the maximum available size. If there are OEM partitions on a disk ( OEM recovery partition, EFI partition, System Reserved), use the RemoveOEM parameter to remove them:Ĭlear-Disk -Number 1 -RemoveData –RemoveOEM To delete all partitions from disks and completely clear data, run the commandĬlear-Disk -Number 1 -RemoveData -Confirm:$false Get-Partition –DiskNumber 1,2 | Remove-Partition -Confirm:$false To remove all partitions on disks 1 and 2 without confirmation, run this command: Let’s format new partition in the NTFS and set the DBData volume label:įormat-Volume -DriveLetter L -FileSystem NTFS -NewFileSystemLabel DBData -Confirm:$false Set-Partition -DriveLetter U -IsActive $true Formatting a partition with PowerShell If you want to make a partition active, this command is used: Resize-Partition -DriveLetter L -Size $MaxSize $MaxSize = (Get-PartitionSupportedSize -DriveLetter L).SizeMax Then you can extend the size of the partition to the maximum: Get-PartitionSupportedSize -DriveLetter L | Format-List If you want to expand the existing partition, first of all display the available unallocated space to extend this partition: Set-Partition –DriveLetter L -NewDriveLetter U You can change the assigned letter using this command: New-Partition –DiskNumber 1 -AssignDriveLetter –UseMaximumSize ![]() ![]() To assign a letter automatically, the AssignDriveLetter parameter is used ( sometimes Windows doesn’t assign a drive letter automatically ). If you want the partition to occupy all available disk space, use the UseMaximumSize attribute. New-Partition –DiskNumber 1 -Size 10gb -DriveLetter L Let’s create a 10 GB partition and assign the letter L: to it: To create a new partition on a disk, the New-Partition cmdlet is used. You can try to recover the partition table and data on your RAW disk as follows. The information contained in this documentation is subject to change without notice.Please note that a disk may have the RAW status when the partition table is corrupted. Pure shall not be liable for incidental or consequential damages in connection with the furnishing, performance, or use of this documentation. This documentation is provided "as is" and all express or implied conditions, representations and warranties, including any implied warranty of merchantability, fitness for a particular purpose, or non-infringement, are disclaimed, except to the extent that such disclaimers are held to be legally invalid. Pure Storage may make improvements and/or changes in the Pure Storage products and/or the programs described in this documentation at any time without notice. No part of this documentation may be reproduced in any form by any means without prior written authorization from Pure Storage, Inc. The Pure Storage products and programs described in this documentation are distributed under a license agreement restricting the use, copying, distribution, and decompilation/reverse engineering of the products. Third party names may be trademarks of their respective owners. © 2015-2023 Pure Storage® (“Pure”), Portworx® and associated its trademarks can be found here as and its virtual patent marking program can be found here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |