隔壁网

来吧兄弟,一起玩一起讨论!

您需要 登录 才可以下载或查看,没有帐号?注册

x
本帖最后由 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 :
  1. ls /dev/nvme*
复制代码


You will see the /dev/nvme0n1 or /dev/nvme1n1 depend on which slot you install the SSD.
type:
  1. 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 bytes
Now, create partition. Type:
synopartition --part /dev/nvme0n1 12
and 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? [y/N]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.

Type
  1. fdisk -l /dev/nvme0n1
复制代码

You will see the partition layout is created
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 bytesDisklabel type: dosDisk identifier: 0xef61a3e4Device         Boot   Start       End   Sectors  Size Id Type/dev/nvme0n1p1         2048   4982527   4980480  2.4G fd Linux raid autodetect/dev/nvme0n1p2      4982528   9176831   4194304    2G fd Linux raid autodetect/dev/nvme0n1p3      9437184 500103449 490666266  234G 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)

Type
  1. cat /proc/mdstat
复制代码


To see your current RAID setup
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]md2 : active raid1 sda3[0] sdb3[1]      5855700544 blocks super 1.2 [2/2] [UU]md3 : active raid1 sdc3[0] sdd3[1]      9761614848 blocks super 1.2 [2/2] [UU]md1 : active raid1 sda2[0] sdb2[1] sdc2[2] sdd2[3]      2097088 blocks [4/4] [UUUU]md0 : active raid1 sda1[0] sdb1[3] sdc1[1] sdd1[2]      2489920 blocks [4/4] [UUUU]
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:
  1. mdadm --create /dev/md4 --level=1 --raid-devices=1 --force /dev/nvme0n1p3
复制代码

(if md4 already exist, you should use next md number)
And answer y
mdadm: 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
Type
  1. mkfs.ext4 -F /dev/md5
复制代码

as I use ext4
mke2fs 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: done
if need btrfs, type
  1. mkfs.btrfs -f /dev/md5
复制代码


which can use for vm storage

After format complete , type
reboot
and after the machine bootup, you will see the Volume in DSM Storage Manager




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

查看全部评分

分享到 :
3 人收藏

11 个回复

倒序浏览
watermoon  VIP贵宾 | 2020-2-11 18:24:01
技术性很强啊,这么多英文呢
ml_0602  VIP贵宾 | 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  正常36.8℃ | 2020-2-12 15:58:06
找个机会试一下
wwdzcdb  高烧40℃ | 2020-2-12 17:07:33
多谢大佬的分享
jimmyjin  骷髅 | 2020-2-12 17:28:44
Nvme RAID1  RAID0 或者RAID5 (起码3盘) 应该都可以了, 比如两个Nvme 盘 RAID0, 就是在首帖的mdadm命令那里, 改成:
  1. 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  高烧40℃ | 2020-2-12 17:58:36
不错不错。学习了
vman  高烧40℃ | 6 天前
技术性很强啊,这么多英文呢。但我听说很容易损伤硬盘
您需要登录后才可以回帖 登录 | 注册

本版积分规则

微信扫一扫关注公众号,获取注册邀请码!

小黑屋|手机版|Archiver|隔壁网 ( 粤ICP备14056481号-1 )

Powered by Discuz! X3.4 © 2001-2016 Comsenz Inc.

返回顶部