jimmyjin 发表于 2020-2-11 17:14:29

黑白裙均可!DS918+ 使用Nvme SSD做存储空间的技巧

本帖最后由 jimmyjin 于 2020-2-11 19:50 编辑

在帖子http://www.gebi1.com/thread-295316-1-1.html里我讨论了如何像白裙DS918+一样使用Nvme SSD 做缓存, 这篇说的是如何用Nvme SSD做存储空间目前的限制是只能做单盘basic空间, 怎么做多盘RAID1, RAID5我还要研究一下。
这是在我的万兆网卡下的SMB读写速度:

写到最后下降了 ,因为这块东芝RC500 250G SSD的SLC模拟缓存用完了.......



建立NVme存储分区的步骤:
不好意思, 我就原文copy reddit论坛里面的内容了, 能操作的, 自然看得懂这点英文, 看不懂的,我觉得没有办法避免误操作的风险(毁原有存储空间), 还是不要试了。 我故意不返程
Login as root with SSH (I use putty in Windows) and type :ls /dev/nvme*

You will see the /dev/nvme0n1 or /dev/nvme1n1 depend on which slot you install the SSD.type:fdisk -l /dev/nvme0n1

You wil see the disk information. ( if your SSD at slot 2, use /dev/nvme1n1 instead)Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesNow, create partition. Type:synopartition --part /dev/nvme0n1 12and answer 'Y' if you confirm      Device   Sectors (Version8: SupportRaid) /dev/nvme0n11   4980480 (2431 MB) /dev/nvme0n12   4194304 (2048 MB)Reserved size:    260352 ( 127 MB)Primary data partition will be created.WARNING: This action will erase all data on '/dev/nvme0n1' and repart it, are you sure to continue? yCleaning all partitions...Creating sys partitions...Creating primary data partition...Please remember to mdadm and mkfs new partitions.it will create the partition that follow DSM required layout.
Typefdisk -l /dev/nvme0n1
You will see the partition layout is createdDisk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0xef61a3e4Device         Boot   Start       End   SectorsSize Id Type/dev/nvme0n1p1         2048   4982527   49804802.4G fd Linux raid autodetect/dev/nvme0n1p2      4982528   9176831   4194304    2G fd Linux raid autodetect/dev/nvme0n1p3      9437184 500103449 490666266234G fd Linux raid autodetect
Create Basic Disk
I have only tried to create Basic Disk Volume as I have only one SSD. For other type of volume/storage pool (RAID0, RAID1, SHR) , I have not tested.
For Basic Disk, it need to create a single partition RAID1 device in order for DSM to recognize it. (as this is what DSM Storage Manager will do when create a Basic Disk Volume)
Typecat /proc/mdstat

To see your current RAID setupPersonalities : md2 : active raid1 sda3 sdb3      5855700544 blocks super 1.2 md3 : active raid1 sdc3 sdd3      9761614848 blocks super 1.2 md1 : active raid1 sda2 sdb2 sdc2 sdd2      2097088 blocks md0 : active raid1 sda1 sdb1 sdc1 sdd1      2489920 blocks AFAIK, md0 is system partition and md1 is system swap. You current volume/storage pool will start at md2.
To current your NVME Basic disk, type:mdadm --create /dev/md4 --level=1 --raid-devices=1 --force /dev/nvme0n1p3
(if md4 already exist, you should use next md number)And answer ymdadm: Note: this array has metadata at the start and    may not be suitable as a boot device.If you plan to    store '/boot' on this device please ensure that    your boot-loader understands md/v1.x metadata, or use    --metadata=0.90Continue creating array? ymdadm: Defaulting to version 1.2 metadatamdadm: array /dev/md5 started.
Create Filesystem
Typemkfs.ext4 -F /dev/md5
as I use ext4mke2fs 1.42.6 (21-Sep-2012)Filesystem label=1.42.6-23824OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks15335424 inodes, 61333024 blocks25600 blocks (0.04%) reserved for the super userFirst data block=0Maximum filesystem blocks=22103982081872 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks:      32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,      4096000, 7962624, 11239424, 20480000, 23887872Allocating group tables: doneWriting inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: doneif need btrfs, typemkfs.btrfs -f /dev/md5

which can use for vm storage
After format complete , typerebootand after the machine bootup, you will see the Volume in DSM Storage Manager



没有回复可见内容, 不用回复“ 谢谢分享”, 我反对回复可见机制

jimmyjin 发表于 2020-2-16 10:20:36

vman 发表于 2020-2-14 20:51
技术性很强啊,这么多英文呢。但我听说很容易损伤硬盘

DSM不认为这是SSD存储空间,不支持TRIM。
话说这个功能是探索性的添头, 打头的那篇黑裙Nvme SSD做缓存才是重要的, 有群晖DSM的完全支持

watermoon 发表于 2020-2-11 18:24:01

技术性很强啊,这么多英文呢

ml_0602 发表于 2020-2-11 21:10:22

原来还可以这么玩呀。。。。不错不错。学习了。。。

geniusjoy 发表于 2020-2-12 13:55:49

1.创建volume
2.格式化分区,只是用命令行操作,不是用dsm界面

jimmyjin 发表于 2020-2-12 14:09:36

geniusjoy 发表于 2020-2-12 13:55
1.创建volume
2.格式化分区,只是用命令行操作,不是用dsm界面

差不多就是这意思, 这两天等有空余的Nvme了, 试试通过mdadm 命令建更复杂的存储空间, 如Nvme RAID1 或者RAID5

gui123 发表于 2020-2-12 15:58:06

找个机会试一下

wwdzcdb 发表于 2020-2-12 17:07:33

多谢大佬的分享

jimmyjin 发表于 2020-2-12 17:28:44

Nvme RAID1RAID0 或者RAID5 (起码3盘) 应该都可以了, 比如两个Nvme 盘 RAID0, 就是在首帖的mdadm命令那里, 改成:
mdadm --create /dev/md4 --level=0 --raid-devices=2 --force /dev/nvme0n1p3/dev/nvme1n1p3这里假设你的两块Nvme 是/dev/nvme0 和 /dev/nvme1
这样组出来的存储空间当然是可用, 但唯一的问题是不支持Trim, Trim那一页是灰的, 这似乎是DSM 目前只考虑SATA SSD 做 存储空间的缘故


fzj2019 发表于 2020-2-12 17:58:36

不错不错。学习了

vman 发表于 2020-2-14 20:51:17

技术性很强啊,这么多英文呢。但我听说很容易损伤硬盘

非凡 发表于 2020-2-17 11:35:27

蜗牛党路过。

doodle 发表于 2020-3-17 14:22:52

如果500G nvme ssd刷了二合一启动,做启动盘,剩下的空间怎么利用起来做存储呢?上面方式应该适合空盘

doodle 发表于 2020-3-17 14:24:00

按照其他sata固态盘的扩容方式,发现nvme的可以启动,就是空间看不到,包括二合一里默认的那个9.4G的也看不到

kokia 发表于 2020-3-17 14:34:30

很强很强,,牛

jimmyjin 发表于 2020-3-19 16:26:59

doodle 发表于 2020-3-17 14:24
按照其他sata固态盘的扩容方式,发现nvme的可以启动,就是空间看不到,包括二合一里默认的那个9.4G的也看不 ...

到我帖子顶部的那个链接里看怎么解决驱动问题
大家都看这篇添头, 不看真正关键的Nvme驱动的问题解决方法那一贴, 我也是醉了。

easy113 发表于 2020-3-31 04:26:27

redddit原帖的老外说,他弄好之后系统更新了两次都没事,但是有一次ssd掉盘还是怎么的把数据全都删了Just an update for anyone monitoring this.

I did the update a day after this was first posted, since I had a NVMe drive that was sitting idle in the DS918. I copied all my docker containers over, and launched them so my spindle drives could go idle.



Everything worked fine for week, however magically all my directories and files on /volume4 disappeared, and all the docker data was lost, without any notice. This was before the DSM update, so clearly something else happened that nuked the partition. The DSM update installed last night, and /volume4 is still there, so the changes persist updates, but all the volume data is lost.不知道楼主有没有对稳定性做个测试?我捡便宜弄了台918,这两天在倒数据呢,想淘宝海淘一条sm963 22110 480gb的来直接当储存空间用,不知道有没有可行性,wen'ding'cheng'du'ru'he
nvme做缓存就是个鸡肋,插傲腾16G那个上去还差不多,反正一条也才35块,看很多评测贴放120 240甚至两条的,真是钱多人傻啊

jimmyjin 发表于 2020-3-31 15:00:08

easy113 发表于 2020-3-31 04:26
redddit原帖的老外说,他弄好之后系统更新了两次都没事,但是有一次ssd掉盘还是怎么的把数据全都删了不知道 ...

我前几天大概测了NVME空间copy/做DDSM虚拟机, docker, jeelyfin 解码等, 很稳定
但你如果是白裙918,反正千兆网口速度限制在那里, 用nvme和SATA SSD 有啥差别?还不如不hack, 稳稳用SATA SSD

castock 发表于 2020-3-31 15:31:07

技术小白还是不试了,谢谢LZ分享!

小开心 发表于 2020-3-31 19:37:30

学习了,紫薯布丁
页: [1] 2
查看完整版本: 黑白裙均可!DS918+ 使用Nvme SSD做存储空间的技巧