LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-19-2016, 08:36 PM   #1
Ernst0
Member
 
Registered: Mar 2012
Location: California
Distribution: Fedora Workstation
Posts: 30

Rep: Reputation: Disabled
Question 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.
 
Old 06-19-2016, 09:58 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,662

Rep: Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710
What exactly do you mean by 'cache' in this context? Might that be what I would call "swap space" or "swap partition"?
 
1 members found this post helpful.
Old 06-19-2016, 10:17 PM   #3
Ernst0
Member
 
Registered: Mar 2012
Location: California
Distribution: Fedora Workstation
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
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 ???
 
Old 06-20-2016, 06:14 AM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,662

Rep: Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710
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.
 
1 members found this post helpful.
Old 06-20-2016, 07:35 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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 ?.
 
1 members found this post helpful.
Old 06-20-2016, 09:51 PM   #6
Ernst0
Member
 
Registered: Mar 2012
Location: California
Distribution: Fedora Workstation
Posts: 30

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-20-2016, 10:06 PM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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.
 
1 members found this post helpful.
Old 06-24-2016, 01:52 PM   #8
Ernst0
Member
 
Registered: Mar 2012
Location: California
Distribution: Fedora Workstation
Posts: 30

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply

Tags
cache, fedora 23, installation, mount point, ssd cache



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two interfaces on DHCP assign two default gateways albertoparis Linux - Networking 2 06-19-2012 01:34 PM
assign default gateway at random fideltfg Linux - Networking 2 02-22-2011 04:06 PM
Can a hard drive with only 428KB of cache cause problems with linux install? bdb4269 Linux - Hardware 7 08-30-2006 06:44 PM
CentOS - cannot assign default app to mp3 rje_NC Linux - Software 1 12-02-2005 10:20 PM
kppp doesn't assign default route to ppp0 damion Linux - Networking 2 03-01-2003 04:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration