无法以 root 身份运行 fio 基准测试

无法以 root 身份运行 fio 基准测试

我无法以 root 用户身份运行 fio 基准测试。

正常模式:

命令 1:

which fio

输出 1:

/usr/local/bin/fio

命令2:

fio

输出 2:

No jobs(s) defined

fio-2.12
fio [options] [job options] <job file(s)>
  --debug=options   Enable debug logging. May be one/more of:
            process,file,io,mem,blktrace,verify,random,parse,
            diskutil,job,mutex,profile,time,net,rate,compress
  --parse-only      Parse options only, don't start any IO
  --output      Write output to file
  --runtime     Runtime in seconds
  --bandwidth-log   Generate per-job bandwidth logs
  --minimal     Minimal (terse) output
  --output-format=x Output format (terse,json,json+,normal)
  --terse-version=x Set terse version output format to 'x'
  --version     Print version info and exit
  --help        Print this page
  --cpuclock-test   Perform test/validation of CPU clock
  --crctest     Test speed of checksum functions
  --cmdhelp=cmd     Print command help, "all" for all of them
  --enghelp=engine  Print ioengine help, or list available ioengines
  --enghelp=engine,cmd  Print help for an ioengine cmd
  --showcmd     Turn a job file into command line options
  --eta=when        When ETA estimate should be printed
                    May be "always", "never" or "auto"
  --eta-newline=time    Force a new line for every 'time' period passed
  --status-interval=t   Force full status dump every 't' period passed
  --readonly        Turn on safety read-only checks, preventing writes
  --section=name    Only run specified section in job file
  --alloc-size=kb   Set smalloc pool to this size in kb (def 1024)
  --warnings-fatal  Fio parser warnings are fatal
  --max-jobs=nr     Maximum number of threads/processes to support
  --server=args     Start a backend fio server
  --daemonize=pidfile   Background fio server, write pid to file
  --client=hostname Talk to remote backend fio server at hostname
  --remote-config=file  Tell fio server to load this local job file
  --idle-prof=option    Report cpu idleness on a system or percpu basis
            (option=system,percpu) or run unit work
            calibration only (option=calibrate)
  --inflate-log=log Inflate and output compressed log
  --trigger-file=file   Execute trigger cmd when file exists
  --trigger-timeout=t   Execute trigger af this time
  --trigger=cmd     Set this command as local trigger
  --trigger-remote=cmd  Set this command as remote trigger
  --aux-path=path   Use this path for fio state generated files

Fio was written by Jens Axboe <[email protected]>
                   Jens Axboe <[email protected]>
                   Jens Axboe <[email protected]>

作为 root 用户:

命令 1:

which fio

输出 1:

no fio in ($path)

命令2:

fio

输出 2:

bash: fio: command not found

我找到了一些与此相关的帖子。我还尝试将 fio 的路径(which fio非 root 用户给出的路径)添加到 ~/.bashrc 并尝试获取文件,但没有成功。我还应该做哪些更改才能使其正常工作。请有人帮助我。提前致谢。

答案1

您的 PATH 变量的内容是什么?(请参阅 的输出export | grep PATH。我猜想它/usr/local/bin/不在 root 的 PATH 中。您可以将其添加到 root 的路径中。从其中一个系统文件夹创建符号链接,或者只需使用完全限定路径运行该命令。

相关内容