Skip to content

Test Tutorial for AppNVM FTL

Ivan Picoli edited this page Feb 10, 2018 · 2 revisions
  • In the host, open a terminal and run 'tail -f /var/log/syslog' for a real-time log.

  • Run QEMU with:

sudo <qemu_ox>/x86_64-softmmu/qemu-system-x86_64 -monitor stdio -m 6G -smp 4 -s -drive file=<your_disk_image>,id=diskdrive,format=raw,if=none -device ide-hd,drive=diskdrive -device ox-ctrl,lnvm=0,debug=0,volt=0,serial=deadbeef -serial pty --enable-kvm

Note: If you do not have a graphic interface (for instance, if you are connected using SSH), use the options '-nographic' and '-device sga' to get the QEMU output in the console. You can also use '-curses' option instead.

It will create a 4GB file to persist your OX SSD under the folder you run it (besides your disk image).

  • In the syslog, check if you got:
[nvme: CC: 0]
[nvme: AQA: ff00ff]
[nvme: ASQ: 7f768000]
[nvme: ACQ: 7f743000]
[nvme: CC: 460001]
[nvme: Nvme EN!]
[nvme: nvme starting ctrl]
[nvme: init CQ qid: 0 irq_vector: 0
[nvme: init SQ qid: 0
[nvme: init CQ qid: 1 irq_vector: 0
[nvme: init SQ qid: 1

If not, restart QEMU, something went wrong.

  • In the VM, check if you see '/dev/nvme0' and '/dev/nvme0n1'

If not, something went wrong, check the kernel log with 'dmesg'

All good. You can use a file system.

  • sudo fdisk /dev/nvme0n1
  • Press g + Enter (create a partition table)
  • Press n + many Enters (create a new partition in the entire device)
  • Press w + Enter (Save the partition table)

If everything is fine, you should see '/dev/nvme0n1p1'

  • sudo mkfs.ext4 /dev/nvme0n1p1
  • sudo mount /dev/nvme0n1p1 <mounting_folder>
  • sudo chown -R <your_user> <mounting_folder_above>

If everything is fine, transfer files and use the file system. After, flush the disk for a recovery test:

  • sudo nvme reset /dev/nvme0

You should see in the QEMU terminal: [volt: Flushing disk...] Wait until OX restarts, it might block your screen for some seconds. Then, close QEMU and start it again. You should see: [volt: Loading disk...]

  • Check if your file system is recovered. Also, check the files you have created by opening and reading it.

Now, some FIO tests:

sudo fio --filename=/<some_file> --direct=1 --rw=write --refill_buffers --norandommap --randrepeat=0 --ioengine=libaio --bs=256k --rwmixwrite=100 --iodepth=64 --numjobs=4 --runtime=5 --group_reporting --name=fio_write

sudo fio --filename=/<some_file> --direct=1 --rw=read --refill_buffers --norandommap --randrepeat=0 --ioengine=libaio --bs=512k --rwmixread=50 --iodepth=64 --numjobs=8 --runtime=10 --group_reporting --name=fio_read

Clone this wiki locally