• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

PowerShell Command: New-StoragePool

December 16, 2023

PowerShell Command: New-StoragePool

When it comes to managing storage in a VPS environment, PowerShell is an incredibly powerful tool. One of the most useful commands for managing storage is the New-StoragePool command. This command allows you to create a new storage pool, which is a collection of physical disks that can be used to create virtual disks. In this article, we will take a deep dive into the New-StoragePool command, providing relevant examples and code samples to help you understand how to use it effectively.

What is a Storage Pool?

A storage pool is a collection of physical disks that are grouped together to create a single pool of storage. This pool can then be used to create virtual disks, which can be formatted and used just like any other disk. Storage pools are particularly useful in a VPS hosting environment, as they allow you to easily manage and allocate storage to different virtual machines.

Using the New-StoragePool Command

The New-StoragePool command is used to create a new storage pool. The command has several parameters that you can use to customize the storage pool, including the name of the pool, the physical disks that will be included in the pool, and the type of storage pool you want to create.

Example 1: Creating a Simple Storage Pool

New-StoragePool -FriendlyName "MyStoragePool" -StorageSubsystemFriendlyName "Storage Spaces*" -PhysicalDisks (Get-PhysicalDisk -CanPool $True)

In this example, we are creating a new storage pool called “MyStoragePool” using all of the physical disks that are available for pooling. The StorageSubsystemFriendlyName parameter specifies that we want to use the Storage Spaces subsystem, which is the default storage subsystem in Windows.

Example 2: Creating a Storage Pool with Specific Disks

$disks = Get-PhysicalDisk | Where-Object {$_.SerialNumber -eq "123456" -or $_.SerialNumber -eq "789012"}
New-StoragePool -FriendlyName "MyStoragePool" -StorageSubsystemFriendlyName "Storage Spaces*" -PhysicalDisks $disks

In this example, we are creating a new storage pool using only the physical disks with the serial numbers “123456” and “789012”. This allows us to be more selective about which disks we include in the storage pool.

Example 3: Creating a Mirrored Storage Pool

$disks = Get-PhysicalDisk | Where-Object {$_.CanPool -eq $True}
New-StoragePool -FriendlyName "MyStoragePool" -StorageSubsystemFriendlyName "Storage Spaces*" -PhysicalDisks $disks -ResiliencySettingNameDefault "Mirror"

In this example, we are creating a new storage pool with a default resiliency setting of “Mirror”. This means that the virtual disks created in this storage pool will be mirrored, providing increased data protection.

Conclusion

The New-StoragePool command is a powerful tool for managing storage in a VPS environment. By using this command, you can easily create storage pools that can be used to create virtual disks for your virtual machines. Whether you need a simple storage pool or a more complex mirrored pool, the New-StoragePool command has the flexibility to meet your needs. With the examples and code samples provided in this article, you should now have a better understanding of how to use this command to manage your storage effectively.

Recent Posts

  • How to Set a Static IP Address on a Debian Server: Theory and Best Practices
  • How to Manage Services with systemd on Debian: Theory and Best Practices
  • Debian Server Security Hardening: Best Practices and Core Theory
  • How to Monitor System Resources on a Debian Server: Theory and Best Practices
  • Debian Server Performance Tuning: Best Practices and Core Theory

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot