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

How To Find Out Maximum Supported RAM Or Number Of Available DIMM Slots In Linux

Dmidecode ubuntuIf you need a quick way to find out how much RAM your Linux system supports or to determine the number of DIMM slots available, you can use a command line tool called “dmidecode”.
To find out the maximum RAM capacity and the number of RAM slots available, use the following command:sudo dmidecode -t 16
The output should look something like this:
# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0032, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 4

The “Maximum Capacity” is the maximum RAM supported by your system, while “Number of Devices” is the number of memory (DIMM) slots available on your computer.
To see complete memory information, including the info above along with currently installed memory information (RAM speed, size, etc.), use:sudo dmidecode -t memory
Here’s an example output for the command above:

# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0032, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 4

Handle 0x0033, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 2048 MB
Form Factor: SODIMM
Set: None
Locator: ChannelA-DIMM0
Bank Locator: BANK 0
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: 7732E9D6
Asset Tag: 9876543210
Part Number: M471B5773DH0-CH9
Rank: Unknown

Handle 0x0035, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelA-DIMM1
Bank Locator: BANK 1
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown

Handle 0x0036, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: SODIMM
Set: None
Locator: ChannelB-DIMM0
Bank Locator: BANK 2
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: 830B
Serial Number: A74D1715
Asset Tag: 9876543210
Part Number: NT4GC64B8HG0NS-CG
Rank: Unknown

Handle 0x0038, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelB-DIMM1
Bank Locator: BANK 3
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown

You can also use lshw (among others) for this (firstly, install it; in Ubuntu: “sudo apt-get install lshw):lshw -short -C memory

It’s important to note that Dmidecode reports system hardware information as described in the BIOS and does not scan your hardware, so in some cases the output can be wrong. Running dmidecode on my Dell XPS L702X non-3D laptop, the output says my system should have 4 RAM slots but in fact there are only 2 and only the 3D version of my laptop can have 4 RAM slots (and by the way, there are some Windows applications reporting the same thing).

Also see: How To Get Hardware Information In Linux

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



Category: Ubuntu | Comments Off on How To Find Out Maximum Supported RAM Or Number Of Available DIMM Slots In Linux

How To Find Out Maximum Supported RAM Or Number Of Available DIMM Slots In Linux

Dmidecode ubuntuIf you need a quick way to find out how much RAM your Linux system supports or to determine the number of DIMM slots available, you can use a command line tool called “dmidecode”.
To find out the maximum RAM capacity and the number of RAM slots available, use the following command:sudo dmidecode -t 16
The output should look something like this:
# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0032, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 4

The “Maximum Capacity” is the maximum RAM supported by your system, while “Number of Devices” is the number of memory (DIMM) slots available on your computer.
To see complete memory information, including the info above along with currently installed memory information (RAM speed, size, etc.), use:sudo dmidecode -t memory
Here’s an example output for the command above:

# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0032, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 16 GB
Error Information Handle: Not Provided
Number Of Devices: 4

Handle 0x0033, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 2048 MB
Form Factor: SODIMM
Set: None
Locator: ChannelA-DIMM0
Bank Locator: BANK 0
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: Samsung
Serial Number: 7732E9D6
Asset Tag: 9876543210
Part Number: M471B5773DH0-CH9
Rank: Unknown

Handle 0x0035, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelA-DIMM1
Bank Locator: BANK 1
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown

Handle 0x0036, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
Form Factor: SODIMM
Set: None
Locator: ChannelB-DIMM0
Bank Locator: BANK 2
Type: DDR3
Type Detail: Synchronous
Speed: 1333 MHz
Manufacturer: 830B
Serial Number: A74D1715
Asset Tag: 9876543210
Part Number: NT4GC64B8HG0NS-CG
Rank: Unknown

Handle 0x0038, DMI type 17, 28 bytes
Memory Device
Array Handle: 0x0032
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: ChannelB-DIMM1
Bank Locator: BANK 3
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: 9876543210
Part Number: Not Specified
Rank: Unknown

You can also use lshw (among others) for this (firstly, install it; in Ubuntu: “sudo apt-get install lshw):sudo lshw -C memory

It’s important to note that Dmidecode reports system hardware information as described in the BIOS and does not scan your hardware, so in some cases the output can be wrong. Running dmidecode on my Dell XPS L702X non-3D laptop, the output says my system should have 4 RAM slots but in fact there are only 2 and only the 3D version of my laptop can have 4 RAM slots (and by the way, there are some Windows applications reporting the same thing), however, the command is accurate about it supporting 16 GB of RAM.

Also see: How To Get Hardware Information In Linux

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



Category: Ubuntu | Comments Off on How To Find Out Maximum Supported RAM Or Number Of Available DIMM Slots In Linux