LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Defragmenting? (https://www.linuxquestions.org/questions/linux-newbie-8/defragmenting-717071/)

Nightspear 04-05-2009 10:26 PM

Defragmenting?
 
Is there away to defragment my hard drives in Ubuntu 8.10 or is there no need in Linux based systems?

MS3FGX 04-05-2009 10:28 PM

Some Unix/Linux filesystems do have tools for defragmentation, but there is really no need to in the majority of cases. Drive fragmentation will only get up to a few percent on a desktop machine, not enough to seriously impact overall performance.

i92guboj 04-05-2009 10:32 PM

Please, do search before asking. This is a fairly common question:

http://www.linuxquestions.org/questi...=fragmentation

reptiler 04-05-2009 10:34 PM

Some people might tell you that common Linux filesystems, like ext2/3/4 do not fragment.
Well, although this is not true it usually is not necessary to defragment Linux filesystems, as fragmentation, compared to Windows, is pretty low.
Which also is the reason that you probably have a hard time finding something in your system to actually do this.

As said, also on Linux filesystems actually do fragment, but it's quite unlikely to get to the extends you may be used from Windows.

H_TeXMeX_H 04-06-2009 09:45 AM

http://geekblog.oneandoneis2.org/ind..._defragmenting

Nightspear 04-06-2009 10:32 AM

Interesting to know. Anyway The reason I ask is because my box is stating to randomly restart. I opened the ClanTk Virus scanner, updated, ran it and it reports clean, since I started using Ubuntu I have had the Firestarter firewall running. At this point I would run the defrag tool in windows then check for disk errors. Any ideas why I am getting random restarts? I will gladly supply any info you may need to help figure it out.

i92guboj 04-06-2009 01:52 PM

Quote:

Originally Posted by Nightspear (Post 3500160)
Interesting to know. Anyway The reason I ask is because my box is stating to randomly restart. I opened the ClanTk Virus scanner, updated, ran it and it reports clean, since I started using Ubuntu I have had the Firestarter firewall running.

Random hard reboots are not a software problem. They are usually tied to faultly hardware, so I'd watch over the cpu temperature and use memtest86 to check the state of your ram sticks to start with. But really any other broken piece could be the problem. Most livecds have a boot option to run memtest86. It will take long and it's not infallible though.

Quote:

At this point I would run the defrag tool in windows then check for disk errors. Any ideas why I am getting random restarts? I will gladly supply any info you may need to help figure it out
It usually should be the other way around. First check and repair, then you can worry about defrag. But a fragmented drive has nothing to do with system hangs nor with random hard resets.

Nightspear 04-06-2009 03:42 PM

So most software will not cause a crash in Linux? I will keep an eye on cpu temp and check my ram. Most other peices like graphics card and sound card are pretty new still(less than 3 months old). Is there a log or something I can check to see what may be causing the problem. I know in Windows I can check the event viewer to see what may have faulted, is thee anything like that in Linux?

Quakeboy02 04-06-2009 04:02 PM

Quote:

Originally Posted by Nightspear (Post 3500452)
So most software will not cause a crash in Linux?

It's actually pretty hard for a user-level program to cause an OS or system crash in Linux unless there's a bug in the kernel or a driver, such as the video driver. Hardware is usually the culprit.

Quote:

Is there a log or something I can check to see what may be causing the problem. I know in Windows I can check the event viewer to see what may have faulted, is thee anything like that in Linux?
There should be a log viewer in Ubuntu. I'm using Debian/Gnome, and it's at Applications->System Tools->System log. If not, the logs are at /var/log. If it's a hardware problem, then chances are there won't be anything in the logs.

thorkelljarl 04-06-2009 04:52 PM

Dust, dust...

If you can, open the case and clean out the dust, looking particularly at the fins or leaves that disperse heat from the CPU to be sure that they are not blanketed and clogged.

You can use a linux live-cd with test and stress tools to check the CPU, RAM, and HDD. Google a bit and learn more.

That virus program you ran is there for the benefit of those to whom you might be forwarding Windows files, not to find any linux virus. Google some more.

i92guboj 04-06-2009 05:02 PM

Quote:

Originally Posted by Quakeboy02 (Post 3500462)
It's actually pretty hard for a user-level program to cause an OS or system crash in Linux unless there's a bug in the kernel or a driver, such as the video driver. Hardware is usually the culprit.

If the kernel doesn't let you do anything wrong, then you can't do that. In linux, programs do not have the kind of direct access to the hardware that will actually let them do stupid things. So, if a program crashes, it will just be closed and that's it.

Of course sometimes crashes happen, but they are either due to a bug in the kernel (very unlikely but well, kernel devs are humans...) or due to a buggy 3rd party driver (the most common cause), like when you use some weird kernel patchset or like when the ati driver freezes your display, which happens actually quite often. But that's not linux fault.

Quote:

There should be a log viewer in Ubuntu. I'm using Debian/Gnome, and it's at Applications->System Tools->System log. If not, the logs are at /var/log. If it's a hardware problem, then chances are there won't be anything in the logs.
The first place to look would be /var/log/messages, or just use dmesg on the command line. If a driver or the kernel halts or crashes you might find something useful there.

Also make sure you are not using faulty drivers or strange kernel patchsets.

Nightspear 04-06-2009 07:12 PM

That all makes sence. However I know its not dust I clean the vents and fans regularly every week(living on a dirt road is hell in the summer time). It may have been a buggy driver or something, I updated the system w/ sudo apt-get update followed by sudo apt-get upgrade and finished with sudo apt‐get dist‐upgrade. Since then I haven't crashed. As far as I can tell the log looks pretty clean. Thanks for all the info, I can honestly say I learned something today.


All times are GMT -5. The time now is 06:09 PM.