Questions about Defragging or Antivirus? Look here first!
Posted: Mon Aug 24, 2009 6:17 pm
Hello newbies,
After noticing a flood of new threads involving viruses/antiviruses, defragmentation, security, etc, I decided it would be a good idea to whip up a concise (and simple) explanation of why the security/performance measures you're used to taking on Windows are simply not needed in Linux. The two most popular questions I've seen are antiviruses and defragging, so those are the two I'll concentrate on.
The short answer for a normal home user who doesn't want to read any more: neither defragging nor antivirus programs are necessary on a Linux machine. Read below for more!
Defragging
So what does defragging mean anyway? While you're using a computer, creating and deleting files, moving information, and generally just changing things, the data in your filesystem can become separated, leaving blank spaces on your hard drive. These separate pieces of data are called "fragments," and the problem with them is that they make the blank spaces basically inaccessible. When you talk about "defragging" in Windows, you're actually talking about compressing the fragments in your filesystem. Windows uses a filesystem called NTFS, while Linux (for the most part) uses a different filesystem called ext3. To put it simply, ext3 does not have the same fragmentation issues that NTFS has simply by its design. If you installed a Linux distro with an NTFS filesystem, it would have the same fragmentation problems as Windows. So it isn't necessarily Linux that prevents fragmentation, it's actually the filesystem underneath the system. Because of this, if you installed Linux using the default filesystem (ext3), you will not have to defrag the disk like you did in Windows! For more on fragmentation (and the difference between Linux and Windows in that respect), see this article: Why doesn't Linux need defragmenting?
Note: linuxviolin made a good point in response to this thread. All filesystems (even ext3) will fragment after enough use and could eventually need defragmenting. Although this defragging would be very occasional, and not something you would have to worry about when starting out on Linux, it may want to be something you consider in the future. Personally, I've been running Linux for seven months and haven't even thought about defragging yet.
And on to part 2...
Antivirus
Straight from a former newbie, this a great way to think about the issue in my opinion:
All of this being said, it is possible to expose your Linux system to outside threats, if you try hard enough. No operating system is invincible, but as long as you take common-sense precautions, you'll have no problems with viruses. For more info, here's another article: Linux vs. Windows Viruses
Important: Although Linux is very resistant to viruses, it is not resistant at all to user input. The implication of this is that you should always have some idea of what you're doing before you do it. Sometimes a malevolent user will post something you don't understand, toting it as a "script" that'll solve some problem or improve some functionality. For example, if you're browsing the web for whatever reason, and you come across a script like this:
Absolutely do NOT run it without first finding out what it does. That specific snippet will initiate an attack called a "forkbomb", causing infinite recursion and meaning you'll have to reboot (ie. you'll lose anything you were doing when you ran the code). People can be nasty, don't trust everything you see on the Internet.
Also important: Despite what I said above, there are some nefarious methods that will work on both Linux and Windows, the most prominent of them being JavaScript attacks through Firefox. I've never heard of a JavaScript attack causing a huge system-wide problem, but they can cause big problems with your browser. The good news is that JavaScript is very easy to avoid! When you first run Firefox, go to Tools -> Add-ons, search for NoScript, and install it. With NoScript, these cross-platform JavaScript attacks will never be able to make it through to your browser. Yay! Some more notes on JavaScript from a helpful guru:
After noticing a flood of new threads involving viruses/antiviruses, defragmentation, security, etc, I decided it would be a good idea to whip up a concise (and simple) explanation of why the security/performance measures you're used to taking on Windows are simply not needed in Linux. The two most popular questions I've seen are antiviruses and defragging, so those are the two I'll concentrate on.
The short answer for a normal home user who doesn't want to read any more: neither defragging nor antivirus programs are necessary on a Linux machine. Read below for more!
Defragging
So what does defragging mean anyway? While you're using a computer, creating and deleting files, moving information, and generally just changing things, the data in your filesystem can become separated, leaving blank spaces on your hard drive. These separate pieces of data are called "fragments," and the problem with them is that they make the blank spaces basically inaccessible. When you talk about "defragging" in Windows, you're actually talking about compressing the fragments in your filesystem. Windows uses a filesystem called NTFS, while Linux (for the most part) uses a different filesystem called ext3. To put it simply, ext3 does not have the same fragmentation issues that NTFS has simply by its design. If you installed a Linux distro with an NTFS filesystem, it would have the same fragmentation problems as Windows. So it isn't necessarily Linux that prevents fragmentation, it's actually the filesystem underneath the system. Because of this, if you installed Linux using the default filesystem (ext3), you will not have to defrag the disk like you did in Windows! For more on fragmentation (and the difference between Linux and Windows in that respect), see this article: Why doesn't Linux need defragmenting?
Note: linuxviolin made a good point in response to this thread. All filesystems (even ext3) will fragment after enough use and could eventually need defragmenting. Although this defragging would be very occasional, and not something you would have to worry about when starting out on Linux, it may want to be something you consider in the future. Personally, I've been running Linux for seven months and haven't even thought about defragging yet.
And on to part 2...
Antivirus
Straight from a former newbie, this a great way to think about the issue in my opinion:
Bottom line: Windows viruses will not affect a Linux system. There are very few viruses you have to worry about as a Linux user, and your firewall should protect you from them as long as you don't do anything careless. Although there is a much smaller risk of infection on a Linux system, that doesn't mean you should run around on the web downloading everything you see without hesitation. That being said, you can still carry viruses and spread them to other Windows machines, so it is often considered courteous for a Linux user to scan a file (using something like ClamAV) before sending it to a Windows user. This way, although the virus hasn't been affecting you, it also won't be allowed to affect the recipient of the file you're sending. If you use a service like Google or Yahoo to send email, however, they have built-in virus scans, making a manual scan irrelevant. Basically, it's 100% up to you wether or not you'd like to scan your files. Ever. Many Linux users don't even have an antivirus installed on their system, myself included.Colonel Schell wrote:I hope this helps you a bit, as I tuned in to your confusion about two things which confused me a lot when I first began using Linux.
The first realization I made was that viruses and malware are bits of code that infect the 'software,' not the hardware of the machine. 90% of the PC's connected to the Internet are Microsoft Windows run machines; therefore, the hacker-crackers and 'script-kiddies' write the malware for the Windows operating system. Linux is layed out in a different way, so the same code that infects Windows will not infect Linux or other similar OS's.
All of this being said, it is possible to expose your Linux system to outside threats, if you try hard enough. No operating system is invincible, but as long as you take common-sense precautions, you'll have no problems with viruses. For more info, here's another article: Linux vs. Windows Viruses
Important: Although Linux is very resistant to viruses, it is not resistant at all to user input. The implication of this is that you should always have some idea of what you're doing before you do it. Sometimes a malevolent user will post something you don't understand, toting it as a "script" that'll solve some problem or improve some functionality. For example, if you're browsing the web for whatever reason, and you come across a script like this:
Code: Select all
:(){ :|:& };:
Absolutely do NOT run it without first finding out what it does. That specific snippet will initiate an attack called a "forkbomb", causing infinite recursion and meaning you'll have to reboot (ie. you'll lose anything you were doing when you ran the code). People can be nasty, don't trust everything you see on the Internet.
Also important: Despite what I said above, there are some nefarious methods that will work on both Linux and Windows, the most prominent of them being JavaScript attacks through Firefox. I've never heard of a JavaScript attack causing a huge system-wide problem, but they can cause big problems with your browser. The good news is that JavaScript is very easy to avoid! When you first run Firefox, go to Tools -> Add-ons, search for NoScript, and install it. With NoScript, these cross-platform JavaScript attacks will never be able to make it through to your browser. Yay! Some more notes on JavaScript from a helpful guru:
So now you know! Defragging and antivirus programs are really unnecessary for your new Linux install. And try not to do anything crazy with the command line until you have an understanding of what's going on. Welcome to Mint, I hope you enjoy your experienceDrHu wrote:As well as noscript, I would suggest running without JavaScript enabled in browsers or Adobe acrobat reader or indeed any application, that wants to connect to the Internet for your convenience
--javascript can be temporarily tuned on for sites that need it via the noscript addon/extension for Firefox
Additionally in the noscript settings, don't use [x]Scripts Globaly Allowed in the General TAB
--I think it is still turned on as the default selection when noscipt is added, but it may not be; I have had noscript running for a long time
And for the browser specifically, the LSO (Local shred object) should be eliminated, Flash magic cookies.
--for that a search on these forums will show how, easy in Linux.