disksim 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. .TH DISKSIM 8
  2. .SH NAME
  3. disksim \- disk simulator
  4. .SH SYNOPSIS
  5. .B aux/disksim
  6. [
  7. .B -r
  8. ]
  9. [
  10. .B -f
  11. .I file
  12. ]
  13. [
  14. .B -s
  15. .I srvname
  16. ]
  17. [
  18. .B -m
  19. .I mtpt
  20. ]
  21. [
  22. .I diskname
  23. ]
  24. .SH DESCRIPTION
  25. .I Disksim
  26. presents an in-memory disk in the manner of the
  27. .IR sd (3)
  28. device on
  29. .IB mtpt / diskname
  30. (default
  31. .B /dev/sdXX ).
  32. The disk is initialized to zeros;
  33. non-zeroed blocks written to the disk are kept in memory.
  34. .PP
  35. The
  36. .B -f
  37. option causes
  38. .I disksim
  39. to use
  40. .I file
  41. as the initial contents of the disk rather than a zeroed image.
  42. Changes made to the disk are written back to
  43. .I file
  44. unless the
  45. .B -r
  46. option is given.
  47. .PP
  48. The
  49. .B -s
  50. option causes
  51. .I disksim
  52. to post its 9P service at
  53. .BI /srv/ service \fR.
  54. .SH EXAMPLES
  55. .I Disksim
  56. can be used to test programs such as
  57. .I fdisk
  58. and
  59. .IR prep (8)
  60. that expect
  61. .IR sd (3)
  62. disks:
  63. .IP
  64. .EX
  65. aux/disksim
  66. echo geometry 40000 512 0 0 0 >/dev/sdXX/ctl # 20MB
  67. disk/mbr /dev/sdXX/data
  68. disk/fdisk -baw /dev/sdXX/data
  69. disk/prep /dev/sdXX/plan9
  70. .EE
  71. .PP
  72. .I Disksim
  73. is useful for creating very large but mostly zeroed files
  74. for testing other programs.
  75. Test
  76. .IR tar (1)'s
  77. handling of large files:
  78. .IP
  79. .EX
  80. for(i in sdXX sdYY sdZZ) aux/disksim $i
  81. echo geometry 40000000 512 0 0 0 >/dev/sdXX/ctl # 20GB
  82. echo geometry 10000000 512 0 0 0 >/dev/sdYY/ctl # 5GB
  83. echo geometry 20000000 512 0 0 0 >/dev/sdZZ/ctl # 10GB
  84. tar cf /dev/sdXX/data /dev/sdYY/data /dev/sdZZ/data
  85. tar tvf /dev/sdXX/data
  86. .EE
  87. .SH SOURCE
  88. .B /sys/src/cmd/aux/disksim.c
  89. .SH SEE ALSO
  90. .IR sd (3),
  91. .IR prep (8)