Enable TRIM On SSD (Solid-State Drives) In Ubuntu For Better Performance

TRIM allows the OS to “inform a solid-state drive (SDD) which blocks of data are no longer considered in use and can be wiped internally“. Without using TRIM, the SSD speed decreases after a while so if you have a solid-state drive that supports TRIM, you should enable it so your SSD remains fast over time.
This isn’t easy to benchmark because the performance decreases over time so you’d neet to check the SSD speed constantly for a few months to see exactly how the SSD is affected when TRIM is not enabled. But if your SSD read / write speed decreases a lot over time and you haven’t enabled TRIM, this may be way.
Some articles mention using online discard – enabling TRIM by adding the “discard” option to /etc/fstab -, but there are many who say this isn’t a good idea for most solid-state drives and you’ll get a pretty significant performance hit when trying to delete a large number of small files. So below I’ll let you know how to use both of these methods: online discard (not recommended) and the recommended way: using fstrim and a cron (anacron) job.
Note: the instructions below have been tested in Ubuntu, but they may (most probably) work with other Linux distributions as well.
Before enabling TRIM, you must make sure:
you’re using the Linux Kernel 2.6.33 or neweryour SSD supports TRIMthe partition(s) are EXT4 or BTRFS*
* Since not many people are using BTRFS, this post will only cover enabling TRIM on EXT4 partitions.
If you’re unsure if your SSD supports TRIM, you can run the following command:sudo hdparm -I /dev/sda | grep “TRIM supported”
Where “/dev/sda” is the solid-state drive (it may be /dev/sdb, /dev/sdc, etc. for you), and the command should return something like this: “Data Set Management TRIM supported (limit 8 blocks)” (if there’s no output, your SSD doesn’t support TRIM).

Category: Ubuntu | Comments Off on Enable TRIM On SSD (Solid-State Drives) In Ubuntu For Better Performance

Ubuntu: LightDM Black Screen When Using SSD Workaround

Some Ubuntu users are reporting LightDM errors when using a SDD: about half the time when starting the computer, LightDM (the default Ubuntu display manager) doesn’t load correctly and only a black screen and a blinking command line cursor shows up. The issue isn’t limited to those who are using a SSD, but it’s a lot more frequent when booting Ubuntu from a solid-state drive.
I too am experiencing this issue with Ubuntu 12.10 (not tested on older Ubuntu versions because I didn’t have a SSD when I was using 12.04) and I’ve found two possible workarounds which have worked for me so I thought I’d share them with you, in case you’re experiencing the same issue.

It seems that the black screen with only a blinking cursor (though sometimes I’ve also seen the “System is running in low-graphics mode” error) issue occurs due to a race condition with LightDM and without any tweaks, the only way to load the desktop was to either switch to a tty (CTRL + ALT + F1), login and then restart Lightdm using the “sudo service lightdm restart” command or restart the computer. So here are two possible workarounds:

1. Start LightDM with a delay

LightDM
One way around this is to start LightDM with a delay. My system, with Ubuntu 12.10 64bit installed on a SSD boots in ~14 seconds so adding a delay isn’t ideal, but it’s definitely better than having to manually start LightDM or restart the computer. For me, a 2 seconds delay was enough so it’s not that bad, however, some users have reported that a higher delay was required for them, so it depends on your system and SSD.
I must also mention that from what I’ve read, this workaround doesn’t always work, meaning that if before using it, LightDM wouldn’t start 50% of the time, using this workaround doesn’t necessary mean it will work 100% of the time. Since I’ve applied this tweak, LightDM has worked every time for me so this probably depends on the hardware / SSD and how fast the system boots.
To start LightDM with a delay, edit the /etc/init/lightdm.conf file as root with a text editor (I’ll be using Gedit below):gksu gedit /etc/init/lightdm.conf
And near the end of the file (line 47 for me under Ubuntu 12.10 with LightDM 1.4.0-0ubuntu2), above “exec lightdm”, add the following line and then save the file: sleep 2
“2” is the number of seconds used to delay starting LightDM. Like I was saying above, “2” was enough for me, but depending on your system, you might need to add a higher value.
This is how the end of the /etc/init/lightdm.conf file should look like after editing it:

lightdm.conf delay

2. Use GDM instead of LightDM

GDM
The issue did not occur for me while using GDM and booting Ubuntu from a SSD, so if you don’t want to add a delay to LightDM, you can install and use GDM instead.
To install GDM in Ubuntu, use the following command:
sudo apt-get install gdm
Or install it via Synaptic, Software Center, etc.

When installing GDM, you’ll be prompted to select the display manager: here, select GDM instead of LightDM.
If GDM was already installed but you were using LightDM, you can switch to GDM by using the following command:sudo dpkg-reconfigure gdm
And then select GDM when prompted.

More about switching between LightDM, GDM, etc. in Ubuntu, HERE.

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on Ubuntu: LightDM Black Screen When Using SSD Workaround

Ubuntu: LightDM Black Screen When Using SSD Workaround

Some Ubuntu users are reporting LightDM errors when using a SDD: about half the time when starting the computer, LightDM (the default Ubuntu display manager) doesn’t load correctly and only a black screen and a blinking command line cursor shows up. The issue isn’t limited to those who are using a SSD, but it’s a lot more frequent when booting Ubuntu from a solid-state drive.
I too am experiencing this issue with Ubuntu 12.10 (not tested on older Ubuntu versions because I didn’t have a SSD when I was using 12.04) and I’ve found two possible workarounds which have worked for me so I thought I’d share them with you, in case you’re experiencing the same issue.

It seems that the black screen with only a blinking cursor (though sometimes I’ve also seen the “System is running in low-graphics mode” error) issue occurs due to a race condition with LightDM and without any tweaks, the only way to load the desktop was to either switch to a tty (CTRL + ALT + F1), login and then restart Lightdm using the “sudo service lightdm restart” command or restart the computer. So here are two possible workarounds:

1. Start LightDM with a delay

LightDM
One way around this is to start LightDM with a delay. My system, with Ubuntu 12.10 64bit installed on a SSD boots in ~14 seconds so adding a delay isn’t ideal, but it’s definitely better than having to manually start LightDM or restart the computer. For me, a 2 seconds delay was enough so it’s not that bad, however, some users have reported that a higher delay was required for them, so it depends on your system and SSD.
I must also mention that from what I’ve read, this workaround doesn’t always work, meaning that if before using it, LightDM wouldn’t start 50% of the time, using this workaround doesn’t necessary mean it will work 100% of the time. Since I’ve applied this tweak, LightDM has worked every time for me so this probably depends on the hardware / SSD and how fast the system boots.
To start LightDM with a delay, edit the /etc/init/lightdm.conf file as root with a text editor (I’ll be using Gedit below):gksu gedit /etc/init/lightdm.conf
And near the end of the file (line 47 for me under Ubuntu 12.10 with LightDM 1.4.0-0ubuntu2), above “exec lightdm”, add the following line and then save the file: sleep 2
“2” is the number of seconds used to delay starting LightDM. Like I was saying above, “2” was enough for me, but depending on your system, you might need to add a higher value.
This is how the end of the /etc/init/lightdm.conf file should look like after editing it:

lightdm.conf delay

2. Use GDM instead of LightDM

GDM
The issue did not occur for me while using GDM and booting Ubuntu from a SSD, so if you don’t want to add a delay to LightDM, you can install and use GDM instead.
To install GDM in Ubuntu, use the following command:
sudo apt-get install gdm
Or install it via Synaptic, Software Center, etc.

When installing GDM, you’ll be prompted to select the display manager: here, select GDM instead of LightDM.
If GDM was already installed but you were using LightDM, you can switch to GDM by using the following command:sudo dpkg-reconfigure gdm
And then select GDM when prompted.

More about switching between LightDM, GDM, etc. in Ubuntu, HERE.

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on Ubuntu: LightDM Black Screen When Using SSD Workaround

Ubuntu: LightDM Black Screen When Using SSD Workaround

Some Ubuntu users are reporting LightDM errors when using a SSD: about half the time when starting the computer, LightDM (the default Ubuntu display manager) doesn’t load correctly and only a black screen and a blinking command line cursor shows up. The issue isn’t limited to those who are using a SSD, but it’s a lot more frequent when booting Ubuntu from a solid-state drive.
I too am experiencing this issue with Ubuntu 12.10 (not tested on older Ubuntu versions because I didn’t have a SSD when I was using 12.04) and I’ve found two possible workarounds which have worked for me so I thought I’d share them with you, in case you’re experiencing the same issue.

It seems that the black screen with only a blinking cursor (though sometimes I’ve also seen the “System is running in low-graphics mode” error) issue occurs due to a race condition with LightDM and without any tweaks, the only way to load the desktop was to either switch to a tty (CTRL + ALT + F1), login and then restart Lightdm using the “sudo service lightdm restart” command or restart the computer. So here are two possible workarounds:

1. Start LightDM with a delay

LightDM
One way around this is to start LightDM with a delay. My system, with Ubuntu 12.10 64bit installed on a SSD boots in ~14 seconds so adding a 2 second delay isn’t much, however, for some, a larger delay might be needed (it depends on the system / SSD). This isn’t ideal but it’s definitely better than having to manually start LightDM or restart the computer.
I must also mention that from what I’ve read, this workaround doesn’t always work, meaning that if before using it, LightDM wouldn’t start 50% of the time, using this workaround doesn’t necessary mean it will work 100% of the time. Since I’ve applied this tweak, LightDM has worked every time for me so this probably depends on the hardware / SSD and how fast the system boots.
To start LightDM with a delay, edit the /etc/init/lightdm.conf file as root with a text editor (I’ll be using Gedit below):gksu gedit /etc/init/lightdm.conf
And near the end of the file (line 47 for me under Ubuntu 12.10 with LightDM 1.4.0-0ubuntu2), above “exec lightdm”, add the following line and then save the file: sleep 2
“2” is the number of seconds used to delay starting LightDM. Like I was saying above, “2” was enough for me, but depending on your system, you might need to add a higher value.
This is how the end of the /etc/init/lightdm.conf file should look like after editing it:

lightdm.conf delay

2. Use GDM instead of LightDM

GDM
The issue did not occur for me while using GDM and booting Ubuntu from a SSD, so if you don’t want to add a delay to LightDM, you can install and use GDM instead.
To install GDM in Ubuntu, use the following command:
sudo apt-get install gdm
Or install it via Synaptic, Software Center, etc.

When installing GDM, you’ll be prompted to select the display manager: here, select GDM instead of LightDM.
If GDM was already installed but you were using LightDM, you can switch to GDM by using the following command:sudo dpkg-reconfigure gdm
And then select GDM when prompted.

More about switching between LightDM, GDM, etc. in Ubuntu, HERE.

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on Ubuntu: LightDM Black Screen When Using SSD Workaround