From 4fc5af6434c84bc0325ea65f8303cac56e41e409 Mon Sep 17 00:00:00 2001 From: Anthony Floeder Date: Fri, 30 Sep 2022 14:03:24 -0500 Subject: [PATCH 1/2] Tools directory changes: - Add readme.md demonstrating expected tool script usage for namespace manipulation - Add examples to nvme.sh - Extend create-write-delete.sh to format the namespace before deleting the namespace to see if delete_ns speeds up. Signed-off-by: Anthony Floeder Add readme.md that demonstrates usage Signed-off-by: Anthony Floeder --- tools/create-write-delete-namespaces.sh | 13 +- tools/lvm.sh | 2 +- tools/nvme.sh | 9 +- tools/readme.md | 385 ++++++++++++++++++++++++ 4 files changed, 405 insertions(+), 4 deletions(-) create mode 100644 tools/readme.md diff --git a/tools/create-write-delete-namespaces.sh b/tools/create-write-delete-namespaces.sh index c7ba40b..66a1aa6 100755 --- a/tools/create-write-delete-namespaces.sh +++ b/tools/create-write-delete-namespaces.sh @@ -47,7 +47,7 @@ case "$SIZE" in ./lvm.sh create # Write a little something to the logical volume to give the drives some work to do on delete-ns operation - fio --direct=1 --rw=randwrite --bs=32M --ioengine=libaio --iodepth=128 --numjobs=4 --runtime=30s --time_based --group_reporting --name=rabbit --eta-newline=1 --filename=/dev/rabbit/rabbit + fio --direct=1 --rw=randwrite --bs=32M --ioengine=libaio --iodepth=128 --numjobs=4 --runtime=5m --time_based --group_reporting --name=rabbit --eta-newline=1 --filename=/dev/rabbit/rabbit if [ $DELAY_TO_COOL_CPU != 0 ] then @@ -57,6 +57,17 @@ case "$SIZE" in # Delete the logical volume to tidy up ./lvm.sh delete + # Format the namespace to speed up deletion + ./nvme.sh cmd format -f -n 1 + + # Wait for the format to finish + areWeDone=$(nvme list | grep KIO | awk '{if ($6 > 0) { print "wait" } else { print "done" }}') + while [ "$areWeDone" != "done" ]; do + sleep 1 + printf "Formatting, space left %f\n" "$(nvme list | grep KIO | awk '{print $6}')" + areWeDone=$(nvme list | grep KIO | awk '{if ($6 > 0) { print "wait" } else { print "done" }}') + done + # Show the nvme namespaces for the record nvme list | grep KIO diff --git a/tools/lvm.sh b/tools/lvm.sh index b6b0d5f..f68c622 100755 --- a/tools/lvm.sh +++ b/tools/lvm.sh @@ -43,7 +43,7 @@ drives() { if [ "${NAMESPACEID::-1}" == "$NAMESPACE" ]; then echo " Found Namespace ${NAMESPACE}" - + DRIVES+=(${DRIVE}) fi fi diff --git a/tools/nvme.sh b/tools/nvme.sh index fc7445c..acdb1f1 100755 --- a/tools/nvme.sh +++ b/tools/nvme.sh @@ -39,8 +39,13 @@ Arguments: -h display this help -t time each command -Example: - nvme.sh -t delete 1 +Examples: + ./nvme.sh -t delete 1 + ./nvme.sh cmd id-ctrl | grep -E "^fr " # firmware level + ./nvme.sh cmd id-ctrl | grep -E "^mn " # model name + ./nvme.sh cmd format -f -n # format specified namespace + + ./nvme.sh cmd virt-mgmt --cntlid=3 --act=9 # enable CM7 virtual functions EOF } diff --git a/tools/readme.md b/tools/readme.md new file mode 100644 index 0000000..3757262 --- /dev/null +++ b/tools/readme.md @@ -0,0 +1,385 @@ +# Tools for low-level device manipulation + +The scripts in this directory are meant for low-level NVMe device manipulation as well as Microchip Pax switch debugging across. For individual script details, execute the script with the `-h` option. + +**NOTE**: All of the following scripts iterate through the KIOXIA drives in the system and perform the same operation on each. + +## NVMe Drive access + +`bind.sh` sets up PCIe access to each drive connected to the Microchip PAX switches. Run this script **once** after a PAX powercycle to access the drives. Once the drives are bound, use the `nvme.sh` script to send commands to the drives. + +## Creating an LVM volume + +To create an LVM volume, the following sequence of steps is required: + +- Create a namespace on each drive +- Attach that namespace to a controller +- Create the LVM volume from those namespaces + +```bash +[root@RabbitP-CPU tools]# ./nvme.sh list +Namespaces on 0x1600@/dev/switchtec0 +Namespaces on 0x1900@/dev/switchtec0 +Namespaces on 0x1700@/dev/switchtec0 +Namespaces on 0x1400@/dev/switchtec0 +Namespaces on 0x1800@/dev/switchtec0 +Namespaces on 0x1a00@/dev/switchtec0 +Namespaces on 0x1300@/dev/switchtec0 +Namespaces on 0x1500@/dev/switchtec0 +Namespaces on 0x4100@/dev/switchtec1 +Namespaces on 0x3e00@/dev/switchtec1 +Namespaces on 0x3d00@/dev/switchtec1 +Namespaces on 0x3c00@/dev/switchtec1 +Namespaces on 0x4000@/dev/switchtec1 +Namespaces on 0x4200@/dev/switchtec1 +Namespaces on 0x3b00@/dev/switchtec1 +Namespaces on 0x3f00@/dev/switchtec1 +[root@RabbitP-CPU tools]# ./nvme.sh create +Reading Capacity on 0x1600@/dev/switchtec0 +Creating Namespaces on 0x1600@/dev/switchtec0 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x1900@/dev/switchtec0 +Creating Namespaces on 0x1900@/dev/switchtec0 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x1700@/dev/switchtec0 +Creating Namespaces on 0x1700@/dev/switchtec0 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x1400@/dev/switchtec0 +Creating Namespaces on 0x1400@/dev/switchtec0 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x1800@/dev/switchtec0 +Creating Namespaces on 0x1800@/dev/switchtec0 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x1a00@/dev/switchtec0 +Creating Namespaces on 0x1a00@/dev/switchtec0 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x1300@/dev/switchtec0 +Creating Namespaces on 0x1300@/dev/switchtec0 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x1500@/dev/switchtec0 +Creating Namespaces on 0x1500@/dev/switchtec0 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x4100@/dev/switchtec1 +Creating Namespaces on 0x4100@/dev/switchtec1 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x3e00@/dev/switchtec1 +Creating Namespaces on 0x3e00@/dev/switchtec1 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x3d00@/dev/switchtec1 +Creating Namespaces on 0x3d00@/dev/switchtec1 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x3c00@/dev/switchtec1 +Creating Namespaces on 0x3c00@/dev/switchtec1 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x4000@/dev/switchtec1 +Creating Namespaces on 0x4000@/dev/switchtec1 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x4200@/dev/switchtec1 +Creating Namespaces on 0x4200@/dev/switchtec1 with size 1920383410176 +create-ns: Success, created nsid:1 +Reading Capacity on 0x3b00@/dev/switchtec1 +Creating Namespaces on 0x3b00@/dev/switchtec1 with size 3840755982336 +create-ns: Success, created nsid:1 +Reading Capacity on 0x3f00@/dev/switchtec1 +Creating Namespaces on 0x3f00@/dev/switchtec1 with size 3840755982336 +create-ns: Success, created nsid:1 +[root@RabbitP-CPU tools]# ./nvme.sh list +Namespaces on 0x1600@/dev/switchtec0 +[ 0]:0x1 +Namespaces on 0x1900@/dev/switchtec0 +[ 0]:0x1 +Namespaces on 0x1700@/dev/switchtec0 +[ 0]:0x1 +Namespaces on 0x1400@/dev/switchtec0 +[ 0]:0x1 +Namespaces on 0x1800@/dev/switchtec0 +[ 0]:0x1 +Namespaces on 0x1a00@/dev/switchtec0 +[ 0]:0x1 +Namespaces on 0x1300@/dev/switchtec0 +[ 0]:0x1 +Namespaces on 0x1500@/dev/switchtec0 +[ 0]:0x1 +Namespaces on 0x4100@/dev/switchtec1 +[ 0]:0x1 +Namespaces on 0x3e00@/dev/switchtec1 +[ 0]:0x1 +Namespaces on 0x3d00@/dev/switchtec1 +[ 0]:0x1 +Namespaces on 0x3c00@/dev/switchtec1 +[ 0]:0x1 +Namespaces on 0x4000@/dev/switchtec1 +[ 0]:0x1 +Namespaces on 0x4200@/dev/switchtec1 +[ 0]:0x1 +Namespaces on 0x3b00@/dev/switchtec1 +[ 0]:0x1 +Namespaces on 0x3f00@/dev/switchtec1 +[ 0]:0x1 +[root@RabbitP-CPU tools]# nvme list +Node SN Model Namespace Usage Format FW Rev +--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- +/dev/nvme0n1 S666NE0R800568 SAMSUNG MZ1L21T9HCLS-00A07 1 248.70 GB / 1.92 TB 512 B + 0 B GDC7102Q +[root@RabbitP-CPU tools]# ./nvme.sh attach +Attaching Namespace 1 on 0x1600@/dev/switchtec0 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x1900@/dev/switchtec0 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x1700@/dev/switchtec0 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x1400@/dev/switchtec0 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x1800@/dev/switchtec0 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x1a00@/dev/switchtec0 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x1300@/dev/switchtec0 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x1500@/dev/switchtec0 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x4100@/dev/switchtec1 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x3e00@/dev/switchtec1 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x3d00@/dev/switchtec1 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x3c00@/dev/switchtec1 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x4000@/dev/switchtec1 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x4200@/dev/switchtec1 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x3b00@/dev/switchtec1 to Controller 3 +attach-ns: Success, nsid:1 +Attaching Namespace 1 on 0x3f00@/dev/switchtec1 to Controller 3 +attach-ns: Success, nsid:1 +[root@RabbitP-CPU tools]# nvme list +Node SN Model Namespace Usage Format FW Rev +--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- +/dev/nvme0n1 S666NE0R800568 SAMSUNG MZ1L21T9HCLS-00A07 1 248.70 GB / 1.92 TB 512 B + 0 B GDC7102Q +/dev/nvme1n1 8C40A00W01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme10n1 8C40A00D01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme11n1 8C40A00R01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme12n1 8C40A00801TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme13n1 8C40A00F01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme14n1 8C40A00C01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme15n1 8C40A00E01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme16n1 8C40A00J01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme2n1 8C40A00N01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme3n1 8C40A00K01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme4n1 8C40A00G01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme5n1 8C40A00901TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme6n1 8CN0A01301SZ KIOXIA KCM71RJE1T92 1 0.00 B / 1.92 TB 4 KiB + 0 B 01A1 +/dev/nvme7n1 8C40A00P01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme8n1 8C40A00M01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme9n1 8C40A00U01TZ KIOXIA KCM71RJE3T84 1 0.00 B / 3.84 TB 4 KiB + 0 B 01A1 +[root@RabbitP-CPU tools]# ls /dev/nvme*n1 +/dev/nvme0n1 /dev/nvme10n1 /dev/nvme11n1 /dev/nvme12n1 /dev/nvme13n1 /dev/nvme14n1 /dev/nvme15n1 /dev/nvme16n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 /dev/nvme5n1 /dev/nvme6n1 /dev/nvme7n1 /dev/nvme8n1 /dev/nvme9n1 +[root@RabbitP-CPU tools]# ./lvm.sh create + Found Kioxia drive /dev/nvme10n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme11n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme12n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme13n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme14n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme15n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme16n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme1n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme2n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme3n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme4n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme5n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme6n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme7n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme8n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme9n1 + Found Namespace 1 +16 DRIVES: /dev/nvme10n1 /dev/nvme11n1 /dev/nvme12n1 /dev/nvme13n1 /dev/nvme14n1 /dev/nvme15n1 /dev/nvme16n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 /dev/nvme5n1 /dev/nvme6n1 /dev/nvme7n1 /dev/nvme8n1 /dev/nvme9n1 +Creating Physical Volume '/dev/nvme10n1' + Physical volume "/dev/nvme10n1" successfully created. +Creating Physical Volume '/dev/nvme11n1' + Physical volume "/dev/nvme11n1" successfully created. +Creating Physical Volume '/dev/nvme12n1' + Physical volume "/dev/nvme12n1" successfully created. +Creating Physical Volume '/dev/nvme13n1' + Physical volume "/dev/nvme13n1" successfully created. +Creating Physical Volume '/dev/nvme14n1' + Physical volume "/dev/nvme14n1" successfully created. +Creating Physical Volume '/dev/nvme15n1' + Physical volume "/dev/nvme15n1" successfully created. +Creating Physical Volume '/dev/nvme16n1' + Physical volume "/dev/nvme16n1" successfully created. +Creating Physical Volume '/dev/nvme1n1' + Physical volume "/dev/nvme1n1" successfully created. +Creating Physical Volume '/dev/nvme2n1' + Physical volume "/dev/nvme2n1" successfully created. +Creating Physical Volume '/dev/nvme3n1' + Physical volume "/dev/nvme3n1" successfully created. +Creating Physical Volume '/dev/nvme4n1' + Physical volume "/dev/nvme4n1" successfully created. +Creating Physical Volume '/dev/nvme5n1' + Physical volume "/dev/nvme5n1" successfully created. +Creating Physical Volume '/dev/nvme6n1' + Physical volume "/dev/nvme6n1" successfully created. +Creating Physical Volume '/dev/nvme7n1' + Physical volume "/dev/nvme7n1" successfully created. +Creating Physical Volume '/dev/nvme8n1' + Physical volume "/dev/nvme8n1" successfully created. +Creating Physical Volume '/dev/nvme9n1' + Physical volume "/dev/nvme9n1" successfully created. +Creating Volume Group 'rabbit' + Volume group "rabbit" successfully created +Creating Logical Volume 'rabbit' + Rounding size (14193459 extents) down to stripe boundary size (14193456 extents) + WARNING: Logical volume rabbit/rabbit not zeroed. + Logical volume "rabbit" created. +Activate Volume Group 'rabbit' + 1 logical volume(s) in volume group "rabbit" now active +DONE! Access the volume at /dev/rabbit/rabbit +[root@RabbitP-CPU tools]# lvs + LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert + rabbit rabbit -wi-a----- <27.95t + home toss_dhcp-10-30-105-181 -wi-ao---- 145.71g + root toss_dhcp-10-30-105-181 -wi-ao---- 70.00g + swap toss_dhcp-10-30-105-181 -wi-ao---- <15.59g +[root@RabbitP-CPU tools]# vgs + VG #PV #LV #SN Attr VSize VFree + rabbit 16 1 0 wz--n- 54.14t <26.20t + toss_dhcp-10-30-105-181 1 3 0 wz--n- <231.30g 0 +``` + +## Deleting an LVM volume + +To delete an LVM volume, a semi-reversed set of steps is required: + +- Delete the LVM volume +- Delete the namespaces on each drive (no need to `detach` those namespaces) + +```bash +[root@RabbitP-CPU tools]# ./lvm.sh delete +Removing Logical Volume 'rabbit' + Volume group name "{rabbit}" has invalid characters. + Cannot process volume group {rabbit} +Deactivate Volume Group 'rabbit' + 0 logical volume(s) in volume group "rabbit" now active +Removing Volume Group'rabbit' + Logical volume "rabbit" successfully removed. + Volume group "rabbit" successfully removed + Found Kioxia drive /dev/nvme10n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme11n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme12n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme13n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme14n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme15n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme16n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme1n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme2n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme3n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme4n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme5n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme6n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme7n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme8n1 + Found Namespace 1 + Found Kioxia drive /dev/nvme9n1 + Found Namespace 1 +16 DRIVES: /dev/nvme10n1 /dev/nvme11n1 /dev/nvme12n1 /dev/nvme13n1 /dev/nvme14n1 /dev/nvme15n1 /dev/nvme16n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 /dev/nvme5n1 /dev/nvme6n1 /dev/nvme7n1 /dev/nvme8n1 /dev/nvme9n1 +Remove Physical Volume '/dev/nvme10n1' + Labels on physical volume "/dev/nvme10n1" successfully wiped. +[root@RabbitP-CPU tools]# lvs + LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert + home toss_dhcp-10-30-105-181 -wi-ao---- 145.71g + root toss_dhcp-10-30-105-181 -wi-ao---- 70.00g + swap toss_dhcp-10-30-105-181 -wi-ao---- <15.59g +[root@RabbitP-CPU tools]# vgs + VG #PV #LV #SN Attr VSize VFree + toss_dhcp-10-30-105-181 1 3 0 wz--n- <231.30g 0 +[root@RabbitP-CPU tools]# nvme list +Node SN Model Namespace Usage Format FW Rev +--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- +/dev/nvme0n1 S666NE0R800568 SAMSUNG MZ1L21T9HCLS-00A07 1 248.70 GB / 1.92 TB 512 B + 0 B GDC7102Q +/dev/nvme1n1 8C40A00W01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme10n1 8C40A00D01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme11n1 8C40A00R01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme12n1 8C40A00801TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme13n1 8C40A00F01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme14n1 8C40A00C01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme15n1 8C40A00E01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme16n1 8C40A00J01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme2n1 8C40A00N01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme3n1 8C40A00K01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme4n1 8C40A00G01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme5n1 8C40A00901TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme6n1 8CN0A01301SZ KIOXIA KCM71RJE1T92 1 131.07 kB / 1.92 TB 4 KiB + 0 B 01A1 +/dev/nvme7n1 8C40A00P01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme8n1 8C40A00M01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +/dev/nvme9n1 8C40A00U01TZ KIOXIA KCM71RJE3T84 1 131.07 kB / 3.84 TB 4 KiB + 0 B 01A1 +[root@RabbitP-CPU tools]# ./nvme.sh delete +Deleting Namespaces 1 on 0x1600@/dev/switchtec0 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x1900@/dev/switchtec0 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x1700@/dev/switchtec0 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x1400@/dev/switchtec0 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x1800@/dev/switchtec0 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x1a00@/dev/switchtec0 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x1300@/dev/switchtec0 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x1500@/dev/switchtec0 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x4100@/dev/switchtec1 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x3e00@/dev/switchtec1 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x3d00@/dev/switchtec1 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x3c00@/dev/switchtec1 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x4000@/dev/switchtec1 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x4200@/dev/switchtec1 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x3b00@/dev/switchtec1 +delete-ns: Success, deleted nsid:1 +Deleting Namespaces 1 on 0x3f00@/dev/switchtec1 +delete-ns: Success, deleted nsid:1 +[root@RabbitP-CPU tools]# +``` + +## Example script to walk the cycle + +```bash +create-write-delete-namespaces.sh* +``` From ce0ed49d45f2a6a40260909456c1616a9db8241e Mon Sep 17 00:00:00 2001 From: Anthony Floeder Date: Thu, 6 Oct 2022 16:27:41 -0500 Subject: [PATCH 2/2] Use long names to avoid confusion Signed-off-by: Anthony Floeder --- tools/create-write-delete-namespaces.sh | 2 +- tools/nvme.sh | 8 ++++---- tools/readme.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/create-write-delete-namespaces.sh b/tools/create-write-delete-namespaces.sh index 66a1aa6..69d21f5 100755 --- a/tools/create-write-delete-namespaces.sh +++ b/tools/create-write-delete-namespaces.sh @@ -58,7 +58,7 @@ case "$SIZE" in ./lvm.sh delete # Format the namespace to speed up deletion - ./nvme.sh cmd format -f -n 1 + ./nvme.sh cmd format --force --namspace-id=1 # Wait for the format to finish areWeDone=$(nvme list | grep KIO | awk '{if ($6 > 0) { print "wait" } else { print "done" }}') diff --git a/tools/nvme.sh b/tools/nvme.sh index acdb1f1..35d2df1 100755 --- a/tools/nvme.sh +++ b/tools/nvme.sh @@ -41,11 +41,11 @@ Arguments: Examples: ./nvme.sh -t delete 1 - ./nvme.sh cmd id-ctrl | grep -E "^fr " # firmware level - ./nvme.sh cmd id-ctrl | grep -E "^mn " # model name - ./nvme.sh cmd format -f -n # format specified namespace + ./nvme.sh cmd id-ctrl | grep -E "^fr " # firmware level + ./nvme.sh cmd id-ctrl | grep -E "^mn " # model name + ./nvme.sh cmd format --force --ses=0 --namespace-id= # format specified namespace - ./nvme.sh cmd virt-mgmt --cntlid=3 --act=9 # enable CM7 virtual functions + ./nvme.sh cmd virt-mgmt --cntlid=3 --act=9 # enable CM7 virtual functions EOF } diff --git a/tools/readme.md b/tools/readme.md index 3757262..1e23f89 100644 --- a/tools/readme.md +++ b/tools/readme.md @@ -381,5 +381,5 @@ delete-ns: Success, deleted nsid:1 ## Example script to walk the cycle ```bash -create-write-delete-namespaces.sh* +create-write-delete-namespaces.sh ```