Chome is my daily used software, and yes, chrome keep lots of caches. To help speed up chrome, I decide to move chrome's cache to memory for testing.
Here are the steps:
rm -r ~/.cache/google-chrome mkdir /dev/shm ln -s /dev/shm/chrome ~/.cache/google-chrome
Yeah, it's simple and it works. So lets go further to bind /tmp to /dev/shm too.
First, open vi or gedit as root.
Then create /etc/init.d/ramdisk.sh
#!/bin/sh # RamDisk tmp PATH=/sbin:/bin:/usr/bin:/usr/sbin mkdir /dev/shm/tmp chmod 1777 /dev/shm/tmp mount --bind /dev/shm/tmp /tmp
And make it executable.
sudo chmod 755 /etc/init.d/ramdisk.sh
Now, we can just run the script to mount /tmp on /dev/shm/tmp. However it will be restored to default after reboot. So we need to run it on boot.
cd /etc/rcS.d sudo ln -s ../init.d/ramdisk.sh S50ramdisk.sh
Now, it's done. You can also move /var/tmp to /dev/shm to keep temporary files in memory instead of disk but it might have side-effects.
Have fun!
reference:
[教學] /tmp 設到 RadmDisk (tmpfs) 的方法
Change Chrome cache directory in Ubuntu
沒有留言:
張貼留言