Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Could that script be edited to just make a ramdisk followed by a .cache directory in it by editing out the copying parts and replacing them with the entry I now have in fstab followed by mkdir .cache?
My apologies if using another's script is frowned on.
The recommended place to put any user-written init.d code is at the end of
Code:
/etc/rc.local
If you reboot a PC, all data would be lost from a RAM cache and might need rebuilding.
If you have a hard disk, it would probably be more efficient to use this as the target, rather than a RAM disk.
Linux retains cacheable items for a considerable time, if it has spare memory.
I have had to rethink the solution because I have established that some user temporary data has to be carried over a reboot.
In that case it would be quite complex as you suggest to move the whole user .cache to ram.
I do have a hard disk so as you suggest, I could leave the browser data in ram for speed and reduced SSD writing, then move the remainder of .cache to HDD. There would be some loss of speed but set against the reduced SSD writing, worthwhile.
Would a symlink work? I think it would in the case of .cache to HDD.
My first attempt at a symlink to move the cache to ram locked up the boot after signing in and that makes me wary although I do have another temporary instance of xubuntu running on the HDD and could edit the symlink out.
With firefox, you can control the cache size (via preferences) - I think the default is to use a lot of storage!
(see attachment)
Perhaps a small or even zero size cache might be acceptable, provided it helps your SSD???
I would do all experimenting with symbolic links in a live environment, before changing any boot scripts.
Can't see why it wouldn't work though.
Moving the cache of firefox is easily done and I have done it. Chrome is another matter and as you suggest for firefox, I have reduced Chrome's cache to 1byte. Apparently zero cache does not work.
I don't want firefox to write anything to the SSD, not even 1 byte but do need the cache!
I will try a symlink to HHD live as you suggest. Thanks.
I don't know what applications or how you use your computer but your concerns about writing to ~/.cache might be misplaced. What does SMART indicate for its lifetime?
There are two specifications i.e. TBW (terabytes written) and DWPD (drive writes per day) for SSD endurance. TBW is the max number of terabytes written before a the drive is likely to fail and DWPD is the number of times you can overwrite the entire disk every day during the warranty period. Most users will find that modern SSDs have a lifetime equal to that of a mechanical hard drive.
It is important that you use a kernel/filesystem that supports trim with the correct options and partitioned i.e aligned correctly.
TRIM is supported and runs weekly I think and nowadays the partitions are automatically aligned, or so I read.
I think my OCZ drive has SMART software and will check. It is a brand new drive and I want it to last, that is all, I don't use drive intensive programs.
I do have a swap partition and will look at swappiness.
You're overreacting to a problem that does not exist. The write limit of modern SSDs is so ridiculously high it's unreasonable to think that anybody will be able to hit it within the rest of the computer's lifetime under normal usage. The only way to hit it is with dedicated stress tests that run continuously, and it STILL takes years before any problems show up.
Turn down swappiness, turn off atime, and you're done.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.