automatic disk performance test

mkdir like test_case1, copy three files below in it:

test_case1/test.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/python3
import os
 
def shell_run(name, cmd):
	os.system('mkdir result')
	os.system(cmd + '> ./result/' + name)
 
def run_cmds(cmds):
	for name, cmd in cmds.items():
		shell_run(name, cmd)
 
cmds = {
	'1_small_read'		: 'fio -name iops -rw=read -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_small_randread'	: 'fio -name iops -rw=randread -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_small_write'		: 'fio -name iops -rw=write -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_small_randwrite'	: 'fio -name iops -rw=randwrite -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_big_read'		: 'fio -name iops -rw=read -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_big_randread'	: 'fio -name iops -rw=randread -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_big_write'		: 'fio -name iops -rw=write -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'1_big_randwrite'	: 'fio -name iops -rw=randwrite -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1',
	'4_small_read'		: 'fio -name iops -rw=read -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_small_randread'	: 'fio -name iops -rw=randread -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_small_write'		: 'fio -name iops -rw=write -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_small_randwrite'	: 'fio -name iops -rw=randwrite -bs=4k -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_big_read'		: 'fio -name iops -rw=read -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_big_randread'	: 'fio -name iops -rw=randread -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_big_write'		: 'fio -name iops -rw=write -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4',
	'4_big_randwrite'	: 'fio -name iops -rw=randwrite -bs=10M -runtime=60 -iodepth 32 -filename /dev/sda6 -ioengine libaio -direct=1 -numjobs=4'
}
run_cmds(cmds)

test_case1/parse.cpp

Read more

Failed to format -2147024809

直接用adk里的MakeWinPEMedia写winpe到U盘里报标题这个错误,所以我们换一种思路,用MakeWinPEMedia生成iso,再在linux环境将iso擦写到U盘里。

先以管理员方式运行“部署和映像工具环境”
输入

1
MakeWinPEMedia /ISO d:\euhat\WinPE_amd64 d:\winpe.iso

成功后,将winpe.iso拷贝到ubuntu linux虚拟机或实机里面。
我们现在以vmware的ubuntu虚拟机为例,为了使虚拟机正常识别U盘,需要做两件事

  1. 以管理员方式运行vmware player或workstation。
  2. ubuntu虚拟机设置里USB控制器兼容性中选择正确的版本,新买的机器一般选USB 3.0以上。这一步骤若选错,在vmware工具条上将U盘连接到虚拟机里时会提示“无法连接到理想的主机控制器。将尝试将该设备连接到可用的最佳主机控制器”不成功的错误,那时再重复此步骤选择其它USB控制器版本试试。

启动ubuntu虚拟机,打开终端以root身份运行

1
fdisk -l

通过看容量找到U盘的设备路径,如我这里是/dev/sdb,则再运行

1
2
dd if=/home/euhat/Desktop/winpe.iso of=/dev/sdb
sync

这样winpe就写入U盘了,正常从虚拟机、Windows卸载U盘后,再插到机器上用U盘引导试试!