{"id":17674552,"url":"https://github.com/007revad/synology_m2_volume","last_synced_at":"2025-05-15T00:13:46.206Z","repository":{"id":144927986,"uuid":"617252055","full_name":"007revad/Synology_M2_volume","owner":"007revad","description":"Easily create an M.2 volume on Synology NAS","archived":false,"fork":false,"pushed_at":"2025-04-20T06:44:41.000Z","size":1166,"stargazers_count":1125,"open_issues_count":3,"forks_count":66,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-11T22:38:15.881Z","etag":null,"topics":["diskstation","dsm","rackstation","synology","synology-disk-station","synology-dsm","synology-nas"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/007revad.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"007revad","buy_me_a_coffee":"007revad","custom":["https://www.paypal.me/007revad"]}},"created_at":"2023-03-22T01:55:44.000Z","updated_at":"2025-05-11T13:03:01.000Z","dependencies_parsed_at":"2023-11-15T06:22:37.973Z","dependency_job_id":"2bba38e0-fcff-4b8f-9ae7-9845b46e7442","html_url":"https://github.com/007revad/Synology_M2_volume","commit_stats":{"total_commits":294,"total_committers":3,"mean_commits":98.0,"dds":"0.010204081632653073","last_synced_commit":"9b29e311e95e988f7e8dbd77f10f8b8a13274089"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/007revad%2FSynology_M2_volume","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/007revad%2FSynology_M2_volume/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/007revad%2FSynology_M2_volume/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/007revad%2FSynology_M2_volume/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/007revad","download_url":"https://codeload.github.com/007revad/Synology_M2_volume/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249206,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diskstation","dsm","rackstation","synology","synology-disk-station","synology-dsm","synology-nas"],"created_at":"2024-10-24T07:07:31.896Z","updated_at":"2025-05-15T00:13:41.163Z","avatar_url":"https://github.com/007revad.png","language":"Shell","funding_links":["https://github.com/sponsors/007revad","https://buymeacoffee.com/007revad","https://www.paypal.me/007revad","https://www.paypal.com/paypalme/007revad"],"categories":[],"sub_categories":[],"readme":"# Synology M2 volume\n\n\u003ca href=\"https://github.com/007revad/Synology_M2_volume/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/007revad/Synology_M2_volume.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://hits.seeyoufarm.com\"\u003e\u003cimg src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2F007revad%2FSynology_M2_volume\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=views\u0026edge_flat=false\"/\u003e\u003c/a\u003e\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/paypalme/007revad)\n[![](https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86)](https://github.com/sponsors/007revad)\n[![committers.top badge](https://user-badge.committers.top/australia/007revad.svg)](https://user-badge.committers.top/australia/007revad)\n\n### Description\n\nEasily 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.\n\nThis script creates the RAID and storage pool on your NVMe drive(s) so you can then create the volume in the Storage Manager.\n\nAll 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.\n\nIt also allows you to create a storage pool/volume spanning internal NVMe drives and NVMe drives in a Synology M.2 PCIe card.\n\nFor Xpenology users the script supports an unlimited number of NVMe drives (except for RAID 1 and Basic).\n\n**Supports DSM 7 and later** \n\nFor [DSM 6 use v1](https://github.com/007revad/Synology_M2_volume/releases/tag/v1.3.25) and run **without** the auto update option.\n\n**NEW in v2**\n- Now shows \"M.2 Drive #\" the same as storage manager.\n- Now uses synostgpool command which allows the following: (Thanks to Severe_Pea_2128 on reddit)\n  - Now supports JBOD, SHR, SHR2 and RAID F1.\n  - Added choice of multi-volume or single-volume storage pool. Multi-volume allows overprovisioning.\n  - Added option to skip drive check.\n  - No longer need to reboot after running the script.\n  - No longer need to do an online assemble.\n- Removed drive check progress as it was not possible with synostgpool.\n  - You can see the drive check progress in Storage Manager.\n- Removed dry run mode as it was not possible with synostgpool.\n- Removed support for SATA M.2 drives.\n  - If you have SATA M.2 drives [use v1](https://github.com/007revad/Synology_M2_volume/releases/tag/v1.3.25) and run **without** the auto update option.\n\n### RAID levels supported\n\n| RAID Level  | Min Drives Required  | Maximum Drives | Script version |\n| ----------- |------------------|----------------|----------------|\n| SHR 1       | 1 or more drives | Unlimited      | v2 and later (DSM 7 only) |\n| SHR 2       | 4 or more drives | Unlimited      | v2 and later (DSM 7 only) |\n| Basic       | 1 drive          | 1 drive        | all |\n| JBOD        | 1 or more drives | Unlimited      | v2 and later (DSM 7 only) |\n| RAID 0      | 2 or more drives | Unlimited      | all |\n| RAID 1      | 2 or more drives | 4 drives       | all |\n| RAID 5      | 3 or more drives | Unlimited      | all |\n| RAID 6      | 4 or more drives | Unlimited      | v1.3.15 and later |\n| RAID 10     | 4 or more drives | Unlimited      | v1.3.15 and later |\n| RAID F1     | 3 or more drives | Unlimited      | v2 and later (DSM 7 only) |\n\nIf RAID F1 is selected the script enables RAID F1 on Synology models that don't officially support RAID F1.\n\n### Confirmed working on\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick here to see list\u003c/summary\u003e\n\n| Model        | DSM version              | M.2 card  | Notes           |\n| ------------ |--------------------------|-----------|-----------------|\n| All          | DSM 6                    |           | [Use v1](https://github.com/007revad/Synology_M2_volume/releases/tag/v1.3.25) run without auto update option |\n| RS2423+      | DSM 7.2-64570 Update 1   |           |\n| DS1823xs+    | DSM 7.2-64561            | M2D20     |\n| DS923+       | DSM 7.2.2-72806 Update 3 |           |\n| DS923+       | DSM 7.2.2-72806 Update 2 |           |\n| DS923+       | DSM 7.2.2 72806 Update 1 |           |\n| DS923+       | DSM 7.2.1-69057 Update 5 |           |\n| DS923+       | DSM 7.2.1-69057 Update 2 |           |\n| DS923+       | DSM 7.1.1-42962 Update 5 |           |\n| DS723+       | DSM 7.2.2-72806 Update 2 |           |\n| DS723+       | DSM 7.2.1-69057 Update 3 |           |\n| DS723+       | DSM 7.2-64570 Update 1   |           |\n| DS723+       | DSM 7.1.1-42962 Update 4 |           |\n| DS423+       | DSM 7.2.2-72806          |           |\n| DS423+       | DSM 7.2.1-69057 Update 3 |           |\n| DS423+       | DSM 7.2-64570 Update 3   |           |\n| DS423+       | DSM 7.1.1-42962 Update 4 |           |\n| DS3622xs+    | DSM 7.2-64216 Beta       | E10M20-T1 |\n| DS3622xs+    | DSM 7.1.1-42962 Update 1 |           |\n| DS2422+      | DSM 7.2.1-69057 Update 4 | E10M20-T1 |\n| DS1522+      | DSM 7.2.1-69057 Update 4 |           |\n| DS1522+      | DSM 7.2-64570            |           |\n| DS1522+      | DSM 7.1.1-42962 Update 4 |           |\n| DS1821+      | DSM 7.2.1-69057 Update 4 | E10M20-T1 | Also needs [Synology enable_M2_card](https://github.com/007revad/Synology_enable_M2_card) |\n| DS1821+      | DSM 7.2.1-69057 Update 4 | M2D20     | Also needs [Synology enable_M2_card](https://github.com/007revad/Synology_enable_M2_card) |\n| DS1821+      | DSM 7.2.1-69057 Update 4 | M2D18     | Also needs [Synology enable_M2_card](https://github.com/007revad/Synology_enable_M2_card) |\n| DS1821+      | DSM 7.2.1-69057 Update 4 |           |\n| DS1821+      | DSM 7.2.1-69057 Update 3 |           |\n| DS1821+      | DSM 7.2.1-69057 Update 2 |           |\n| DS1821+      | DSM 7.2.1-69057 Update 1 |           |\n| DS1821+      | DSM 7.2.1-69057          |           |\n| DS1821+      | DSM 7.2-64570 Update 3   |           |\n| DS1821+      | DSM 7.2-64570 Update 1   | E10M20-T1 | Also needs [Synology enable_M2_card](https://github.com/007revad/Synology_enable_M2_card) |\n| DS1821+      | DSM 7.2-64570 Update 1   | M2D18     | Also needs [Synology enable_M2_card](https://github.com/007revad/Synology_enable_M2_card) |\n| DS1821+      | DSM 7.2-64570 Update 1   |           |\n| DS1821+      | DSM 7.2-64570            |           |\n| DS1821+      | DSM 7.2-64561            |           |\n| DS1821+      | DSM 7.2-64216 Beta       |           |\n| DS1821+      | DSM 7.2-64213 Beta       |           |\n| DS1821+      | DSM 7.1.1-42962 Update 4 |           |\n| DS1621xs+    | DSM 7.2.1-69057 Update 5 |           |\n| DS1621+      | DSM 7.2-64570 Update 1   | E10M20-T1 | Also needs [Synology enable_M2_card](https://github.com/007revad/Synology_enable_M2_card) |\n| DS1621+      | DSM 7.2-64570 Update 1   |           |\n| DS1621+      | DSM 7.1.1-42962 Update 4 |           |\n| RS1221+      | DSM 7.2-64570 Update 1   | E10M20-T1 |\n| RS1221+      | DSM 7.1.1                | E10M20-T1 |\n| DS1520+      | DSM 7.2.1-69057 Update 2 |           |\n| DS1520+      | DSM 7.2-64570 Update 1   |           |\n| DS1520+      | DSM 7.1.1-42962 Update 4 |           |\n| DS920+       | DSM 7.2.2 72806 Update 3 |           |\n| DS920+       | DSM 7.2.2 72806 Update 2 |           |\n| DS920+       | DSM 7.2.2 72806 Update 1 |           |\n| DS920+       | DSM 7.2.2-72806          |           |\n| DS920+       | DSM 7.2.1-69057 Update 5 |           |\n| DS920+       | DSM 7.2.1-69057 Update 4 |           |\n| DS920+       | DSM 7.2.1-69057 Update 3 |           |\n| DS920+       | DSM 7.2.1-69057 Update 2 |           |\n| DS920+       | DSM 7.2.1-69057 update 1 |           |\n| DS920+       | DSM 7.2.1-69057          |           |\n| DS920+       | DSM 7.2-64570 Update 1   |           |\n| DS920+       | DSM 7.2-64561            |           |\n| DS920+       | DSM 7.2-64216 Beta       |           |\n| DS920+       | DSM 7.1.1-42962 Update 1 |           |\n| RS1619xs+    | DSM 7.2.2-72806 Update 3 |           |\n| DS918+       | DSM 7.2-64570 Update 3   |           |\n| RS820+       | DSM 7.2-64570 Update 3   | M2D20     |\n| DS720+       | DSM 7.2.2 72806 Update 3 |           |\n| DS720+       | DSM 7.2.2 72806 Update 2 |           |\n| DS720+       | DSM 7.2.2 72806 Update 1 |           |\n| DS720+       | DSM 7.2.2-72806          |           |\n| DS720+       | DSM 7.2.1-69057 Update 5 |           |\n| DS720+       | DSM 7.2.1-69057 Update 4 |           |\n| DS720+       | DSM 7.2.1-69057 Update 3 |           |\n| DS720+       | DSM 7.2.1-69057 Update 2 |           |\n| DS720+       | DSM 7.2.1-69057 Update 1 |           |\n| DS720+       | DSM 7.2.1-69057          |           |\n| DS720+       | DSM 7.2-64570 Update 3   |           |\n| DS720+       | DSM 7.2-64570 Update 1   |           |\n| DS720+       | DSM 7.2-64570            |           |\n| DS720+       | DSM 7.2-64561            |           |\n| DS720+       | DSM 7.2-64216 Beta       |           |\n| DS420+       | DSM 7.2-64570 Update 1   |           |\n| DS1819+      | DSM 7.2-64216 Beta       | M2D20     |\n| DS1819+      | DSM 7.1.1                | M2D20     |\n| DS1019+      | DSM 7.2.2-72806          |           |\n| DS1019+      | DSM 7.2.1-69057 Update 2 |           |\n| DS1019+      | DSM 7.2-64561            |           |\n| DS1019+      | DSM 7.1.1-42962 Update 4 |           |\n| DS1618+      | DSM 7.1.1                | M2D18     |\n| DS918+       | DSM 7.2.1-69057 Update 5 |           |\n| DS918+       | DSM 7.2-64561            |           |\n| DS918+       | DSM 7.1.1                |           |\n| DS3617xs     | DSM 7.2-64570            | M2D20     |\n\n\u003c/details\u003e\n\n### Important\n\nIf 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 \u003ca href=\"https://github.com/007revad/Synology_HDD_db\"\u003eSynology_HDD_db\u003c/a\u003e script. The \u003ca href=\"https://github.com/007revad/Synology_HDD_db\"\u003eSynology_HDD_db\u003c/a\u003e script should run after every DSM update.\n\n### Download the script\n\n1. Download the latest version _Source code (zip)_ from https://github.com/007revad/Synology_M2_volume/releases\n2. Save the download zip file to a folder on the Synology.\n3. Unzip the zip file.\n\n### To run the script via SSH\n\n[How to enable SSH and login to DSM via SSH](https://kb.synology.com/en-global/DSM/tutorial/How_to_login_to_DSM_with_root_permission_via_SSH_Telnet)\n\n```YAML\nsudo -s /volume1/scripts/syno_create_m2_volume.sh\n```\n\n**Note:** Replace /volume1/scripts/ with the path to where the script is located.\n\n### Troubleshooting\n\nIf the script won't run check the following:\n\n1. If the path to the script contains any spaces you need to enclose the path/scriptname in double quotes:\n   ```YAML\n   sudo -s \"/volume1/my scripts/syno_create_m2_volume.sh\"\n   ```\n2. Make sure you unpacked the zip or rar file that you downloaded and are trying to run the syno_create_m2_volume.sh file.\n3. Set the syno_create_m2_volume.sh file as executable:\n   ```YAML\n   sudo chmod +x \"/volume1/scripts/syno_create_m2_volume.sh\"\n   ```\n\n### Options:\n```YAML\n  -a, --all        List all M.2 drives even if detected as active\n  -s, --steps      Show the steps to do after running this script\n  -h, --help       Show this help message\n  -v, --version    Show the script version\n```\n\n### What to do after running the script\n\n1. Create the volume as you normally would:\n    - Select the new Storage Pool \u003e Create \u003e Create Volume.\n    - Set the allocated size.\n      - Optionally enter a volume description. Be creative :)\n    - Click Next.\n    - Select the file system (Btrfs or ext4) and click Next.\n    - Optionally enable *Encrypt this volume* and click Next.\n      - Create an encryption password or enter your existing encryption password. \n    - Confirm your settings and click Apply to finish creating your M.2 volume.\n4. Optionally enable and schedule TRIM:\n    - Storage Pool \u003e ... \u003e Settings \u003e SSD TRIM    \n    - **Note: DSM 7.2 and later has no SSD TRIM setting for M.2 RAID 0**\n    - **Note: DSM 7.1.1. has no SSD TRIM setting for M.2 storage pools**\n\n-----\n### How to repair a NVMe storage pool or upgrade to larger drives\n\n- Repair degraded storage pool in DSM 7.2 or later\n  - [Repair NVMe RAID 1 in internal M.2 slots](https://github.com/007revad/Synology_M2_volume/wiki/Repair-M.2-RAID-1-in-internal-M.2-slots)\n  - [Repair NVMe RAID 1 in adaptor card](https://github.com/007revad/Synology_M2_volume/wiki/Repair-M.2-RAID-1-in-adaptor-card)\n- Upgrade to larger NVMe drives in DSM 7.2 or later\n  - [Replace M.2 RAID 1 with larger drives](https://github.com/007revad/Synology_M2_volume/wiki/Replace-M.2-RAID-1-with-larger-drives)\n- Repair via SSH for DSM 6\n  - [How Synology Support repairs RAID in DSM 6](https://github.com/007revad/Synology_M2_volume/wiki/Repair-RAID-via-SSH)\n\n-----\n### DSM 7 screen shots\n\n\u003cp align=\"center\"\u003eCreate SHR Storage Pool\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"/images/create_shr_v2.png\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eCreate Volume\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"/images/create-volume1.png\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eVolume description\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"/images/create-volume3.png\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eAllocate volume capacity\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"/images/create-volume2.png\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eSelect file system\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"/images/create-volume4.png\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eSuccess!\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"/images/create-volume5.png\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eEnable TRIM\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"/images/create_m2_volume_enable_trim.png\"\u003e\u003c/p\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F007revad%2Fsynology_m2_volume","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F007revad%2Fsynology_m2_volume","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F007revad%2Fsynology_m2_volume/lists"}