![]() |
Fast disk I/O with ext4 HOWTO - Printable Version +- Linux Lite Forums (https://www.linuxliteos.com/forums) +-- Forum: Software - Support (https://www.linuxliteos.com/forums/forumdisplay.php?fid=5) +--- Forum: Tutorials (https://www.linuxliteos.com/forums/forumdisplay.php?fid=21) +--- Thread: Fast disk I/O with ext4 HOWTO (/showthread.php?tid=5397) |
Fast disk I/O with ext4 HOWTO - kpanic - 06-18-2018 We all know, that Linux Lite is very fast Operating System and does not require modern hardware. To get even more speed out of the system, there are very many tuning possibilities and one of them is tuning some basic disk input/output operations. This short HOWTO is for those users who use ext4 filesystem but there are many possibilities for those users who use other filesystems too and if I have time, I will try to write more later. One of the easiest ways to get more speed out of your disks is tuning the mount options. This can be done by editing the /etc/fstab file. You can see which options are currently in use by commanding (in Terminal window) Code: mount | grep ext4 Not all of the options applied are visible this way but I'm sure you got the idea. You may try these options first before applying them to the /etc/fstab file. If you have more than one partitions, for example a separate /boot or /home partition, then you may as well try using one of them first. For example, let's assume that you have a separate /home partition in device /dev/sda2. Then you may try this ( and this is SAFE if you do exactly as I tell here. And use the correct device name and don't make typos ![]() (To find out which device name is your /home, just examine the output of that 'mount | grep ext4' command). First enter a root session, so that you don't have to type 'sudo' all the time. So, command: Code: sudo su Then unmount the /home partition ( if it is /dev/sda2 ) by commanding: Code: umount /dev/sda2 And now the speed-UP! Code: mount -t ext4 -o defaults,noiversion,auto_da_alloc,noatime,\ Note that I could not write the whole command to just one line, so there is a '\' character, which tells the shell, that the command will continue on the next line. If everything went fine and you did not receive any messages, you may check the dmesg output like this: Code: dmesg | tail -4 To mount your /home back with the defaults, command: Code: umount /home && mount /home 2>&1 Of course this did not demonstrate how it actually speeds up reading and writing to disk but you may take time to copy your /home full of files using the default mount options and the tuned options if you like to. However these kinds of tunings show their full power just when they are applied to everyday use and especially to the / partition - since the root partition is read and written most of the time. Please don't expect too much, this (and similar methods) won't turn your ol'PC to a super-computer ![]() But you may see some difference after using the system for a while. To apply these settings to your /etc/fstab, you need to edit that file and I suggest that you create a backup copy of the file first: Code: cp /etc/fstab /etc/fstab.bak Then open your /etc/fstab with a text editor (nano /etc/fstab) and replace the old options, which are between the text 'ext4' and the two numbers in the end. Here is an example from my /etc/fstab (The / partition entry) # / was on /dev/sda2 during installation UUID=1e6ae380-25c3-40dc-b7ea-39d82488615a / ext4 Code: defaults,noiversion,auto_da_alloc,acl,user_xattr,noatime,errors=remount-ro,commit=20,inode_readahead_blks=64,delalloc DO NOT APPLY these options into any others entries than ext4 !! (Other filesystems have other mount options). And every entry must remain in ONE line! Lines beginning with a '#' character don't matter. You may write anything on those lines. Again, it is just one line, but it broke to many when I wrote it here... But as you see, the mount options are between the text 'ext4' and the two numbers in the end of the line. When these options are written to the fstab file, they won't take effect until the filesystem is unmounted and remounted again (or just remounted or just rebooted the computer). WARNING: I cannot take responsibility of any data loss or similar. This small HOWTO is written for those, who either have just made a fresh installation of Linux Lite and want to try this without loosing more than maybe a new fresh installation. Or for those who can take responsibility of their own typos and/or other mistakes. These are everyday actions for system administrators and there is no 'magic' involved. And by the way, nothing is free when it comes to performance and/or memory usage. These mount options may use a bit more RAM memory but as you know, RAM is much faster than disk - so in my opinion it is a fair deal if there is some extra RAM which just sits there unused during everyday use of the computer. Have fun - and please ask if you have questions.. Re: Fast disk I/O with ext4 HOWTO - Moltke - 06-19-2018 Hi [member=7701]kpanic[/member] First of all, very nice post! ![]() Re: Fast disk I/O with ext4 HOWTO - kpanic - 06-20-2018 [member=7109]Moltke[/member] , thanks! I use these options with both hdd and ssd, except that with ssd, I use option 'discard' also, so that trim is enabled. Works with USB too, so you can test with one first ![]() |