GitPedia

Synology M2 volume

Easily create an M.2 volume on Synology NAS

From 007revad·Updated June 23, 2026·View on GitHub·

Easily create an M.2 volume on Synology NAS without a lot of typing and no need for any how-to guides. And you ***don't*** need Synology branded NVMe drives. The project is written primarily in Shell, distributed under the MIT License license, first published in 2023. It has gained significant community traction with 1,399 stars and 77 forks on GitHub. Key topics include: diskstation, dsm, rackstation, synology, synology-disk-station.

Latest release: v1.3.26
November 16, 2025View Changelog →

Synology M2 volume

<a href="https://github.com/007revad/Synology_M2_volume/releases"><img src="https://img.shields.io/github/release/007revad/Synology_M2_volume.svg"></a>
Badge
Donate

<!-- [![committers.top badge](https://user-badge.committers.top/australia/007revad.svg)](https://user-badge.committers.top/australia/007revad) -->

Description

Easily create an M.2 volume on Synology NAS without a lot of typing and no need for any how-to guides. And you don't need Synology branded NVMe drives.

This script creates the RAID and storage pool on your NVMe drive(s) so you can then create the volume in the Storage Manager.

All you have to do is run the script and type yes and 1, 2, 3 or 4 to answer some simple questions. Then go to Storage Manager and select Create Volume.

It also allows you to create a storage pool/volume spanning internal NVMe drives and NVMe drives in a Synology M.2 PCIe card.

For Xpenology users the script supports an unlimited number of NVMe drives (except for RAID 1 and Basic).

Supports DSM 7 and later

For DSM 6 use v1 and run without the auto update option.

NEW in v2

  • Now shows "M.2 Drive #" the same as storage manager.
  • Now uses synostgpool command which allows the following: (Thanks to Severe_Pea_2128 on reddit)
    • Now supports JBOD, SHR, SHR2 and RAID F1.
    • Added choice of multi-volume or single-volume storage pool. Multi-volume allows overprovisioning.
    • Added option to skip drive check.
    • No longer need to reboot after running the script.
    • No longer need to do an online assemble.
  • Removed drive check progress as it was not possible with synostgpool.
    • You can see the drive check progress in Storage Manager.
  • Removed dry run mode as it was not possible with synostgpool.
  • Removed support for SATA M.2 drives.
    • If you have SATA M.2 drives use v1 and run without the auto update option.

RAID levels supported

RAID LevelMin Drives RequiredMaximum DrivesScript version
SHR 11 or more drivesUnlimitedv2 and later (DSM 7 only)
SHR 24 or more drivesUnlimitedv2 and later (DSM 7 only)
Basic1 drive1 driveall
JBOD1 or more drivesUnlimitedv2 and later (DSM 7 only)
RAID 02 or more drivesUnlimitedall
RAID 12 or more drives4 drivesall
RAID 53 or more drivesUnlimitedall
RAID 64 or more drivesUnlimitedv1.3.15 and later
RAID 104 or more drivesUnlimitedv1.3.15 and later
RAID F13 or more drivesUnlimitedv2 and later (DSM 7 only)

If RAID F1 is selected the script enables RAID F1 on Synology models that don't officially support RAID F1.

Confirmed working on

<details> <summary>Click here to see list</summary>
ModelDSM versionM.2 cardNotes
AllDSM 6Use v1 run without auto update option
RS2423+DSM 7.2-64570 Update 1
DS1823xs+DSM 7.2-64561M2D20
DS923+DSM 7.2.2-72806 Update 3
DS923+DSM 7.2.2-72806 Update 2
DS923+DSM 7.2.2 72806 Update 1
DS923+DSM 7.2.1-69057 Update 5
DS923+DSM 7.2.1-69057 Update 2
DS923+DSM 7.1.1-42962 Update 5
DS723+DSM 7.3.2-86009
DS723+DSM 7.2.2-72806 Update 2
DS723+DSM 7.2.1-69057 Update 3
DS723+DSM 7.2-64570 Update 1
DS723+DSM 7.1.1-42962 Update 4
DS423+DSM 7.2.2-72806 Update 4
DS423+DSM 7.2.2-72806
DS423+DSM 7.2.1-69057 Update 3
DS423+DSM 7.2-64570 Update 3
DS423+DSM 7.1.1-42962 Update 4
DS3622xs+DSM 7.2-64216 BetaE10M20-T1
DS3622xs+DSM 7.1.1-42962 Update 1
DS2422+DSM 7.2.1-69057 Update 4E10M20-T1
DS1522+DSM 7.2.1-69057 Update 4
DS1522+DSM 7.2-64570
DS1522+DSM 7.1.1-42962 Update 4
DS1821+DSM 7.2.1-69057 Update 4E10M20-T1Also needs Synology enable_M2_card
DS1821+DSM 7.2.1-69057 Update 4M2D20Also needs Synology enable_M2_card
DS1821+DSM 7.2.1-69057 Update 4M2D18Also needs Synology enable_M2_card
DS1821+DSM 7.2.1-69057 Update 4
DS1821+DSM 7.2.1-69057 Update 3
DS1821+DSM 7.2.1-69057 Update 2
DS1821+DSM 7.2.1-69057 Update 1
DS1821+DSM 7.2.1-69057
DS1821+DSM 7.2-64570 Update 3
DS1821+DSM 7.2-64570 Update 1E10M20-T1Also needs Synology enable_M2_card
DS1821+DSM 7.2-64570 Update 1M2D18Also needs Synology enable_M2_card
DS1821+DSM 7.2-64570 Update 1
DS1821+DSM 7.2-64570
DS1821+DSM 7.2-64561
DS1821+DSM 7.2-64216 Beta
DS1821+DSM 7.2-64213 Beta
DS1821+DSM 7.1.1-42962 Update 4
DS1621xs+DSM 7.2.1-69057 Update 5
DS1621+DSM 7.2-64570 Update 1E10M20-T1Also needs Synology enable_M2_card
DS1621+DSM 7.2-64570 Update 1
DS1621+DSM 7.1.1-42962 Update 4
RS1221+DSM 7.2-64570 Update 1E10M20-T1
RS1221+DSM 7.1.1E10M20-T1
DS1520+DSM 7.3.2-86009
DS1520+DSM 7.2.1-69057 Update 2
DS1520+DSM 7.2-64570 Update 1
DS1520+DSM 7.1.1-42962 Update 4
DS920+DSM 7.3.2-86009 Update 3
DS920+DSM 7.3.2-86009 Update 2
DS920+DSM 7.3.2-86009 Update 1
DS920+DSM 7.3.2-86009
DS920+DSM 7.3.1-86003 Update 1
DS920+DSM 7.3.1-86003
DS920+DSM 7.3-81180
DS920+DSM 7.2.2 72806 Update 5
DS920+DSM 7.2.2 72806 Update 4
DS920+DSM 7.2.2 72806 Update 3
DS920+DSM 7.2.2 72806 Update 2
DS920+DSM 7.2.2 72806 Update 1
DS920+DSM 7.2.2-72806
DS920+DSM 7.2.1-69057 Update 5
DS920+DSM 7.2.1-69057 Update 4
DS920+DSM 7.2.1-69057 Update 3
DS920+DSM 7.2.1-69057 Update 2
DS920+DSM 7.2.1-69057 update 1
DS920+DSM 7.2.1-69057
DS920+DSM 7.2-64570 Update 1
DS920+DSM 7.2-64561
DS920+DSM 7.2-64216 Beta
DS920+DSM 7.1.1-42962 Update 1
RS1619xs+DSM 7.2.2-72806 Update 3
DS918+DSM 7.2-64570 Update 3
RS820+DSM 7.2-64570 Update 3M2D20
DS720+DSM 7.2.2 72806 Update 3
DS720+DSM 7.2.2 72806 Update 2
DS720+DSM 7.2.2 72806 Update 1
DS720+DSM 7.2.2-72806
DS720+DSM 7.2.1-69057 Update 5
DS720+DSM 7.2.1-69057 Update 4
DS720+DSM 7.2.1-69057 Update 3
DS720+DSM 7.2.1-69057 Update 2
DS720+DSM 7.2.1-69057 Update 1
DS720+DSM 7.2.1-69057
DS720+DSM 7.2-64570 Update 3
DS720+DSM 7.2-64570 Update 1
DS720+DSM 7.2-64570
DS720+DSM 7.2-64561
DS720+DSM 7.2-64216 Beta
DS420+DSM 7.2-64570 Update 1
DS1819+DSM 7.2-64216 BetaM2D20
DS1819+DSM 7.1.1M2D20
DS1019+DSM 7.2.2-72806
DS1019+DSM 7.2.1-69057 Update 2
DS1019+DSM 7.2-64561
DS1019+DSM 7.1.1-42962 Update 4
DS1618+DSM 7.1.1M2D18
DS918+DSM 7.2.1-69057 Update 5
DS918+DSM 7.2-64561
DS918+DSM 7.1.1
DS3617xsDSM 7.2-64570M2D20
</details>

Important

If you later update DSM and your M.2 drives are shown as unsupported and the storage pool is shown as missing, and online assemble fails, you need to run the <a href="https://github.com/007revad/Synology_HDD_db">Synology_HDD_db</a> script. The <a href="https://github.com/007revad/Synology_HDD_db">Synology_HDD_db</a> script should run after every DSM update.

Download the script

  1. Download the latest version Source code (zip) from https://github.com/007revad/Synology_M2_volume/releases
  2. Save the download zip file to a folder on the Synology.
  3. Unzip the zip file.

To run the script via SSH

How to enable SSH and login to DSM via SSH

YAML
sudo -s /volume1/scripts/syno_create_m2_volume.sh

Note: Replace /volume1/scripts/ with the path to where the script is located.

Troubleshooting

If the script won't run check the following:

  1. If the path to the script contains any spaces you need to enclose the path/scriptname in double quotes:
    YAML
    sudo -s "/volume1/my scripts/syno_create_m2_volume.sh"
  2. Make sure you unpacked the zip or rar file that you downloaded and are trying to run the syno_create_m2_volume.sh file.
  3. Set the syno_create_m2_volume.sh file as executable:
    YAML
    sudo chmod +x "/volume1/scripts/syno_create_m2_volume.sh"

Options:

YAML
-a, --all List all M.2 drives even if detected as active -s, --steps Show the steps to do after running this script -h, --help Show this help message -v, --version Show the script version

What to do after running the script

  1. Create the volume as you normally would:
    • Select the new Storage Pool > Create > Create Volume.
    • Set the allocated size.
      • Optionally enter a volume description. Be creative :)
    • Click Next.
    • Select the file system (Btrfs or ext4) and click Next.
    • Optionally enable Encrypt this volume and click Next.
      • Create an encryption password or enter your existing encryption password.
    • Confirm your settings and click Apply to finish creating your M.2 volume.
  2. Optionally enable and schedule TRIM:
    • Storage Pool > ... > Settings > SSD TRIM
    • Note: DSM 7.2 and later has no SSD TRIM setting for M.2 RAID 0
    • Note: DSM 7.1.1. has no SSD TRIM setting for M.2 storage pools

How to repair a NVMe storage pool or upgrade to larger drives


DSM 7 screen shots

<p align="center">Create SHR Storage Pool</p> <p align="center"><img src="/images/create_shr_v2.png"></p> <p align="center">Create Volume</p> <p align="center"><img src="/images/create-volume1.png"></p> <p align="center">Volume description</p> <p align="center"><img src="/images/create-volume3.png"></p> <p align="center">Allocate volume capacity</p> <p align="center"><img src="/images/create-volume2.png"></p> <p align="center">Select file system</p> <p align="center"><img src="/images/create-volume4.png"></p> <p align="center">Success!</p> <p align="center"><img src="/images/create-volume5.png"></p> <p align="center">Enable TRIM</p> <p align="center"><img src="/images/create_m2_volume_enable_trim.png"></p>

Contributors

Showing top 3 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from 007revad/Synology_M2_volume via the GitHub API.Last fetched: 6/23/2026