Help with ssd
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Help with ssd
I have decided to try out Linux,as I have just got a 60gb ssd. Windows takes up far too much space and I want to get the most out of my disk.
Because Linux is new to me every page I look at when trying to find info on the best settings to use with an ssd might as well be written in clingon. This might seem like I am trying to run before I can walk, but I would like to set the os that it reduces the amount of writes on the disk.
Could anyone point to a tutorial that can be understood by a mint virgin. I would like to set up a ramdisk for all cache and temp files. It would also be handy to know if I really need a swap partition, and if not how to get rid of it.
Thanks from a confused newbie.
Because Linux is new to me every page I look at when trying to find info on the best settings to use with an ssd might as well be written in clingon. This might seem like I am trying to run before I can walk, but I would like to set the os that it reduces the amount of writes on the disk.
Could anyone point to a tutorial that can be understood by a mint virgin. I would like to set up a ramdisk for all cache and temp files. It would also be handy to know if I really need a swap partition, and if not how to get rid of it.
Thanks from a confused newbie.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Help with ssd
Update 2: below I share how to enable TRIM for your SSD with the discard keyword. For some specific SSD models this may in fact cause file deletions you do to take more time than without the discard keyword. If that is the case for your SSD, here is the alternative of enabling TRIM with the fstrim command run once daily through cron: http://www.webupd8.org/2013/01/enable-t ... rives.html
Update: if you are using the MATE desktop, replace the editor "gedit" in below commands with "pluma". Or for KDE replace it with "kate.
Hi, first off, it is Klingon. You don't want to get caught by these guys misspelling their language
As for swap, that depends on how much main memory your machine has. (You can see this in Menu -> Control Center -> System Profiler and Benchmark, then under Devices click Memory and look at Total Memory--roughly devide by 1,000,000 to get to how much GB that is.) If you have 1GB or less, you really need swap. If you have around 2GB it depends on what you use your machine for (Internet and Office will run fine without swap, but if you do movie editing, rendering, DAW or such things you need swap). At 4GB or over you don't really need swap, I run without it. If however you want to hibernate your machine, you need swap at least equal to how much main memory your machine has.
On to optimizing for SSD. For this you need to open Terminal (find it in Menu). Normally the system is optimized to work with a normal harddisk, but this is actually all overhead for a SSD that is slowing the system down.To fix this, in Terminal type:
Enter your password when asked, and then change the line:
Save & close the file. Then do the following to activate the changes from next reboot:
Next up, you need to find out if your SSD supports TRIM. Just copy & paste the following command string to the Terminal and execute it. When asked type your password (nothing will seem to happen as you type, this is normal):
Did it list your SSD? Then it supports TRIM, if it didn't show anything your SSD doesn't support TRIM. Remember that, and continue with:
First the easy part, at the end of this file add the following line. These change it so temporary files are stored in memory instead of on your SSD.
Now for the hard part. Probably you have a line like something like the following in your file:
And if your SSD supported TRIM, instead change it to (this does the same as above, but enables TRIM use on your SSD):
Finally, save & close this file. Then run the following two commands. This will reboot your system to activate all changes.
After the rebot, you'll want to start Firefox, type in the address bar:
And hit enter. Accept the warning and continue. Right click on an empty part, and select New -> String from the context menu that popped up. Enter:
And give it the value:
This makes the Firefox cache also be stored in memory instead of on disk. If you have 2GB or less, you might not want to do this though.
Edit: some questions answered about mounting options and scheduler, here http://forums.linuxmint.com/viewtopic.p ... 0&p=578163.
Update: if you are using the MATE desktop, replace the editor "gedit" in below commands with "pluma". Or for KDE replace it with "kate.
Hi, first off, it is Klingon. You don't want to get caught by these guys misspelling their language
As for swap, that depends on how much main memory your machine has. (You can see this in Menu -> Control Center -> System Profiler and Benchmark, then under Devices click Memory and look at Total Memory--roughly devide by 1,000,000 to get to how much GB that is.) If you have 1GB or less, you really need swap. If you have around 2GB it depends on what you use your machine for (Internet and Office will run fine without swap, but if you do movie editing, rendering, DAW or such things you need swap). At 4GB or over you don't really need swap, I run without it. If however you want to hibernate your machine, you need swap at least equal to how much main memory your machine has.
On to optimizing for SSD. For this you need to open Terminal (find it in Menu). Normally the system is optimized to work with a normal harddisk, but this is actually all overhead for a SSD that is slowing the system down.To fix this, in Terminal type:
Code: Select all
gksudo gedit /etc/default/grub
To:GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Code: Select all
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=noop"
Code: Select all
sudo update-grub2
Code: Select all
for h in /dev/sd?; do if [ `sudo hdparm -I $h | grep TRIM | wc -l` != 0 ]; then sudo hdparm -I $h | egrep "/dev/|Model"; fi; done
Code: Select all
gksudo gedit /etc/fstab
Code: Select all
none /tmp tmpfs nodev,nosuid,mode=1777 0 0
You need to change the:UUID=0c4de1f6-b77b-49d7-bccf-63c4268e8f43 / ext4 errors=remount-ro 0 1
To read (this disables writing to disk each time a file is read):errors=remount-ro
Code: Select all
errors=remount-ro,noatime
Code: Select all
errors=remount-ro,noatime,discard
Code: Select all
sudo rm -rf /tmp/*
sudo reboot
Code: Select all
about:config
Code: Select all
browser.cache.disk.parent_directory
Code: Select all
/tmp
Edit: some questions answered about mounting options and scheduler, here http://forums.linuxmint.com/viewtopic.p ... 0&p=578163.
Re: Help with ssd
You learn something new everyday. I learned the correct spelling of Klingon (is it considered a weakness to ask for forgiveness for my mistake?)
That all seems to have worked. Thank you for your time and help.
I also managed to turn off swap and delete the partition. Now to reallocating that free space.
QA TLHO'
That all seems to have worked. Thank you for your time and help.
I also managed to turn off swap and delete the partition. Now to reallocating that free space.
QA TLHO'
Re: Help with ssd
buy' ngop
majQa'
Brilliant signature BTW
majQa'
Brilliant signature BTW
Re: Help with ssd [SOLVED]
I'm sure your instructions will be used by many as ssd's become more popular
Re: Help with ssd
My temp files are still going to file "system/tmp"
After the first command change I get this message in the terminal:
(gedit:4862): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
After the first command change I get this message in the terminal:
(gedit:4862): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
Re: Help with ssd
You can ignore that. Gedit keeps a list of recently used files, and as you are executing commands as root it tries to update also for the root user the list of recently used files. On default install the folder /root/.local/share doesn't exist. No harm in this. But if you want to not see these errors, run:(gedit:4862): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
Code: Select all
sudo mkdir -p /root/.local/share
Added to /etc/fstab file does. It makes a new temporary filesystem in memory (type=tmpfs). If you doubt if it is active, after reboot on the changes do:none /tmp tmpfs nodev,nosuid,mode=1777 0 0
Code: Select all
cat /etc/mtab
Code: Select all
mount
Re: Help with ssd
I think I understand. /tmp shows the temp files on the ssd and ram.
I think the hardest part of this is going to be forgeting about windows after 20 years of using it.
I think the hardest part of this is going to be forgeting about windows after 20 years of using it.
Re: Help with ssd
Hi Vincent,xenopeek wrote:First the easy part, at the end of this file add the following two lines. These change it so temporary files are stored in memory instead of on your SSD.
Code: Select all
none /tmp tmpfs nodev,nosuid,mode=1777 0 0 none /var/tmp tmpfs nodev,nosuid,mode=1777 0 0
I hope you won't mind if I resuscitate this post. Can you please clarify about the using the RAM for tmpfs?
On a machine having 4GB RAM and using LM13 64 bits, would there be any chance that tmpfs runs out of memory? The typical applications opened on this computer is Firefox (10 tabs in general), Virtualbox (the VM is allocated 800 MB), evince PDF Viewer, burning DVD from time to time. System monitor shows RAM usage between 1.4 to 2.0 GB.
Let's assume tmpfs doesn't have enough RAM, would there be any visible sign or would the computer hang unexpectedly?
Thanks in advance
Re: Help with ssd
tmpfs mounts are by default set to half your memory size. In your case, each tmpfs mount will be 2 GiB it size. That is its virtual size, it only uses as much memory as the space that it actually needs. As happens with any mount that is filling up, you will receive a warning when it is close to running out of free space.
Usually your /tmp is not needing that much space and 2 GiB will be unlikely to be used. You can check how much is being used with the command:
Sizes shown are in KiB.
If you want, you can configure your tmpfs mount to have a different size. You can do so with the "size" option, as for example to restrict it to 25% of memory:
Instead of percentages, you can also give it a specific amount of bytes. Or add the suffix k, m or g to make that KiB, MiB or GiB. More details available in the kernel documentation on tmpfs: https://www.kernel.org/doc/Documentatio ... /tmpfs.txt
Usually your /tmp is not needing that much space and 2 GiB will be unlikely to be used. You can check how much is being used with the command:
Code: Select all
df
If you want, you can configure your tmpfs mount to have a different size. You can do so with the "size" option, as for example to restrict it to 25% of memory:
Code: Select all
none /tmp tmpfs nodev,nosuid,mode=1777,size=25% 0 0
Re: Help with ssd
Hi,
It looks like 4GB RAM is not enough for LM13 x64. After half of a day, the machine experiences little strange behavior with Firefox 13. FF 13 is slow when the window is dragged around and has experiences a perceivable reduction of responsiveness. Clicking in a folder in the FF bookmark toolbar no longer unfold the content. After a reboot, all these issues disappear and reappear a few hours later.
May be this is a FF13 specific issue. What is strange is that when I comment out the two lines related to tmpfs in fstab, there is no issue. I am going to increase the RAM on that machine to 8GB and put back the 2 lines in fstab to see if that improves the situation.
EDIT: More info a month after increasing the RAM from 4GB to 8GB, the hang up issue of Firefox 13 had disappeared. I am certain that the RAM increase was the fix. During the 1st week after increasing RAM, I didn't change anything else in the computer and the issue was occurring on a daily basis when there were 4GB. I have also set the size of the RAM disk to 25% (therefore reserving 2GB on the total 8GB).
It looks like 4GB RAM is not enough for LM13 x64. After half of a day, the machine experiences little strange behavior with Firefox 13. FF 13 is slow when the window is dragged around and has experiences a perceivable reduction of responsiveness. Clicking in a folder in the FF bookmark toolbar no longer unfold the content. After a reboot, all these issues disappear and reappear a few hours later.
May be this is a FF13 specific issue. What is strange is that when I comment out the two lines related to tmpfs in fstab, there is no issue. I am going to increase the RAM on that machine to 8GB and put back the 2 lines in fstab to see if that improves the situation.
EDIT: More info a month after increasing the RAM from 4GB to 8GB, the hang up issue of Firefox 13 had disappeared. I am certain that the RAM increase was the fix. During the 1st week after increasing RAM, I didn't change anything else in the computer and the issue was occurring on a daily basis when there were 4GB. I have also set the size of the RAM disk to 25% (therefore reserving 2GB on the total 8GB).
Re: Help with ssd
I used this post over the weekend to set up an SSD, worked really well! The main reason I am posting is to remind anyone else who uses this post that 'gedit' is the GNOME text editor. In MATE, this has been replaced as 'pluma', so you need to use pluma in place of gedit (or just open pluma and the file from the GUI). I can't remember what text edit is used in the other DEs (Cinnamon, Xfce, and so forth), but would need to use that in place of gedit. The rest of the stuff seemed pretty DE agnostic.
Thanks for the great post, Vincent!
Thanks for the great post, Vincent!
Re: Help with ssd
Since it shows "/dev/sda" I suppose it does (?), but should I be careful about the "bad/missing" messages, or can I simply proceed?xenopeek wrote:...Did it list your SSD? ...Code: Select all
for h in /dev/sd?; do if [ `sudo hdparm -I $h | grep TRIM | wc -l` != 0 ]; then sudo hdparm -I $h | egrep "/dev/|Model"; fi; done
Code: Select all
for h in /dev/sd?; do if [ `sudo hdparm -I $h | grep TRIM | wc -l` != 0 ]; then sudo hdparm -I $h | egrep "/dev/|Model"; fi; done
/dev/sda:
Model Number: OCZ-AGILITY3
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Re: Help with ssd
Yes, the OCZ-AGILITY3 supports trim. I'm not sure about the errors, but at least be sure that the OCZ-AGILITY3 supports trim.
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Help with ssd
Very interesting. If I get time at work this morning I'll do a bit of research on that to find out more. Thanks for the link.xenopeek wrote:below I share the old way of enabling TRIM for your SSD (with the discard keyword), but it seems these days that is better done as per this article: http://www.webupd8.org/2013/01/enable-t ... rives.html[/color]
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: Help with ssd
I was writing a guide to post on here but I didn't finish it (it's done more or less, I just wanted to add some benchmarks but never got around to run them). Feel free to have a look.