Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
until   the buffer  is  full,   until   the kernel  tells   it  to, or  if  you tell    it  to  by  using
the sync command. Traditionally, the command is given twice, as in the
following example:

Click here to view code image
matthew@seymour:~$ sync ; sync


To  do  it  twice   is  overkill.   Still,  it  can be  helpful before  the unmounting  of
certain types of media with slow write speeds (such as some USB hard
drives or PCMCIA storage media)—but only because it delays the user
from attempting to remove the media too soon rather than because two
syncs are better than one.

The tune2fs Command


With tune2fs, you can adjust the tunable file system parameters on an
ext2, ext3, or ext4 file system. A few performance-related items of note
are as follows:


    To  disable file    system  checking,   the -c  0   option  sets    the maximal
mount count to zero.
The interval between forced checks can be adjusted with the -i option.
The -m option sets the reserved blocks percentage with a lower value,
freeing more space at the expense of fsck having less space to write
any recovered files.
Decrease the number of superblocks to save space with the -O
sparse_super option. (Modern file systems use this by default.)
Always run e2fsck after you change this value.
More space can be freed with the -r option, which sets the number of
reserved (for root) blocks.

Note that most of these uses of tune2fs free up space on the drive at the
expense of the capability of fsck to recover data. Unless you really need the
space and can deal with the consequences, just accept the defaults; large
drives are now relatively inexpensive.


The e2fsck Command


The e2fsck utility checks an ext2/ext3/ext4 file system. Some useful
arguments taken from man e2fsck are as follows:

Free download pdf