Creare un disco in RAM


/ Published in: Bash
Save to your folder(s)

Creare un disco in RAM


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.