LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 07-24-2017, 07:51 PM   #1
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Rep: Reputation: Disabled
System running very slowly – defrag?


Over the past two weeks I have noticed Mint slowing down. It has got to the stage now Mint is so slow, it takes a long time to start up and running any programs take a very long time to open – Thunderbird, Firefox, Libre Office Writer, to name a few.

I’m having to post this from Windows as Mint is almost unusable. When I’m typing in Mint, sometimes I have to wait while the text on the screen catches up with what I’ve already typed on the keyboard – does that makes sense?

I thought perhaps I needed to defrag the drive, as on Windows I have done before.
I googled ‘defrag linux mint’ which gave conflicting results. Some said it wasn’t necessary at all as Linux was smarter than Windows. Others that told you how to run a defrag program.
Then it went on to say how dangerous it could be to defrag a disk that wasn’t unmounted? That’s when it lost me, I have absolutely no understanding of mounted or unmounted. It sounds like something you do with a picture on the wall.

The defrag program it suggested was e4defrag, but that has to run from terminal. If I do need to defrag, is there a gui option? I really am very uncomfortable using terminal, I just don’t understand one bit what I’m doing in there.

Perhaps there are some other checks I need to do which might show why Mint is running so slow?

If anyone does respond, could you please keep any technical talk to almost zero, I’m not good on that. Thanks.
 
Old 07-24-2017, 08:04 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,360
Blog Entries: 28

Rep: Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148
Defragging probably won't help. Modern Linux file systems manage fragmentation very nicely on the fly; there is always some fragmentation on any file system, but it should not be an issue if you are using a contemporary ext3 or ext4 of a more recent Linux file system. Partially because of this, I am not aware of any GUI defragmentation tools for Linux, though there may be some out there somewhere.

Do you recall what file system you chose at time of install? (If not, the command

Code:
cat /etc/fstab
will display that information).

You can use a tool such as top or htop to see what applications are soaking up your CPU cycles. Open it in a terminal, check the readings, tuck it off to the side, and, as the machine slows down, see what's changed.

You can also save the output to a file with a command such as

Code:
top > [somefilename]
Note that, if you do that, the output of top will not appear in the terminal, as it will be redirected to [somefile].

If would also help to know the make/model of the computer, the CPU type, the amount or RAM, and the desktop environment (e. g., MATE, Cinnamon) you are using. Also, did you make any significant changes to the machine (e. g., install any programs) about the time this started?

Last edited by frankbell; 07-24-2017 at 08:10 PM.
 
1 members found this post helpful.
Old 07-24-2017, 08:15 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,145

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
That will run forever. Rather than that, open a terminal and run this - it will run for about 10 seconds and create a condensed version of the output in a file top.txt. Post that file here
Code:
 top -b -n 3 | grep -A 20 -E "^top" > top.txt
 
1 members found this post helpful.
Old 07-24-2017, 09:15 PM   #4
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post
Defragging probably won't help. Modern Linux file systems manage fragmentation very nicely on the fly; there is always some fragmentation on any file system, but it should not be an issue if you are using a contemporary ext3 or ext4 of a more recent Linux file system. Partially because of this, I am not aware of any GUI defragmentation tools for Linux, though there may be some out there somewhere.

Do you recall what file system you chose at time of install? (If not, the command

Code:
cat /etc/fstab
will display that information).

You can use a tool such as top or htop to see what applications are soaking up your CPU cycles. Open it in a terminal, check the readings, tuck it off to the side, and, as the machine slows down, see what's changed.

You can also save the output to a file with a command such as

Code:
top > [somefilename]
Note that, if you do that, the output of top will not appear in the terminal, as it will be redirected to [somefile].

If would also help to know the make/model of the computer, the CPU type, the amount or RAM, and the desktop environment (e. g., MATE, Cinnamon) you are using. Also, did you make any significant changes to the machine (e. g., install any programs) about the time this started?

OK, this is the result, whatever all the goobledegook means:
Code:
~ $ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=fc8ebdee-1c9b-4c3f-979d-6c83f11d534d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda7 during installation
UUID=1e6c4cf2-5e03-49b0-9d23-ffe3b8ea8681 none            swap    sw              0       0
UUID=B03AFBF43AFBB606 /media/watt/Data ntfs rw,auto,users,exec,nls=utf8,umask=003,gid=1000,uid=1000 0 0
I'm running Mint 18.1 Cinnamon 64-bit. I thought that was visible to users, below my name?
As suggested by syg00, I also ran:
Code:
~ $ top -b -n 3 | grep -A 20 -E "^top" > top.txt
I have no idea how to find the file it produced?
 
Old 07-24-2017, 09:23 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,145

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Issue "ls" (no quotes) - similar to a "dir" command under a DOS session. The GUI file manager should show it in the default view I would imagine.
 
1 members found this post helpful.
Old 07-24-2017, 09:25 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,008

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
Go to a terminal and type in the command top just to see what the usage is. Escape key will return you to terminal.

I'd look at df -h command too.

Also might help to look at memory amount.

Last edited by jefro; 07-24-2017 at 09:38 PM.
 
Old 07-24-2017, 09:34 PM   #7
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by syg00 View Post
Issue "ls" (no quotes) - similar to a "dir" command under a DOS session. The GUI file manager should show it in the default view I would imagine.
The result:
Code:
~ $ ls
Desktop    ewan-calendar-files-linux  Pictures   Thai               usr
Documents  fwbackups                  Public     top.txt            Videos
Downloads  Music                      Templates  tor
I looked in the folder Public, but it appears to be empty.
"top.txt" is shown in white text, whereas all the rest are in blue.
 
Old 07-24-2017, 09:38 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,360
Blog Entries: 28

Rep: Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148
Quote:
I have no idea how to find the file it produced?
It's probably in your home directory. If you open your file manager, it should be there. You can click on it and open it.

Otherwise, try

Code:
locate top.txt
Then point a text editor at the path to that file.

Last edited by frankbell; 07-24-2017 at 09:40 PM.
 
1 members found this post helpful.
Old 07-24-2017, 09:41 PM   #9
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post
It's probably in your home directory. If you open your file manager, it should be there. You can click on it and open it.

Otherwise, try

Code:
locate top.txt
Then point a text editor at the path to that file.
Code:
locate top.txt
produces nothing at all.
 
Old 07-24-2017, 09:44 PM   #10
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,360
Blog Entries: 28

Rep: Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148
For locate to work, you may have to issue, as root, the command

Code:
updatedb
to ensure that the locate database is up-to-date.
 
Old 07-24-2017, 09:45 PM   #11
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Right, I've just looked in the Home folder, and it is in there. I don't know why the other commands didn't seem to find it.
Here's the result of top.txt:

Code:
top - 09:10:24 up 23 min,  1 user,  load average: 0.28, 0.43, 0.49
Tasks: 200 total,   2 running, 198 sleeping,   0 stopped,   0 zombie
%Cpu(s):  9.3 us,  1.5 sy,  0.1 ni, 83.2 id,  5.9 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem : 12153548 total,  8539964 free,  1393604 used,  2219980 buff/cache
KiB Swap: 12428284 total, 12428284 free,        0 used. 10263012 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 2828 watt      20   0 2433052 547752 111164 R 106.7  4.5   5:24.79 firefox
 2285 watt      20   0 1479472 173080  55296 S   6.7  1.4   0:35.67 qbittorrent
    1 root      20   0  185272   5960   4040 S   0.0  0.0   0:01.81 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd
    3 root      20   0       0      0      0 S   0.0  0.0   0:00.01 ksoftirqd/0
    4 root      20   0       0      0      0 S   0.0  0.0   0:00.03 kworker/0:0
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+
    7 root      20   0       0      0      0 S   0.0  0.0   0:02.41 rcu_sched
    8 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh
    9 root      rt   0       0      0      0 S   0.0  0.0   0:00.01 migration/0
   10 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 watchdog/0
   11 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 watchdog/1
   12 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/1
   13 root      20   0       0      0      0 S   0.0  0.0   0:00.04 ksoftirqd/1
--
top - 09:10:27 up 23 min,  1 user,  load average: 0.58, 0.49, 0.51
Tasks: 200 total,   2 running, 198 sleeping,   0 stopped,   0 zombie
%Cpu(s): 20.4 us,  1.0 sy,  0.0 ni, 70.5 id,  7.9 wa,  0.0 hi,  0.2 si,  0.0 st
KiB Mem : 12153548 total,  8517840 free,  1405300 used,  2230408 buff/cache
KiB Swap: 12428284 total, 12428284 free,        0 used. 10251340 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 2828 watt      20   0 2438172 558720 111164 R  78.1  4.6   5:27.15 firefox
 2285 watt      20   0 1479472 173080  55296 S   6.0  1.4   0:35.85 qbittorrent
 2265 watt      20   0 1801840 153480  57272 S   2.0  1.3   1:16.52 cinnamon
 1623 root      20   0  412560 100044  86920 S   0.7  0.8   0:47.99 Xorg
  648 root      20   0   12796   2556   1896 D   0.3  0.0   0:00.91 mount.ntfs
 2486 watt      20   0 2677784 528028 123444 S   0.3  4.3   1:22.85 thunderbird
 4674 watt      20   0  494496  36608  28188 S   0.3  0.3   0:01.18 gnome-term+
 4942 watt      20   0   41928   3788   3224 R   0.3  0.0   0:00.01 top
    1 root      20   0  185272   5960   4040 S   0.0  0.0   0:01.81 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd
    3 root      20   0       0      0      0 S   0.0  0.0   0:00.01 ksoftirqd/0
    4 root      20   0       0      0      0 S   0.0  0.0   0:00.03 kworker/0:0
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+
    7 root      20   0       0      0      0 S   0.0  0.0   0:02.41 rcu_sched
--
top - 09:10:30 up 23 min,  1 user,  load average: 0.58, 0.49, 0.51
Tasks: 200 total,   2 running, 198 sleeping,   0 stopped,   0 zombie
%Cpu(s): 18.6 us,  1.2 sy,  0.0 ni, 75.3 id,  4.8 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem : 12153548 total,  8508564 free,  1403968 used,  2241016 buff/cache
KiB Swap: 12428284 total, 12428284 free,        0 used. 10253656 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 2828 watt      20   0 2438172 556164 111164 R  72.7  4.6   5:29.33 firefox
 2285 watt      20   0 1479472 173080  55296 S   7.0  1.4   0:36.06 qbittorrent
 2265 watt      20   0 1801840 153492  57272 S   2.0  1.3   1:16.58 cinnamon
 1623 root      20   0  412560 100044  86920 S   0.7  0.8   0:48.01 Xorg
    7 root      20   0       0      0      0 S   0.3  0.0   0:02.42 rcu_sched
  648 root      20   0   12796   2556   1896 S   0.3  0.0   0:00.92 mount.ntfs
 4942 watt      20   0   41928   3788   3224 R   0.3  0.0   0:00.02 top
    1 root      20   0  185272   5960   4040 S   0.0  0.0   0:01.81 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd
    3 root      20   0       0      0      0 S   0.0  0.0   0:00.01 ksoftirqd/0
    4 root      20   0       0      0      0 S   0.0  0.0   0:00.03 kworker/0:0
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+
    8 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh
    9 root      rt   0       0      0      0 S   0.0  0.0   0:00.01 migration/0

Last edited by paxolin; 07-25-2017 at 12:36 AM.
 
Old 07-24-2017, 09:49 PM   #12
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
I've just tried that command, but it seemed to fail:

Code:
 $ updatedb
updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db'
 
Old 07-24-2017, 10:29 PM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,145

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Any time something like that fails, or you get a permission issue, prepend "sudo " - that gives you temporary access to just about everything. It will ask for your (logon) password.
Code:
sudo updatedb
Note you can (and should) post output in [code] tags to retain the layout - you can edit that post above to add them.

Looking at that, firefox is the bad boy - try shutting that down and see if things improve. Small amout of wait for disk as well - probably that torrent causing that.
 
Old 07-25-2017, 12:35 AM   #14
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Any time something like that fails, or you get a permission issue, prepend "sudo " - that gives you temporary access to just about everything. It will ask for your (logon) password.
Code:
sudo updatedb
Note you can (and should) post output in [code] tags to retain the layout - you can edit that post above to add them.

Looking at that, firefox is the bad boy - try shutting that down and see if things improve. Small amout of wait for disk as well - probably that torrent causing that.
Thanks for replying again.
It asked me for my password, but still didn't appear to do anything?
Code:
 ~ $ sudo updatedb
[sudo] password for watt: 
watt@PCMint ~ $
I do normally put pasted text from terminal in [code] tags. I didn't this time as it was from a text file. Perhaps I'm just too pedantic?
I'll try closing Firefox and see what happens, thanks.
 
Old 07-25-2017, 01:08 AM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,145

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Updatedb does as it says - updates the database of filenames. To search for a name in that database, use "locate" as above.
There is a help system called man (manuals) - so "man updatedb" will give info on the command. A little terse in this case. It also has a "see also" to direct you elsewhere. Use "q" to quit - this is the common way to exit terminal commands.

Edit: updatedb only needs to be rerun to pick up new/deleted files. I run it when I remember; say every couple of weeks. It used to thrash the I/O system and system cache, but is better these days - still has an effect on the system tho'.

Last edited by syg00; 07-25-2017 at 01:11 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] My system is running extremely slowly. No idea what happened. ahc_fan Slackware 22 06-29-2016 07:32 PM
LXer: How to defrag your Linux system LXer Syndicated Linux News 0 06-15-2015 03:41 PM
Everything is running slowly... Doolspin Linux - Hardware 3 02-02-2006 10:06 AM
Defrag using a Linux system CrimZon Linux - Newbie 6 03-28-2004 10:10 PM
defrag causes mandrake to wipe out system dick19272000 Linux - General 1 02-17-2002 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 04:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration