Announcement

Collapse
No announcement yet.

De-fragger?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    De-fragger?

    I use Autofsck to occasionally check the disks, and this morning it reported hda2 as being 16% non-contiguous, this is my /home partition. I have recently un-installed quite a lot (around 10 Gb) of programs i don't need, Open Office, etc., which is probably why the drive is in the state it is.
    Everything else; hda1, hdb5,hdb6, & hdb7 are all between 0.6 - 1.5%.

    It seems to me that hda2 may well need to be defragged, and - having read all the defrag-related topics i can find here, the consensus seems to be that Linux machines don't need to be defragged.

    I must admit, 16% seems pretty high to me in comparison to the other drives, so i've been trying to use "defrag".



    I am certainly experiencing some - occasionally dramatic - slowdown times accessing the drive, does anyone know of a reasonably easy-to-use defragmenter?


    #2
    Re: De-fragger?

    I don't know about "easy", but here's pretty much everything you'll ever want to know about defragmenting Linux filesystems (and then some):

    http://ubuntuforums.org/showthread.p...ghlight=defrag

    Comment


      #3
      Re: De-fragger?

      To my knowledge most Linux filesystems should just defragment themselves - see if it goes down over time. Did you let the partition get very full? That's commonly the cause of severe fragmentation.
      I am running Ubuntu 8.10 (yes Gnome) with upgrades applied daily about 0900 UK time. Hardware is Dell Precision 420, 2x 800 MHz PIII, 512 MB RDRAM, nVidia GeForce 6800 128 MB AGP graphics, 18GB SCSI and 500GB IDE HDDs, DVD burner, Hauppage TV card.

      Comment


        #4
        Re: De-fragger?

        @ dibl:
        Thank you for that link, i've installed pyfragtools, and if i ask it to analyse hda2 it replies:
        Code:
        malcolm@hippy:~$ sudo defrag --analyze hda2
        Building list of files to analyze.../usr/bin/find: hda2: No such file or directory
         done!
        
        Analyze finished.
        hda2 is not fragmented. Go home.
        I like the "Go home" bit....

        maybe i'll run Autofsck again later on to check.

        @ cantab:
        It was around 15Gb - it holds around 18Gb ... i think...
        ....No, i don't torrent anything.

        Edited to add:

        I've just checked it with GParted, it holds 18.63Gb, and now contains 3.14Gb.
        I uninstalled Wine -- and some Windows games as well....

        Comment


          #5
          Re: De-fragger?

          Somewhat related, herman has a good page on checking your filesystems at:

          Bigpond, home: http://users.bigpond.net.au/hermanzone/
          (see his Filesystems page)

          He addresses the issue of understanding/checking/fixing the filesystems. I haven't read it for awhile and need to read it again, but I remember that it is worth knowing about.
          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #6
            Re: De-fragger?

            Originally posted by aged hippy

            I like the "Go home" bit....
            Ha ha ha -- I didn't know about that -- that's a good one!

            Comment


              #7
              Re: De-fragger?

              EDIT: I should have read the documentation first, so the second reply is completely wrong. Might be fun to read though!

              Code:
              malcolm@hippy:~$ sudo defrag --analyze hda2
              Building list of files to analyze...[b]/usr/bin/find: hda2: No such file or directory[/b]
               done!
              Close, but the correct command would be:
              sudo defrag /

              Presuming that /dev/hda2 is mounted on / (which is to say hda2 is your entire linux partition). If it were say mounted on /home you would use the command:

              sudo defrag /home



              Old reply:

              In UNIX block devices like hard drives, etc, are accessed through special files normally contained in the /dev directory. /dev/hda is the first hard drive in your computer, /dev/hda1 is the first partition on that drive, /dev/hda2 is the second, etc. You'll see other interesting things in there, such as ttys (text terminals like konsole), fd devices (floppies), lp devices (printers), dsp (sound), mem (system memory) and special ones like null or random. Null is nothing and random is just that; random stuff.

              For fun, you can try this out.
              sudo cp /dev/mem /dev/dsp
              This will copy your memory out to the sound card, allowing you to hear what the data in your computer's ram sounds like. Had enough? Hit <CTRL>-C to cancel the command.

              Careful sudoing things with /dev devices though. Swapping /dev/dsp and /dev/mem will crash the computer in a hurry. Sending data into /dev/hda will wipe out your hard drive and all it's data. Linux will not ask you if it's really a good idea; it'll just go ahead and wipe out your hard drive like you asked it to!

              Comment


                #8
                Re: De-fragger?


                @ Qqmike:
                Thank you for that link to Hermanzone, i've read through the relevant bit, and as i've got the GParted live disk, i'll run it tomorrow.
                I'll keep you posted as to how things go.


                Originally posted by moir
                Close, but the correct command would be:
                sudo defrag /
                I only wanted to analyse my /home partition, which is on hda2, so i copied/pasted the code from a page on the link which dibl posted.... after i had read there that it is dangerous in the extreme to attempt to defrag a mounted volume.

                Comment


                  #9
                  Re: De-fragger?

                  Well, i've done the GParted bit, it confirms the defragmentation, but - as there are no other problems, that seems about all i can do.

                  I'm happy enough to leave it as it is for now.... at the next upgrade (HH) i'll probably re-install anyway.

                  Thank you all for your help.

                  Comment


                    #10
                    Re: De-fragger?

                    Surely it would be "sudo defrag --analyse /dev/hda2" after unmounting it?

                    Comment


                      #11
                      Re: De-fragger?

                      Eh, it's probably smart enough to know...

                      I thought about using that tool, but then I read that it only made files into one contiguous fragment, rather than doing the whole defragment-reorder-consolidate thing.
                      For external use only.

                      Comment

                      Working...
                      X