Ubuntu how to install and optimize SSD hard disk

  

SSD is a solid state hard disk, you need to optimize it after Ubuntu installation, in order to better use SSD hard disk, the following small series will introduce you to Ubuntu installation and optimize SSD hard disk The method, interested friends may wish to understand.

Installation

1. Download Ubuntu CD image

2. Use u disk to install

At this point, the computer has no CD-ROM available, use UltraISO's "UltraISO" ; write to the hard disk image & rdquo; write the ISO file to the u disk.

3.Installation

Most of the processes are the same as the normal installation method. The mount point allocates 20G, the /home mount point allocates other SSD capacity, and a new /store mount point is created. All mechanical hard disk capacity is allocated. All partition formats are selected as ext4.

Optimizing Settings

1.Using Ext4 without journaling file system

The traditional SSD+Linux combination generally recommends the Ext2 file system, mainly considering that Ext3 and Ext4 require additional Logging will shorten the life of the SSD, and the new TRIM technology has two shortcomings in Ext2:

Only offline TRIM is supported, in other words the file system must be read-only mounted;

You need to manually execute the hdparm command or the wiper.sh script.

Ext4 does not have these restrictions, allowing TRIM to run in the background, and the logging feature can be manually turned off (the file system is more vulnerable to corruption if there is no log, such as a sudden power outage), if you are willing to take such risks To extend the life of the SSD, it is worth a try. In addition, many tests such as: Testing EXT4 & Btrfs On A Serial ATA 3.0 SSD, file system for BSD like Btrfs is not as fast as Ext4 (not so fast with SSD).

So, when installing the system above, the Ext4 system is selected, and then the log function needs to be turned off.

First of all, the log function cannot be disabled when the system is mounted, so you need to enter the U disk system and execute it with root privileges:

tune2fs -O ^has_journal /dev/sda1

Turns off logging on /dev/sda1.

Then, run the operating system detection:

e2fsck -f /dev/sda1

Otherwise, the file system may go wrong.

Finally, reboot, enter the system in the SSD, check whether the settings are successful:

dmesg |  Grep EXT4

If it appears:

EXT4-fs (sda1): mounted filesystem without journal

Description The setting was successful.

It turns out to be: mounted filesystem with ordered data mode

If you need to enable logging again, just run tune2fs -O has_journal /dev/sda1.

2. Turn on the TRIM function

TRIM is a way for the operating system to schedule SSD block writes. Mainly because the flash memory unit of the same SSD will wear out frequently, affecting the service life, and it is different from the traditional mechanical hard disk to process and delete data. The Linux kernel supports TRIM since 2.6.33.

First, check if the kernel version supports TRIM:

uname -a

Then, check if the SSD hard disk supports TRIM:

hdparm -I /dev /sda

If the display is like (different hardware may have different prompts):

* Data Set Management TRIM supported

Description Support.

These two conditions are met. In /etc/fstab:

/dev/sda1 /ext4 defaults is changed to:

/dev/sda1 /ext4 discard The defaults partition, mount point, and existing options are not necessarily the same.
Previous12Next Total 2 Pages

Copyright © Windows knowledge All Rights Reserved