SSD support in Linux

shastrycs

New Member
Joined
May 30, 2019
Messages
5
Reaction score
3
Credits
49
Hello,
I am new to Linux, this is my first post and i am kind of not sure if this is where it belongs.

Looking to get a custom built desktop for my Linux box (i think this is what it is called) and was wondering if Linux supports SSDs. This question arises keeping in view of the current state of things in the hardware arena.

Thanks for the help to all in advance.
 


[snip]
you may want to avoid setting a Swap Partition,
Hello blackneos940,

I agree if a computer has enough ram swap is not necessary.

Having a swap partition doesn't hurt and these days it is actually only a folder / file instead of an actual physical partition that is created by default unless a user manually partitions the hard drive.
 
Hello blackneos940,

I agree if a computer has enough ram swap is not necessary.

Having a swap partition doesn't hurt and these days it is actually only a folder / file instead of an actual physical partition that is created by default unless a user manually partitions the hard drive.
Well, that's new to me!..... :3 Well, I should have known, since the UNIX philosophy is "everything is a File"!..... :3 I was just saying to avoid creating a Swap Partition since SSDs aren't good with constant writes from Swap, unless..... Swap under Linux has changed.....? :) Feel free to correct me, especially because I don't want to help this guy mess up his first Linux install..... :)
 
I was just saying to avoid creating a Swap Partition since SSDs aren't good with constant writes from Swap, unless..... Swap under Linux has changed.....?
Swap still works the same.

To avoid the constant writes from swap to the hard drive change the swappiness level from the default level of 60 to a more reasonable level of 1 and problem solved.

How to change swappiness.

Copy the command
cat /proc/sys/vm/swappiness

After that run the command
sudo sysctl vm.swappiness=10

to make the setting permanent
sudo sed -i '$ a\vm.swappiness = 10' /etc/sysctl.conf

just change the number 10 to 1 .
 
Last edited by a moderator:
Swap still works the same.

To avoid the constant writes from swap to the hard drive change the swappiness level from the default level of 60 to a more reasonable level of 1 and problem solved.

How to change swappiness.

Copy the command
cat /proc/sys/vm/swappiness

After that run the command
sudo sysctl vm.swappiness=10

to make the setting permanent
sudo sed -i '$ a\vm.swappiness = 10' /etc/sysctl.conf

just change the number 10 to 1 .
Well then!..... :) Think I'll add some Swap to my 32GB eMMC then!..... :) Thanks for the info good sir, and I'm sure it will help OP out too!..... :3
 
I have 8GB Ram and have an 8GB Swap drive. I use Neon (KDE) and have a widget on my desktop that monitors memory, Swap is in there. My swap drive is almost always at 0 B, without modifying any settings, other than disabling hibernation. I have seen it having a couple megabytes. The point is that unless you're doing something special or have only a small amount of RAM, you probably aren't really getting that much activity on your swap partition. Blackneos940, with 32GB RAM, your swap partition probably has dust on it. :)
 
I have 8GB Ram and have an 8GB Swap drive. I use Neon (KDE) and have a widget on my desktop that monitors memory, Swap is in there. My swap drive is almost always at 0 B, without modifying any settings, other than disabling hibernation. I have seen it having a couple megabytes. The point is that unless you're doing something special or have only a small amount of RAM, you probably aren't really getting that much activity on your swap partition. Blackneos940, with 32GB RAM, your swap partition probably has dust on it. :)

[Quote Blackneos940 post # 8]
Well then!..... :) Think I'll add some Swap to my 32GB eMMC then!..... :)

----------------------------------------------------------
----------------------------------------------------------

I don't think Blackneos940 has 32 GB of ram.

I believe the 32GB emmc Blackneos940 is referring to is embedded storage used in place of a mechanical hard drive or ssd drive.

I may be wrong as I'm uncertain of what type of computer Blackneos940 is using.

https://www.enterprisestorageforum.com/storage-hardware/emmc-flash-memory-storage.html

https://laptoping.com/laptop-pc-storage-explained-hdd-ssd-hybrid-emmc.html

https://www.howtogeek.com/196541/emmc-vs.-ssd-not-all-solid-state-storage-is-equal/
 
Last edited by a moderator:
Hello @shastrycs, and welcome! Hopefully we can assist you with using a SSD in Linux.

Both @arochester and @poorguy gave very useful links to help consider using a SSD. But I had to giggle a little bit because of the conflicting advice that each article gives. One says to use swap space, the other says disable it. One says to use discard in /etc/fstab, but the other says no. Kinda funny, right? :D

But part of the lesson here is that each of us is different, and we have different computers. Some things work for some of us, and for others they do not. Sometimes you have to do a little experimenting (or more reading) to help decide what may be the best choice for you. And with that, I'll offer another contradiction below:

Having a swap partition doesn't hurt and these days it is actually only a folder / file instead of an actual physical partition that is created by default unless a user manually partitions the hard drive.

The idea that a swap file is now "normal" is not my experience, and I've installed quite a few different distros. But @poorguy's experience may well be different than mine. I find most distros to automatically create a swap partition. Further, when using manual partitioning during a Linux installation, I find that the installer will complain if you do not set a swap partition, although it will allow you to proceed without it. I do not think that the installer will allow setting a swap file, instead of a partition, but I may be wrong. Using Google to find out how to set up a swap file shows some command line work is necessary, and I just don't think that is the norm yet.

Still, the articles referenced make good points. If you have a lot of RAM, you likely don't need swap space, unless you strongly want to use hibernation power saving techniques. But hibernation (and excessive swapping for other reasons, like heavy video editing perhaps) can cause a lot of wear and tear on your SSD, and you should consider that. Trim and swappiness are other settings to consider. But how you use your SSD will almost certainly not be how we use a SSD, so you have to choose what's best for you. Google for more info also... Google knows everything. :eek::D Good luck!

Cheers
 
One says to use swap space, the other says disable it. One says to use discard in /etc/fstab, but the other says no. Kinda funny, right? :D
It does seem like a 5.5 one way 6 another. :confused:o_O

But part of the lesson here is that each of us is different, and we have different computers. Some things work for some of us, and for others they do not. Sometimes you have to do a little experimenting (or more reading) to help decide what may be the best choice for you.
Exactly.

I only post what works on computers I use so my advice may or may not always be spot on for another user.

The idea that a swap file is now "normal" is not my experience, and I've installed quite a few different distros. But @poorguy's experience may well be different than mine. I find most distros to automatically create a swap partition. Further, when using manual partitioning during a Linux installation, I find that the installer will complain if you do not set a swap partition, although it will allow you to proceed without it. I do not think that the installer will allow setting a swap file, instead of a partition, but I may be wrong. Using Google to find out how to set up a swap file shows some command line work is necessary, and I just don't think that is the norm yet.
When I install Linux I insert the DVD in the tray and just let the Linux installer run and do the install.

I'm an OOTB install and update Linux user the way it is intended to be.

So yes the Linux installer creates a swap partition file / folder.

Still, the articles referenced make good points. If you have a lot of RAM, you likely don't need swap space, unless you strongly want to use hibernation power saving techniques. But hibernation (and excessive swapping for other reasons, like heavy video editing perhaps) can cause a lot of wear and tear on your SSD, and you should consider that. Trim and swappiness are other settings to consider. But how you use your SSD will almost certainly not be how we use a SSD, so you have to choose what's best for you. Google for more info also...
I use old computers and sometimes only run 4.0 GB of memory and for those computers swap can be good to have rather it gets used or not.

Google knows everything. :eek::D
My Wife said that she knows everything. :p:D
 
Last edited by a moderator:
I have 8GB Ram and have an 8GB Swap drive. I use Neon (KDE) and have a widget on my desktop that monitors memory, Swap is in there. My swap drive is almost always at 0 B, without modifying any settings, other than disabling hibernation. I have seen it having a couple megabytes. The point is that unless you're doing something special or have only a small amount of RAM, you probably aren't really getting that much activity on your swap partition. Blackneos940, with 32GB RAM, your swap partition probably has dust on it. :)
Oh no, it's a 32GB eMMC Card, not RAM..... :D Did I leave that out.....? :3 Anyway, a loved one accidentally knocked it on the floor and now it's toast, as I was able to put it back together before, but not very much was holding it together..... :(

R.I.P. My Beloved X205TA... You will be missed..... :(
 
[Quote Blackneos940 post # 8]
Well then!..... :) Think I'll add some Swap to my 32GB eMMC then!..... :)

----------------------------------------------------------
----------------------------------------------------------

I don't think Blackneos940 has 32 GB of ram.

I believe the 32GB emmc Blackneos940 is referring to is embedded storage used in place of a mechanical hard drive or ssd drive.

I may be wrong as I'm uncertain of what type of computer Blackneos940 is using.

https://www.enterprisestorageforum.com/storage-hardware/emmc-flash-memory-storage.html

https://laptoping.com/laptop-pc-storage-explained-hdd-ssd-hybrid-emmc.html

https://www.howtogeek.com/196541/emmc-vs.-ssd-not-all-solid-state-storage-is-equal/
It's an ASUS X205TA Netbook, which acted as mostly a Thin Client to my Desktop Server running Xubuntu L.T.S...... :) But it's dead now, display among other things..... :(
 
Hello everybody! Let me put my two cents on this.

First thing first. Googling around I realized that nowadays optimizations and settings for SSD on Linux, are "myths" since SSD have nothing to do with those used to be used 3-5 years ago. Additionally Linux distributions that we have today are equipped with the 4+ line of the Linux kernel.

One by one.

SSD makers have taken care of their lifetime to withstand 100 TB records while Linux developers continuously improve system files to take advantage of every new SSD feature.

Block Alignment:
Many people still believe that partition alignment is essential for SSD. However, this is not necessary. The problem with alignment occurs when we just move a Linux installation from a standard HDD to SSD (eg with CloneZilla) and this before 2013 era. A user who know about CloneZilla already knows what to do.

Deactivation of Swap partition:
One of the biggest myths is to deactivate SWAP on Linux when we have SSDs and especially in conjunction with those with more than 4GB of Ram.
SSDs, as we have said, have a certain number of recordings, it's an old myth that we must deactivate SWAP and that we do not need it. In fact, the existence of Swap is more good than bad.
There are times, for example, that an application, or a badly crafted website, will begin to fill RAM while you carelessly write your work. If you do not have a Swap, which will take the heavy load to receive RAM data, it is likely that your system will "freeze" and you will need to shut down the computer manually resulting in a loss of your job and the worse to cause some irreversible destruction from the sudden power failure.

Set 0 (zero) swapiness:
This setting has to do with the priority of using or not of Swap. Actually, the arrangement itself is not a myth but the various tips are not a rule. In other words, most distributions have seen that setting it at 60 is an ideal choice for general purpose of desktops.

Disable browser cache:
Turning off the browser cache to reduce subscriptions to the SSD, unfortunately has the opposite effects. Your favorite browser is set to download the web site once on the disk so that it will load the next time you visit it (if it has not changed dramatically) to load it faster and not have to download it all again. If we disable it in order to save records, then all we can do is increase it because every time we visit the site, it will be taken from the beginning, recorded and at the same time we will see the delay that we mentioned.

SSD Trim:
TRIM is a function that the operating system can use to inform our SSD, which blocks are no longer used. Full support for TRIM was added to the Linux kernel in version 3.7.
Should not care about TRIM because almost all distributions have automated the process and most likely have configured the operating system to perform it once a week.

I found many other tips that are not necessary to be included, I think you get the point.
Don't worry for your SSD any more. Just plug and enjoy.
Linux does the trick.;)
 
Hello everybody! Let me put my two cents on this.

First thing first. Googling around I realized that nowadays optimizations and settings for SSD on Linux, are "myths" since SSD have nothing to do with those used to be used 3-5 years ago. Additionally Linux distributions that we have today are equipped with the 4+ line of the Linux kernel.

One by one.

SSD makers have taken care of their lifetime to withstand 100 TB records while Linux developers continuously improve system files to take advantage of every new SSD feature.

Block Alignment:
Many people still believe that partition alignment is essential for SSD. However, this is not necessary. The problem with alignment occurs when we just move a Linux installation from a standard HDD to SSD (eg with CloneZilla) and this before 2013 era. A user who know about CloneZilla already knows what to do.

Deactivation of Swap partition:
One of the biggest myths is to deactivate SWAP on Linux when we have SSDs and especially in conjunction with those with more than 4GB of Ram.
SSDs, as we have said, have a certain number of recordings, it's an old myth that we must deactivate SWAP and that we do not need it. In fact, the existence of Swap is more good than bad.
There are times, for example, that an application, or a badly crafted website, will begin to fill RAM while you carelessly write your work. If you do not have a Swap, which will take the heavy load to receive RAM data, it is likely that your system will "freeze" and you will need to shut down the computer manually resulting in a loss of your job and the worse to cause some irreversible destruction from the sudden power failure.

Set 0 (zero) swapiness:
This setting has to do with the priority of using or not of Swap. Actually, the arrangement itself is not a myth but the various tips are not a rule. In other words, most distributions have seen that setting it at 60 is an ideal choice for general purpose of desktops.

Disable browser cache:
Turning off the browser cache to reduce subscriptions to the SSD, unfortunately has the opposite effects. Your favorite browser is set to download the web site once on the disk so that it will load the next time you visit it (if it has not changed dramatically) to load it faster and not have to download it all again. If we disable it in order to save records, then all we can do is increase it because every time we visit the site, it will be taken from the beginning, recorded and at the same time we will see the delay that we mentioned.

SSD Trim:
TRIM is a function that the operating system can use to inform our SSD, which blocks are no longer used. Full support for TRIM was added to the Linux kernel in version 3.7.
Should not care about TRIM because almost all distributions have automated the process and most likely have configured the operating system to perform it once a week.

I found many other tips that are not necessary to be included, I think you get the point.
Don't worry for your SSD any more. Just plug and enjoy.
Linux does the trick.;)
Well then..... :) That was informative!..... :3 Well put good sir!..... :3
 
G'day @shastrycs and welcome to linux.org :) ... although we have not seen you since you posted, so hope we have not chased you away with all this discussion on Swap.

Bottom line for you is that Linux has the support for SSDs :p

I will be starting a Thread on Swap in a few days, and all may find my experiences of value (I run 90 LInux), and have their own to add or ask about.

I won't hijack this Thread further, other to just say the following, briefly, and will elaborate more at the new Thread.

I do not think that the installer will allow setting a swap file, instead of a partition, but I may be wrong.

Sorry, Stan, Tom is right, and you may just not have experienced this yet.

Since Bionic Beaver was released April 2018, this phenomenon/practice is growing amongst developers, see here https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes ... which says, in part

Other base system changes since 16.04 LTS

  • The gpg binary is provided by gnupg2
  • For new installs, a swap file will be used by default instead of a swap partition.

These are installed without user interaction.

Just this morning, I have seen them in Elementary OS 5 'Juno' and in Peppermint 10 ... but as said, I will deal with this more elsewhere, soon.

Cheers and enjoy your Linux

Chris Turner
wizardfromoz
 
G'day @shastrycs and welcome to linux.org :) ... although we have not seen you since you posted, so hope we have not chased you away with all this discussion on Swap.

Bottom line for you is that Linux has the support for SSDs :p

I will be starting a Thread on Swap in a few days, and all may find my experiences of value (I run 90 LInux), and have their own to add or ask about.

I won't hijack this Thread further, other to just say the following, briefly, and will elaborate more at the new Thread.



Sorry, Stan, Tom is right, and you may just not have experienced this yet.

Since Bionic Beaver was released April 2018, this phenomenon/practice is growing amongst developers, see here https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes ... which says, in part



These are installed without user interaction.

Just this morning, I have seen them in Elementary OS 5 'Juno' and in Peppermint 10 ... but as said, I will deal with this more elsewhere, soon.

Cheers and enjoy your Linux

Chris Turner
wizardfromoz
I just saw the Wizard and Homer reaction faces, so I had to add them!..... :D But 90 Distros..... That's inSANE!..... :D
 

Members online


Top