我的同事将两个驱动器configuration为带有板载Promise FastTrak 133的主板上的条带。主板发生故障,我们无法find任何可以识别arrays的板载Promise控制器。
使用Linux或某些磁盘编辑器,我可以在两个驱动器上看到数据……而且我想看看是否可以将两个驱动器上的数据组合到一个更大的驱动器上。 但是我需要知道这些信息是如何交错的。
我在Linux上试过dmraid,但是不能把驱动器识别为一个数组。 我想我可以尝试结合从驱动器交替块,开始块大小为256B,并保持倍增,直到我看到一个看起来完好无损的结果。 但是,如果有人已经知道Promise控制器如何将数据分散到条带arrays上,我想避免这种情况。
好吧,我明白了。 各种Promise手册指出,条带大小默认为64k,可以设置为32k或128k。 所以,我写了一个小的Java应用程序来结合来自两个不同的来源,它的工作就像一个魅力! 原来他们是64k条纹。
这里的代码,以防万一有其他人有这个问题。 这不是花哨的(它只是运行,直到用完input或输出空间),但它会让你摆脱困境。
public class PromiseFastTrakCombiner { public static void main(String[] args) { if(args.length != 4) { System.out.println("Usage: java PromiseFastTrakCombiner <source1> <source2> <dest> <blocksize_in_kB>"); System.exit(1); } String source1 = args[0]; String source2 = args[1]; String dest = args[2]; int blocks = Integer.parseInt(args[3]); System.out.println("Going to copy: " + source1 + " and " + source2 + " to " + dest + " with " + blocks + "kB blocks"); System.out.println("If this is not what you want, hit Ctrl-C now. Otherwise, hit Enter"); try { System.in.read(); } catch (IOException e) { e.printStackTrace(); } try { FileInputStream in1 = new FileInputStream(source1); FileInputStream in2 = new FileInputStream(source2); FileOutputStream out = new FileOutputStream(dest); int bufsize = 1024 * blocks; byte[] buffer = new byte[bufsize]; long bytesread; long totalbytes = 0; long lastreport = 0; while(true) { bytesread = in1.read(buffer); totalbytes += bytesread; out.write(buffer); bytesread = in2.read(buffer); totalbytes += bytesread; out.write(buffer); // Progress update after every 10MB... if(totalbytes - lastreport > 10000000) { System.out.println("Bytes processed: " + totalbytes); lastreport = totalbytes; } } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }