如何修改 Ubuntu SCSI 驱动程序以支持非 512 扇区大小的硬盘或 SSD(如扇区大小 = 520 字节)?

如何修改 Ubuntu SCSI 驱动程序以支持非 512 扇区大小的硬盘或 SSD(如扇区大小 = 520 字节)?

我有一个驱动器,其扇区大小 = 512 字节(/dev/sdb如下),还有一个驱动器(/dev/sdc如下),其扇区大小 = 520 字节,如下所示。

# lsscsi -g    
[0:0:2:0]    disk    ATA      SDLF1DAR-480G-1H RP41  /dev/sdb   /dev/sg1    
[0:0:3:0]    disk    ATA      SDLFOEAM-100G-1H RF12  /dev/sdc   /dev/sg2

我尝试在 Ubuntu 中运行 VDBench,扇区大小 = 512 字节的驱动器可以正常运行,如下所示:

/usr/local/vdbench503rc11# ./vdbench -f    
Rnd_RD_4k_sdb.parm -o output/    
Vdbench distribution: vdbench503rc11    
For documentation, see 'vdbench.pdf'.    
15:46:32.891 *    
15:46:32.891 * This beta version 'vdbench503rc11' was built on Fri April 08  9:48:23 MDT 2011.    
15:46:32.891 * which is more than 90 days ago.    
15:46:32.891 * It is recommended that you look for a newer beta or possibly    
15:46:32.891 * a newer GA version.    
15:46:32.892 * Of course, it is preferred you download a newer beta version    
15:46:32.892 * if available to help test the latest code.    
15:46:32.892 *    
15:46:32.893 input argument scanned: '-fRnd_RD_4k_sdb.parm'    
15:46:32.894 input argument scanned: '-ooutput/'    
15:46:32.963 Starting slave: /usr/local/vdbench503rc11/vdbench SlaveJvm -m localhost -n localhost-10-150513-15.46.32.857 -l localhost-0 -p 5570    
15:46:33.303 All slaves are now connected    
15:46:36.002 Starting RD=run1; I/O rate: Uncontrolled MAX; elapsed=10; For loops: None        
May 13, 2015  interval        i/o   MB/sec   bytes   read     resp     read    write     resp     resp queue  cpu%  cpu%    
                             rate  1024**2     i/o    pct     time     resp     resp      max   stddev depth sys+u   sys
15:46:37.045         1   16983.00    66.34    4096 100.00    0.432    0.432    0.000    5.826    0.061   7.3  11.8   3.1    
15:46:38.057         2   17911.00    69.96    4096 100.00    0.438    0.438    0.000    1.424    0.013   7.9   5.0   3.4    
15:46:39.053         3   18220.00    71.17    4096 100.00    0.438    0.438    0.000    0.897    0.007   8.0   4.9   2.8    
15:46:40.058         4   18218.00    71.16    4096 100.00    0.438    0.438    0.000    1.106    0.013   8.0   4.7   3.9    
15:46:41.060         5   18201.00    71.10    4096 100.00    0.438    0.438    0.000    0.989    0.010   8.0   6.4   3.6    
15:46:42.057         6   18222.00    71.18    4096 100.00    0.438    0.438    0.000    0.952    0.008   8.0   5.4   3.6    
15:46:43.056         7   18172.00    70.98    4096 100.00    0.440    0.440    0.000    1.071    0.025   8.0   4.9   3.1    
15:46:44.061         8   18202.00    71.10    4096 100.00    0.438    0.438    0.000    1.069    0.011   8.0   5.4   3.6    
15:46:45.059         9   18227.00    71.20    4096 100.00    0.438    0.438    0.000    1.072    0.011   8.0   4.8   3.6    
15:46:46.056        10   18225.00    71.19    4096 100.00    0.438    0.438    0.000    1.071    0.013   8.0   5.6   3.8    
15:46:46.070  avg_2-10   18177.56    71.01    4096 100.00    0.439    0.439    0.000    1.424    0.013   8.0   5.2   3.5    
15:46:46.544 Vdbench execution completed successfully. Output directory: /usr/local/vdbench503rc11/output

但是扇区大小 = 520 字节的驱动器无法启动此运行,如下所示,并突出显示错误消息Undefined size for sd=sd1,lun=/dev/sdc

/usr/local/vdbench503rc11# ./vdbench -f Rnd_RD_4k_sdc.parm -o output/     
Vdbench distribution: vdbench503rc11    
For documentation, see 'vdbench.pdf'.        
15:47:42.014 *

15:47:42.014 * This beta version 'vdbench503rc11' was built on Fri April 08  9:48:23 MDT 2011.    
15:47:42.014 * which is more than 90 days ago.    
15:47:42.014 * It is recommended that you look for a newer beta or possibly
15:47:42.014 * a newer GA version.
15:47:42.014 * Of course, it is preferred you download a newer beta version
15:47:42.014 * if available to help test the latest code.
15:47:42.014 *
15:47:42.016 input argument scanned: '-fRnd_RD_4k_sdc.parm'
15:47:42.016 input argument scanned: '-ooutput/'
15:47:42.075 Starting slave: /usr/local/vdbench503rc11/vdbench SlaveJvm -m localhost -n localhost-10-150513-15.47.41.982 -l localhost-0 -p 5570
15:47:42.393 All slaves are now connected
15:47:43.503
**15:47:43.503 Undefined size for sd=sd1,lun=/dev/sdc**
**15:47:43.503 Either the lun or file does not exist, or you do not have permission to open the lun or file.**
15:47:43.503
15:47:43.504 No lun or file size available.
15:47:43.504
java.lang.RuntimeException: No lun or file size available.
        at Vdb.common.failure(common.java:307)
        at Vdb.InfoFromHost.storeAndCompare(InfoFromHost.java:743)
        at Vdb.InfoFromHost.receiveInfoFromHost(InfoFromHost.java:479)
        at Vdb.SlaveOnMaster.processSlave(SlaveOnMaster.java:173)
        at Vdb.SlaveOnMaster.run(SlaveOnMaster.java:60)

也许您可以给我一些建议,以便我可以让 Ubuntu SCSI 驱动程序支持非 512 字节扇区大小,例如扇区大小 = 520 字节、524 字节、528 字节等等。

相关内容