Defrag?

How does one Defrag a QNX partition? Is there anything in the OS, or freely
available?

Thanks

Hello,

There is a knowledge base entry on this that can be found at the following address.
http://qdn.qnx.com/support/bok/solution.qnx?124

Regards,
Dave B.


Dale Frameli <dframeli@texas.net> wrote:

How does one Defrag a QNX partition? Is there anything in the OS, or freely
available?

Thanks

The knowledge base entry says:

“There simply are no defragmentation utilities for QNX filesystems, because
they are not required.”

tt’s the “not required part” that look suspicious to me. Why would they not
be required?
What technology is use to ensure that performance doesn’t degrade over time,
to my knowledge none?

On a development machine, AFAIK over time compilation will get slower
because of
fragmentation.

“Applications Mail Group” <apps@qnx.com> wrote in message
news:9krcas$qf9$1@nntp.qnx.com

Hello,

There is a knowledge base entry on this that can be found at the following
address.
http://qdn.qnx.com/support/bok/solution.qnx?124

Regards,
Dave B.


Dale Frameli <> dframeli@texas.net> > wrote:
How does one Defrag a QNX partition? Is there anything in the OS, or
freely
available?

Thanks

Mario Charest <mcharest@zinformatic.com> wrote:

The knowledge base entry says:

“There simply are no defragmentation utilities for QNX filesystems, because
they are not required.”

We ran a Usenet news system on a QNX filesystem for a couple years without
defragmenting it, and without ongoing detioration.

And, the filesystem does try to reduce fragmentation – it will “pre-grow”
files that look like they’re going to be updated on an ongoing basis to
reduce the number of extents and stuff like that.

tt’s the “not required part” that look suspicious to me. Why would they not
be required?
What technology is use to ensure that performance doesn’t degrade over time,
to my knowledge none?

On a development machine, AFAIK over time compilation will get slower
because of fragmentation.

Or, because the project gets bigger?

Actually, a couple things will cause detioration in performance – a nearly
full disk will be far less efficient than one that isn’t. If you’re disk
gets over about 95% full, a lot more time will have to be spent scanning the
inode table/bitmap. Also, large directories will cause loss of efficiency
as directories are linearly searched for files.

The recommended defragmentation policy is to do a full backup, dinit the
filesystem, then do a full install.

Or, another easy way to do a defragmentation – install a second clean
disk of the same size, and just copy everything to the second disk, swap
disks, then go on to the next machine. A new disk is pretty cheap
nowadays, and this will probably be as fast or faster than any software
defragmentation utility. (And, likely do a better job.)

If you’ve maintained a partitioning policy where read-only or mostly read-only
stuff (e.g. /bin, /usr/bin, etc.) are on a seperate partition, this becomes
even easier as you only have to clear & restore the partitions that have
active reads/write (e.g. /home, /datalogging, etc.)

Even if you had a defragmentation utility, it would be a very good idea to
perform a full backup first – they can fail, and if they do, often leave
the filesystem in a dangerous state, or lose data.

-David

QNX Training Services
dagibbs@qnx.com

Hi David,

David Gibbs <dagibbs@qnx.com> wrote in article
<9kubao$lv5$2@nntp.qnx.com>…
[snip]

The recommended defragmentation policy is to do a full backup, dinit the
filesystem, then do a full install.

Good point. On my mind it is not appropriate for desktop system. Is QNX
RTP desktop OS or it’s only realtime OS?

Or, another easy way to do a defragmentation – install a second clean
disk of the same size,

Hmm… I spent about 100$ some years ago and I had bought huge HD. It’s
Quantum 4.3 GB. Where I can find the same HD now? And I do not wish to
waste of money!

and just copy everything to the second disk, swap
disks, then go on to the next machine.

I know some Windows users change their HD every year. Many of them don’t
know about defrag, they think the HD wear out :wink:

A new disk is pretty cheap
nowadays,

I’m sorry. The new HD costs about 100 USD. I agree, the economical
situation in my country is very bad, but about 100 USD is my salary for a
month.

Even if you had a defragmentation utility, it would be a very good idea
to
perform a full backup first –

I fully agree.

they can fail, and if they do, often leave
the filesystem in a dangerous state, or lose data.

There are many dangerous things in the world.

Regards,
Eduard.

-David

QNX Training Services
dagibbs@qnx.com

Eduard Kromskoy <ed1k@yahoo.com> wrote:

Hi David,

David Gibbs <> dagibbs@qnx.com> > wrote in article
9kubao$lv5$> 2@nntp.qnx.com> >…
[snip]

The recommended defragmentation policy is to do a full backup, dinit the
filesystem, then do a full install.

Good point. On my mind it is not appropriate for desktop system. Is QNX
RTP desktop OS or it’s only realtime OS?

There is an article poiting out some differences between QNX RTOS and
conventional OS at:

http://qdn.qnx.com/articles/dec1200/realtime.html

Or, another easy way to do a defragmentation – install a second clean
disk of the same size,

Hmm… I spent about 100$ some years ago and I had bought huge HD. It’s
Quantum 4.3 GB. Where I can find the same HD now? And I do not wish to
waste of money!

You can find it on newsgroups or/and some local computer stores are
selling/trading old h/w.

Regards,


Marcin


and just copy everything to the second disk, swap
disks, then go on to the next machine.

I know some Windows users change their HD every year. Many of them don’t
know about defrag, they think the HD wear out > :wink:

A new disk is pretty cheap
nowadays,

I’m sorry. The new HD costs about 100 USD. I agree, the economical
situation in my country is very bad, but about 100 USD is my salary for a
month.


Even if you had a defragmentation utility, it would be a very good idea
to
perform a full backup first –

I fully agree.

they can fail, and if they do, often leave
the filesystem in a dangerous state, or lose data.


There are many dangerous things in the world.

Regards,
Eduard.

-David

QNX Training Services
dagibbs@qnx.com

I had a kind of a defrag shell script several year ago. It kind of went
like this:

  1. use ‘find’ to find files with more than x number of extents
  2. use ‘cp’ to make a copy of those files with a temporary name
  3. rename that original file to a name under a /DELETE-ME directory
  4. rename the new copy back to the original name
  5. after the above process is done, then delete all of the DELETE-ME files

This will help with systems that have several “log” type of files that
continue to grow a little at a time over days, weeks, months, etc. Usually
the files deleted from the /DELETE-ME directory will make up one or more
much larger contiguous chunks of disk space.

Caviots:

  1. the sysetm needs to be otherwise idle during this process (or you need to
    have a very good idea of what file IO is going on).
  2. you can’t use this procedure with files with multiple hard links
  3. there is no guarantee that the new file will be a single extent
  4. there must be enough disk space to have two copies of all of the files
    that would be copied
  5. be very careful about error detection and processing routines so you
    don’t risk loosing anything. I always did the deleting the /DELETE-ME files
    by hand after I confirmed everything that was copied was copied OK.

“Eduard Kromskoy” <ed1k@yahoo.com> wrote in message
news:01c12171$9b4388c0$396fa8c0@ED1K…

Hi David,

David Gibbs <> dagibbs@qnx.com> > wrote in article
9kubao$lv5$> 2@nntp.qnx.com> >…
[snip]

The recommended defragmentation policy is to do a full backup, dinit the
filesystem, then do a full install.

Good point. On my mind it is not appropriate for desktop system. Is QNX
RTP desktop OS or it’s only realtime OS?


Or, another easy way to do a defragmentation – install a second clean
disk of the same size,

Hmm… I spent about 100$ some years ago and I had bought huge HD. It’s
Quantum 4.3 GB. Where I can find the same HD now? And I do not wish to
waste of money!

and just copy everything to the second disk, swap
disks, then go on to the next machine.

I know some Windows users change their HD every year. Many of them don’t
know about defrag, they think the HD wear out > :wink:

A new disk is pretty cheap
nowadays,

I’m sorry. The new HD costs about 100 USD. I agree, the economical
situation in my country is very bad, but about 100 USD is my salary for a
month.


Even if you had a defragmentation utility, it would be a very good idea
to
perform a full backup first –

I fully agree.

they can fail, and if they do, often leave
the filesystem in a dangerous state, or lose data.


There are many dangerous things in the world.

Regards,
Eduard.

-David

QNX Training Services
dagibbs@qnx.com