Today i've tried to make ramdisk automatically created while booting.
I've taken script from one of sites, which google gives me:
script works excellent, if i launch it from root. then i've added .plist in launchd, in order to start script at boot. after rebooting i've discovered that ramdisk didn't created.
few minutes passed, and i've discovered that script are started, ramdisk are created and mounted, but after 10 seconds after ramdisk mounting, it was unmounted by unknown yosemite system program. i see this in system.log, but cannot determine who is unmounting my ramdisk. i've tried to disable automountd, but nothing was changed.
please help
I've taken script from one of sites, which google gives me:
Code:
#!/bin/bash
ramfs_size_mb=2048
mount_point=/private/tmp
ramfs_size_sectors=$((${ramfs_size_mb}*1024*1024/512))
#ramdisk_dev=`/usr/bin/hdid -nomount ram://${ramfs_size_sectors}`
ramdisk_dev=`hdik -drivekey system-image=yes -nomount ram://${ramfs_size_sectors}`
/sbin/newfs_hfs -v 'ramdisk' ${ramdisk_dev}
/bin/mkdir -p ${mount_point}
/sbin/mount -o union,nobrowse,noatime -t hfs ${ramdisk_dev} ${mount_point}
/usr/sbin/chown root:wheel ${mount_point}
/bin/chmod 1777 ${mount_point}
script works excellent, if i launch it from root. then i've added .plist in launchd, in order to start script at boot. after rebooting i've discovered that ramdisk didn't created.
few minutes passed, and i've discovered that script are started, ramdisk are created and mounted, but after 10 seconds after ramdisk mounting, it was unmounted by unknown yosemite system program. i see this in system.log, but cannot determine who is unmounting my ramdisk. i've tried to disable automountd, but nothing was changed.
please help