LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I assign cache to another drive after default Fedora 23 install? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-assign-cache-to-another-drive-after-default-fedora-23-install-4175582634/)

Ernst0 06-19-2016 08:36 PM

How do I assign cache to another drive after default Fedora 23 install?
 
Hey

I wish to have my /cache on an SSD drive while the rest of the install is fine on a regular HD.

I'm looking for instructions on how this is done. Links or direct help welcome.

I assume there will be some editing of scripts for start-up

I often allocate large amounts of memory in my C programs for data so I want to place the cache on a dedicated SSD for faster I/O

I appreciate your help.

wpeckham 06-19-2016 09:58 PM

What exactly do you mean by 'cache' in this context? Might that be what I would call "swap space" or "swap partition"?

Ernst0 06-19-2016 10:17 PM

Quote:

Originally Posted by wpeckham (Post 5563442)
What exactly do you mean by 'cache' in this context? Might that be what I would call "swap space" or "swap partition"?

Yes, I apologize I meant swap.

Once I realized my error I was able to see some results.

I am reading about parted https://access.redhat.com/documentat...k-storage.html
Another source talks about swapon, swapoff, editing /ect/fstab and using mkswap

There seems to be more than one way to get this done.

What I want to do is use a dedicated SSD for Swap
. From parted that drive is sdc here. From parted I see no disk flag number start and so on no data.
GParted shows unallocated partition unallocated filesystem for that SSD

I am guessing that one would comment out the fstab,delete the current swap partition and ???

wpeckham 06-20-2016 06:14 AM

High level: swap can be a file or a partition. Different techniques are used, but the concept is the same. Prep the space to be used as swap, activate the new swap, set the new swap to be available on startup and remove startup support for the old swap, release the old swap (on old kernels this required a reboot).

If this were a rotational drive, I would advise partitioning into a swap volume and a linux volume. That would give you very fast swap without dedicating the entire device to swap. Since it is SSD, you should be able to allocate the entire thing to storage and use the file swap technique without significant penalty.

Be aware, that most linux servers with sufficient ram do not normally use the swap, when they do they use it very intelligently. Swap is only there for continual use in the case ram is not sufficient for normal operation. When ram is sufficient, you allocate swap so that your system does not crash when it is under unusual stress. In your case it is important to have swap available, but I would not expect allocating swap to an SSD device to make a noticable performance difference.

There are online documents, how-to pages, and many resources online describing the steps you might follow, just be careful and do not mix them. Let me know if you get into trouble.

syg00 06-20-2016 07:35 PM

Seems like a criminal waste of a SSD, but it's your choice.
Create a partition(s) on the device, run mkswap on each. Then run swapon for each to ensure they are recognised ok ("swapon -s" will show them). Then add them to fstab - comment out the old one. Done - simple.

You might be better off determining your swap rate - in particular the swapin rate, because that's really all you care about. Will the SSD really make that much difference in the grand scheme of things ?.

Ernst0 06-20-2016 09:51 PM

Thanks. I will be working on this this coming weekend.

SSDs are not so expensive these days.
I'll try this and see if it makes working with very large data sets in C easier for me.
If nothing else it's an interesting learning experience for me.

Again my appreciation. Linux seems daunting at times.

I'll report back.

jpollard 06-20-2016 10:06 PM

One thing you MIGHT do is not use tmpfs for /tmp. By default that can use up to 1/2 your memory. Making a real partition for it will free up that memory. Sometimes using an ssd for /tmp instead would work better.

You do get to clean it out though - the purpose of mount /tmp with tmpfs is that it is automatically cleaned out for you on every boot.

Ernst0 06-24-2016 01:52 PM

With a bit of awkward, I see the new swap space.

Thanks

I'll know more on how this may help or not help me a bit later on.


All times are GMT -5. The time now is 12:14 AM.