Skip to content

Instantly share code, notes, and snippets.

@Aziz87
Created November 26, 2021 17:09
Show Gist options
  • Save Aziz87/4b80808d1cd5b2f02b592d509ecb3d93 to your computer and use it in GitHub Desktop.
Save Aziz87/4b80808d1cd5b2f02b592d509ecb3d93 to your computer and use it in GitHub Desktop.
1.detach
dmesg -c
nvme detach-ns /dev/nvme0 -n 1 -c 0
nvme delete-ns /dev/nvme0 -n 1
nvme reset /dev/nvme0
2.创建
**#1953125000 = 1,000,000,000,000/512 = 1,953,125,000 (1TB)**
nvme create-ns /dev/nvme0 -s 976562500 -c 976562500 -f 0 -d 0 -m 0
nvme attach-ns /dev/nvme0 -n 1 -c 0
nvme create-ns /dev/nvme0 -s 975175680 -c 975175680 -f 0 -d 0 -m 0 #第二个创建的必须
nvme attach-ns /dev/nvme0 -n 2 -c 0
nvme reset /dev/nve0
nvme list
[root@localhost Muti-namespace_Test]# nvme list
Node SN Model Namespace Usage Format FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1 XXXXXX XXXXX 1 500.36 GB / 500.36 GB 512 B + 0 B VDV10152
/dev/nvme0n2 XXXXXX XXXXX 2 499.29 GB / 499.29 GB 512 B + 0 B VDV10152
3,删除
nvme detach-ns /dev/nvme0 -n 1 -c 0
nvme detach-ns /dev/nvme0 -n 2 -c 0
nvme delete-ns /dev/nvme0 -n 1
nvme delete-ns /dev/nvme0 -n 2
4.恢复
nvme create-ns /dev/nvme0 -s 1000204886016 -c 1000204886016 -f 0 -d 0 -m 0 #1000204886016是通过“nvme id-ctrl /dev/nvme0n1 | grep tnvmcap”抓取并除以512
nvme attach-ns /dev/nvme0 -n 1 -c 0
nvme reset /dev/nvme0
nvme list
[root@localhost Muti-namespace_Test]# nvme list
@Aziz87
Copy link
Author

Aziz87 commented Nov 27, 2021

Но лучше создать систему через rescue командой Installimage, там в блокноте вписать raid 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment