Posted By

kajinka13 on 02/07/12


Tagged

Bash Ramdisk


Versions (?)

Creare un disco in RAM


 / Published in: Bash
 

Creare un disco in RAM

  1. #!/bin/sh
  2.  
  3. # Crea un disco RAM
  4. function ramdisk() {
  5. sectors=$(($1*2048))
  6. dev=$(hdid -nomount ram://$sectors)
  7. mount=/tmp/ram${dev##*/}
  8. newfs_hfs $dev
  9. mkdir $mount
  10. mount -t hfs $dev $mount
  11. }
  12.  
  13. ramdisk $1

Report this snippet  

You need to login to post a comment.