Questions about Defragging or Antivirus? Look here first!

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: Questions about Defragging or Antivirus? Look here first

Post by powerhouse »

ImpliedConsent wrote:Question about defrag and SSDs: since W7, the defrag option has been turned off (default) of the drive containing an SSD. I'm pretty sure that the reason is so TRIM and GC collection won't be in conflict with a defrag operation. Is this potentially the same with LM (currently running 'Petra' 32)? My LM install is on an old-old laptop with a MHDD - but when I get home - I plan on rebuilding a PC with LM16 64bit on an SSD sda. I guess I'm more curious about TRIM and GC of an SSD v. defrag.
You should never defrag an SSD !!! Not only does it nothing to improve performance or disk usage, it actually harms your SSD and can severely reduce its life time.

I could go into some lengthy explanation about how data is stored, managed/indexed, and deleted on an SSD, but let's just say it's totally different from conventional disks that divide its storage into disk platters, cylinders, and sectors. Moreover, SSDs have a finite number of writes per storage unit, after which the storage unit cannot be used anymore. This is why defragmentation to SSDs is harmful.

In general, modern Linux distros like Linux Mint 13... are well aware of SSDs and their requirements (e.g. boundary alignment) and will do most of the setup right without user interference. You may want to add noatime to your /etc/fstab entry for your SSD. For more on that see the link below.

EDIT: Here the link to the SSD howto: http://forums.linuxmint.com/viewtopic.php?f=42&t=112450
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
ImpliedConsent

Re: Questions about Defragging or Antivirus? Look here first

Post by ImpliedConsent »

powerhouse wrote:You should never defrag an SSD !!! Not only does it nothing to improve performance or disk usage, it actually harms your SSD and can severely reduce its life time.
Oh, I wasn't asking whether an SSD needs to be defrag or not - and said as much and am aware of the wear levels - my question is more geared to TRIM support on LM. I know the kernal supports TRIM - but does LM automatically enable it for background GC? My comment on defrag was more a comparison with W7+ being turned off by default when the drive reports itself to the OS as an SSD. Does this also happen in LM?
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: Questions about Defragging or Antivirus? Look here first

Post by powerhouse »

ImpliedConsent wrote:
powerhouse wrote:You should never defrag an SSD !!! Not only does it nothing to improve performance or disk usage, it actually harms your SSD and can severely reduce its life time.
Oh, I wasn't asking whether an SSD needs to be defrag or not - and said as much and am aware of the wear levels - my question is more geared to TRIM support on LM. I know the kernal supports TRIM - but does LM automatically enable it for background GC? My comment on defrag was more a comparison with W7+ being turned off by default when the drive reports itself to the OS as an SSD. Does this also happen in LM?
I suggest you check the link I posted. Here is my /etc/fstab configuration for reference:

Code: Select all

# /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>
proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/mapper/lm16-root /               ext4    noatime,nodiratime,discard,errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
/dev/sda1 /boot           ext2    defaults,noatime,nodiratime        0       2
/dev/mapper/lm16-home /home           ext4    noatime,nodiratime,discard,defaults        0       2
# /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>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# My SSD has /dev/sda1, and several LVM volumes:
/dev/mapper/lm16-root /               ext4    noatime,nodiratime,discard,errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
/dev/sda1    /boot           ext2    defaults,noatime,nodiratime        0       2
/dev/mapper/lm16-home /home           ext4    noatime,nodiratime,discard,defaults        0       2

# Regular HDD:
# lm16-data on /dev/sdb1 as /home/<user name>/data
/dev/mapper/lm16-data       /home/<user name>/data		ext4	errors=remount-ro	0 1
/dev/mapper/lm16-swap none            swap    sw              0       0

#force temporary files to be stored in memory instead of on disk
none /tmp     tmpfs nodev,nosuid,mode=1777 0 0
none /var/tmp tmpfs nodev,nosuid,mode=1777 0 0
For ext2 partitions it's: ext2 defaults,noatime,nodiratime

For ext3 or ext4 partitions: ext4 noatime,nodiratime,discard,defaults

"discard" activates the trim function. It is quite possible that this is done automatically with modern Linux distributions, but I don't know for sure.

"noatime" prevents Linux to write the access time to the file, which greatly reduces write access on SSDs. "nodiratime" is the same for directories, but "noatime" implies "nodiratime" so it's actually not required. But it won't harm.

The swap partition resides on a regular HDD !

Another important part is setting up a virtual tmp file system in memory for /tmp and /var/tmp


And here the relevant line in /etc/default/grub file:

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT="profile elevator=deadline"
This defines the scheduler to be used. Not sure this makes a big difference.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: Questions about Defragging or Antivirus? Look here first

Post by powerhouse »

ImpliedConsent wrote:...My comment on defrag was more a comparison with W7+ being turned off by default when the drive reports itself to the OS as an SSD. Does this also happen in LM?
Linux doesn't use defrag, not even on regular HDDs. It's usually not needed on Linux file systems like ext2, ext3, or ext4. fsck just checks the file system and - in case there are errors or inconsistencies - it tries to fix them.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
mbutterman

Re: Questions about Defragging or Antivirus? Look here first

Post by mbutterman »

Thanks for the info Kaye. A lot of good info for the beginner or the otherwise curious
M
andrew-lohmann
Level 1
Level 1
Posts: 15
Joined: Sat Jan 25, 2014 12:42 pm
Location: Tunbridge Wells, Kent, UK
Contact:

Re: Questions about Defragging or Antivirus? Look here first

Post by andrew-lohmann »

I think you need to be careful to not say that a windows virus will not run on a Linux machine. The arguement about Windows is that it has loopholes built in by act of US government But because Linux is a comunity project people would find out about those built in vunerabilites.

There are a number of programming languages and scripts that are common to many operating systems for example Java, Flash and native i8086 machine code. There is a possible of vunerability.

Although Linux is open source do you really think all of the source files have been read through or that just the complied object has been trusted and used? Even if that has happend it does not follow that what has been discovered is widely known? Windows 95 is crippled in a way that netscape runs more slowly than IE but netscape lost the arguement in court. The crippling can easily be tested and observed evenso.

In 2000 you did not need a virus scanner. I did not use one and my computer has been attacked but I have sorted it. It is quite possible that there are more web enabled Linux machines now than there were web enabled Windows machines in 2000. Linux users are not safe because they are a small comunity because they are not a small comunity any more.
Electronics Engineer,
Living in; South East, England.
Running; Linux Mint Cinnamon, Debian Cinnamon & Windows 10 32 bit.
My PCs are; old laptops and a desktop. These run Windows 7 or 10, various Debian's, Ubuntu's and Mint Cinnamon.
hal8000
Level 4
Level 4
Posts: 436
Joined: Sun May 04, 2008 2:04 pm
Location: UK

Re: Questions about Defragging or Antivirus? Look here first

Post by hal8000 »

andrew-lohmann wrote:
Although Linux is open source do you really think all of the source files have been read through or that just the complied object has been trusted and used?
If you download files from a distributions repository then you are absolutely 100% safe and of course all the source code has been read.

If however, you decide to download and install 3rd party software there is always a chance that the source code may have been compromised. Although linux viruses
were created in a lab as "proof of concept" none exist on the internet. There is always a chance of a rootkit so its a good idea for everyone to install rootkit hunter
and run a periodic scan, maybe once a month.
To install

Code: Select all

sudo apt-get install rkhunter
To check

Code: Select all

sudo rkhunter --update

Code: Select all

sudo rkhunter -c
andrew-lohmann
Level 1
Level 1
Posts: 15
Joined: Sat Jan 25, 2014 12:42 pm
Location: Tunbridge Wells, Kent, UK
Contact:

Re: Questions about Defragging or Antivirus? Look here first

Post by andrew-lohmann »

Thanks Hal

It is often what we, humans, do than what the computer has alledgely done that is the problem.
Electronics Engineer,
Living in; South East, England.
Running; Linux Mint Cinnamon, Debian Cinnamon & Windows 10 32 bit.
My PCs are; old laptops and a desktop. These run Windows 7 or 10, various Debian's, Ubuntu's and Mint Cinnamon.
mrushton

Re: Questions about Defragging or Antivirus? Look here first

Post by mrushton »

Does ClamAV come with Linux Mint or do you have to download it ? I can't find it on my desktop.

Is there any other AV for Linux Mint that you can recommend or point me to ?

Of course in the Windows world you you never think of running Windows *without* some kind of AV software.
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: Questions about Defragging or Antivirus? Look here first

Post by powerhouse »

mrushton wrote:Does ClamAV come with Linux Mint or do you have to download it ? I can't find it on my desktop.

Is there any other AV for Linux Mint that you can recommend or point me to ?

Of course in the Windows world you you never think of running Windows *without* some kind of AV software.
Unless you want to detect Windows viruses in emails, I can't see much use of ClamAV, or any other anti-virus software under Linux. Anti virus software under Linux was developed to filter Windows viruses, for example when you run a mail server on Linux and have Windows users accessing the mail server. If you install Linux for desktop/notebook use, forget about anti-virus software.

As said before, if you install software exclusively via the software manager / package manager, the chances of catching a virus are next to nil.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
martin tudor

Re: Questions about Defragging or Antivirus? Look here first

Post by martin tudor »

I need a script to run via Tampermonkey for a game I play. Is that safe?
User avatar
catilley1092
Level 1
Level 1
Posts: 44
Joined: Tue Mar 08, 2011 12:51 pm

Re: Questions about Defragging or Antivirus? Look here first

Post by catilley1092 »

ClamTK is a reliable AV for Mint & updates/scans can be scheduled. Scans will find browser objects and any possible malicious downloaded software. Any objects found should be quarantined for safety, rather than directly deleted.

rkhunter & chkrootkit are good for finding rootkits.

Linux Mint runs perfectly fine on SSD's & TRIM works if setup properly, these instructions can be found on this forum. Leave 10% of the SSD at the end unpartitioned for overprovisioning. This prevents overfilling of the SSD & will extend it's life. When a firmware update is needed, download the CD (ISO) version & boot from that CD to update the firmware. The .exe firmware update option is for Windows users. Be sure to backup the install beforehand & make sure that instructions are followed. Perform this task on AC power, not from battery.

Cat
Proud Linux Mint user since 2009
gastrof

Re: Questions about Defragging or Antivirus? Look here first

Post by gastrof »

I tried to get Avast for Linux, based on someone's YouTube video.

The Avast website apparently has changed and there's no mention there of Linux, and the download button takes you to CNET, which also says nothing about LInux.

Blah. :x

I tried to install Comodo, but it said it only goes up to Linux Mint 13, and mine is 16 (Cinnamon).

The installation kept hanging up, kept reporting something was missing and I had to manually add it, but the attempt to kept failing...

I would like to have something to protect the computer, just in case someone comes up with a Linux virus, and also to squelch any Windows viruses it might end up being a "carrier" for, since I do interact with people who have Windows machines.

Can anyone make any other suggestions? "Clam TK". What is that and where can I find it?
WinterTroubles

Re: Questions about Defragging or Antivirus? Look here first

Post by WinterTroubles »

Hi gastrof

Clamtk is the Graphical User Interface (GUI) package for clamav, it comes complete with both the interface (clamtk) and the actual antivirus package (clamav). It's an anti virus scanner available through the software manager on mint and once installed can be set to scan for viruses/malware automatically or simply used to perform manual scans. It doesn't offer 'live' protection as you maybe used to on windows, but, as mentioned elsewhere in this topic that's not necessary at the moment on linux home systems and even without it you are still far safer than than with 'live' virus protection on windows (assuming you follow the advice about safe behaviour online).

I currently use clamtk/clamav along with the standard safe online behaviour advice and find it easy to use... That said, so far I've not managed to download anything unsavoury enough for it to detect :lol:

Hope this helps :)
gastrof

Re: Questions about Defragging or Antivirus? Look here first

Post by gastrof »

WinterTroubles wrote:Hi gastrof

Clamtk is the Graphical User Interface (GUI) package for clamav, it comes complete with both the interface (clamtk) and the actual antivirus package (clamav). It's an anti virus scanner available through the software manager on mint and once installed can be set to scan for viruses/malware automatically or simply used to perform manual scans. It doesn't offer 'live' protection as you maybe used to on windows, but, as mentioned elsewhere in this topic that's not necessary at the moment on linux home systems and even without it you are still far safer than than with 'live' virus protection on windows (assuming you follow the advice about safe behaviour online).

I currently use clamtk/clamav along with the standard safe online behaviour advice and find it easy to use... That said, so far I've not managed to download anything unsavoury enough for it to detect :lol:

Hope this helps :)
Can you direct me to a safe source to get Clamtk from?
eanfrid

Re: Questions about Defragging or Antivirus? Look here first

Post by eanfrid »

Something like

Code: Select all

sudo apt-get install clamtk
?
WinterTroubles

Re: Questions about Defragging or Antivirus? Look here first

Post by WinterTroubles »

As eanfrid said or if your on mint you'll also find it in the software manager :)
killer de bug

Re: Questions about Defragging or Antivirus? Look here first

Post by killer de bug »

Image
Tim_Olaguna

Re: Questions about Defragging or Antivirus? Look here first

Post by Tim_Olaguna »

optimize me wrote:
Kaye wrote:Haha, or something. Nice sig by the way :lol:

I really wrote this in hope that it would get stickied so that we wouldn't have to keep droning on about how they really don't need the things they were used to in Windows. It was just getting old.
Yeah, lately I find myself loosing my cool when it comes to that.

I was a n00b once myself, as were we all. But these darned kids today.. they're just hopeless.

And I wish they'd stay off my lawn.
Uh, watch your eagerness to assume. Once in awhile one of us "kids" are 65 year old "noobs".
millpond
Level 3
Level 3
Posts: 178
Joined: Tue Jan 31, 2012 6:34 pm

Re: Questions about Defragging or Antivirus? Look here first

Post by millpond »

One of the more common arguments I see is that the only reason Linux hasnot been attacked by malware is that it does not have the critical mass to attract the scummers.

However, nothing could be further from the truth.

Linux is an absolute prime target for *any* malicious hacker as that is what the major servers of the net and industry are based on. Amazon, ebay, apparently PayPal - all are on Linux servers. But exploits are rather uncommon. Even when running as root.

The problem with Win is that it was designed with backdoors, with a software programmable firewall, and remote functions turned on by default.
AV software is really useless, as the good boogers are designed by testing against ALL the bloody scanners at virustotal.com before release.
Its probably a good idea to assume that all Win machines are infected to some degree, especially when the basic OS itself is designed as a virus. Just try removing IE.

I have over a GB of programs that I *know* are infected (I can see them come alive in a sandbox) but which are undetectable by scanners.

AV software is a waste of time and space for the most part.
And useless for the few exploits such as Heartbleed, which mostly rely on buffer overflows.
Locked

Return to “Beginner Questions”