Performance-predicated automatic defragmentation of hard disks

Performance-predicated automatic defragmentation of hard disks

US 20040148476A1

(19) United States

(12) Patent Application Publication (10) Pub. No.: US 2004/0148476 A1

Altare

(43) Pub. Date: Jul. 29, 2004

(54) PERFORMANCE-PREDICATED AUTOMATIC

DEFRAGMENTATION OF HARD DISKS,

PARTICULARLY FOR NON-PC MOBILE

DIGITAL DEVICES INCLUDING MUSIC

RECORDER/PLAYERS

(76) Inventor: William Christopher Altare,

Oceanside, CA (US)

Correspondence Address:

FUESS & DAVIDENAS

Suite II-G

10951 Sorrento Valley Road

San Diego, CA 92121-1613 (US)

(21) Appl. No.:

(22) Filed:

10/205,190

Jan. 28, 2003

Publication Classi?cation

(51) Int. Cl.7 .......................... .. G06F 12/12; G06F 12/00

(52) US. Cl. ......................... .. 711/159; 711/165; 711/112

(57) ABSTRACT

Fragmentation of ?les upon a hard disk drive may be avoided or mitigated by Writing any and all neW ?les onto the hard disk drive starting at a location Which is then, at the time of the Writing of each ?le, at the beginning of a commodious open and terminal area of variable size at the

“top” of the hard disk called the then “free space”, and then,

With the free space of the disk having become ?lled to a predetermined extent, (ii) moving all recorded ?les into tight-packed sequence, using thus any disk space vacated by erasure(s) While reconstituting some portion of the “free space” and presenting all ?les contiguously and defrag mented.

Automatic defragmentation of the hard disk drive may also, or alternatively, ensue by recognizing during normal use of the hard disk drive, and Without any manual or any sched uled invocation of any fragmentation assessment routine,

When the ?les of a hard disk drive are undesirably frag mented; and, responsively to the recognizing, defragmenting hard disk drive, and/or (ii) indirect, by assuming the ?les are substantially of knoWn types, lengths and usages, e.g., digital music ?les, and monitoring the times and/or read faults during retrieval as an indication of the fragmented/ defragmented status of the ?les. prompt operator to connect AC and verify connection v

Scan HDD for unused sectors and build table

L process normal

205

operation

\ Scan HDD for

fragmented

files and build table

1

condense fragmented files that contain embedded free

space

I

216

\ move files to form one contiguous block of files and one contiguous block of free space

Patent Application Publication Jul. 29, 2004 Sheet 3 0f 6 US 2004/0148476 A1

prompt operator to connect AC and verify connection

Scan HDD for unused sectors and build table

\ Scan HDD for

fragment-ed files and build table

i 209

no-/ 206

*

Prociegs normal recorder/Player operation

205

condense fragmented files that contain embedded free space

F

216 move files to form one

contiguous block of files and one contiguous block of free space

Fig.2

Patent Application Publication Jul. 29, 2004 Sheet 4 0f 6

US 2004/0148476 A1

306\ prompt operator to connect AC and verify connection

308 yes

Fetch stable of unused sectors

no

*

process normal recorder/player operation

310 >

\ move files» to form one

contiguous block of files and one contiguous block of free space

Fig.3

Patent Application Publication Jul. 29, 2004 Sheet 5 0f 6 US 2004/0148476 A1

Drive defragmentation ogical Operation

Scan drive File Structure build table of Free Space

Blocks "FSB" build table of Fragmented

Files "FF" '

build table of Contiguous

Files "CF" from Fig.4, sheet B

“i

to Fig.4h esb

Condense File

_ so Contiguous

+

Update File

System, FSB, FF & -

CF‘ Tables _

Patent Application Publication Jul. 29, 2004 Sheet 6 0f 6

from Fig.4‘;v

TOP:

Any ‘FF's size match

FSB‘ s?

US 2004/0148476 A1

es§~ C021 'FF to FSB

l

Update File System,

FSB, FF & CF Tables

Yes

Any CF fit into FSB’?

Move hlgher CF Copy CF

no

Any updates es

to FSB down towards

beginning of disk

l l

Update File system, FSB: FF _

‘n last Pass‘? - a CF Tables

to Fig.4, sheet A,

L00]? n°

{1%} - Fig.4!)

US 2004/0148476 A1

Jul. 29, 2004

PERFORMANCE-PREDICATED AUTOMATIC

DEFRAGMENTATION OF HARD DISKS,

PARTICULARLY FOR NON-PC MOBILE DIGITAL

DEVICES INCLUDING MUSIC

RECORDER/PLAYERS

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention generally concerns defrag mentation of hard disks and hard disk drives, normally magnetically-recorded hard disks as are Written in Winches ter-type hard disk drives.

[0003] The present invention particularly concerns the criteria by Which defragmentation of a hard disk drive may be automatically initiated, particularly for and in non-pc mobile digital devices including music recorder/players.

[0004] 2. Description of the Prior Art

[0005] What is Defragmentation

[0006] The instant a ?le is saved on a computer hard disk, disk fragmentation begins. The more fragmented ?les stored in one system, the more performance deteriorates. Thank fully, the eighth Wonder of the IT World, the disk defrag menter program, can almost reverse the effects of fragmen tation and increase system performance signi?cantly. rearranges the fragments or discontinuous parts of each ?le stored on a computer hard disk so that the small, empty storage spaces adjacent betWeen fragments are substantially eliminated, effectively continuously tight packing a ?rst region of the disk, creating enlarged remaining storage space in a second region of the disk, and possibly making ?le access faster.

[0008] Defragmentation is the process of locating the noncontiguous fragments of data into Which a computer ?le may be divided as it is stored on a hard disk, and (ii) rearranging the fragments and restoring them into feWer fragments or into a Whole ?le. Additionally, successive ?les and/or ?le segments are, insofar as is possible, (iii) tight packed upon the surface of this disk, Without intervening regions in Which no useful information is recorded. Defrag mentation generally reduces data access time, permitting magnetic disk storage to be used more ef?ciently in time as

Well as in volume. Some operating systems automatically defragment storage periodically; others require that the user occasionally use a special utility for this purpose.

[0009] The WindoWsTM 98 product of Microsoft, Inc.,

(“WindoWs” is a registered trademark of Microsoft) comes

With a built-in defragmenter as a “system tool” that the user can run. The WindoWs NT product of Microsoft did not come With a defragmenter because its ?le system, NTFS, often ?nd one necessary and several vendors provide defrag menters. The WindoWs 2000 product of Microsoft comes

With a “light” version of the DiskeeperTM defragmenter; some users (especially corporate users) use the Diskeeper program or some other full-function defragmentation pro gram to manage storage ef?ciency and performance.

[0010] Why “Defrag”?

[0011] A number of articles concerning defragmentation appear, circa 2002, on the World Wide Web at “searchWin doWsManageability.com: The WindoWs Manageability Spe

ci?c Search Engine presented by TechTarget.com”

[0012] In the “Case study: Defrag for less hang time”, 29

Nov. 2001, by Meredith B. Derby, it is reported that the four tWice Weekly and hogging CPU speed, sapping the perfor mance of 150 Work stations. Some four hours each Week

Were spent rebooting the company servers.

[0013] Knowing operating systems can store ?les inef? ciently, company personnel had alWays defragmented their computer systems but had no built-in defragmentation utility in WindoWs NT, nor any Way to schedule defragmentations.

[0014] After collaboration on a solution for the Work station problems, and research into utilities to automate and schedule maintenance, Executive SoftWare’s Diskeeper, O

& O SoftWare GmbH’s Defrag 2000 Professional Edition and Gaithersburg, MD-based RaXco SoftWare’s PerfectDisk became the top three contenders.

[0015] After doWnloading all three products, one Was set up on test machines on identical hardWare, and after a Week, rolled into production use on the system’s heaviest users.

The softWare Was scheduled to defrag the computers each day at lunchtime. Performance of these computers Was then compared to similar users Who didn’t have the defrag softWare installed.

[0016] It Was found that defragmenting of the WindoWs master ?le table (MFT) Was useful, the MFT When highly fragmented causing the hard drive to fail ?nd the correct ?les needed to run the operating system, and crashing the com puter. Importantly, the MFT can only be defragged When machines are booted up.

[0017] The selected Defrag 2000 Pro softWare product

It also can be scheduled to defrag the other ?les at any time.

If the scheduled defrag is missed because a computer is not turned on, the softWare Will knoW and Will run it Within 72 hours of the missed date, the system administrator receiving a report that the failure has occurred. formance and more system reliability Were realiZed bene?ts,

With a 17-23% increase in Work station performance.

[0019] In another article “Disk defragmenting dos and don’ts” also by Meredith B. Derby it is related that, since

WindoWs stores ?les in fragmented chunks, disk fragmen tation is a fact of life in WindoWs environments. The trick is to prevent fragmentation from hindering system perfor mance.

[0020] The system administrator of the same Wisconsin business advises:

[0021] “Do run your defrag softWare religiously on every

Work station.” At a minimum, run it at least every 30 days.

[0022] Do run it on your most heavily used computers at least every tWo Weeks. This Will increase their computer’s performance, causing them to track you doWn less.

US 2004/0148476 A1

Jul. 29, 2004

[0023] On the server side, do schedule it to defrag during inactive periods, such as late at night. And do run those at least once a Week.

[0024] Don’t forget to shut doWn any running applica tions. Files in use When the softWare runs Will not be

defragged.

[0025] Do set up a test environment to get a feel for Which

“defragger” Will Work best. “Compare apples to apples,

Even if you think different products are incredibly similar, it is still Worth your time to compare them.”

[0026] Do test them on similar hardWare With similar con?gurations, he said. This Will alloW your tests to be as accurate as possible.

[0027] Do look at all the features that might bene?t you.

Look at the functionalities offered, the reliability, and hoW easy the monitoring Will be.

[0028] In yet another related article the “Top 10 disk defragging pointers” again by Meredith B. Derby, the best

Ways to harness the poWer of a defragmenter are related by

Frank Alperstadt, managing director of Berlin, Germany based O & O Software, GmbH, maker of tWo WindoWs

defragging products.

[0029] Alperstadt ?nds that the biggest mistake an IT manager can make is not to use defragmentation softWare.

Defragmentation can result in a 200% performance gain on a single computer. Leaving your hard disk fragmented is simply another Way to burn money. Total cost of oWnership

may be reduced dramatically simply by installing (and

using) a defragger.

[0030] He ?nds an important part of defragmenting is knoWing When you need to run the softWare. Disk fragmen tation causes a bad sloWdoWn of your system. Defragmen tation itself usually costs resources, too. It is up to the user to see When he/she Will need to defrag his/her hard disk. If you think you need to, remember that it can be a very time consuming process. Some defraggers, hoWever, have an integrated functionality to check automatically if your hard disk is fragmented more or less than a prede?ned value.

[0031] Disk fragmentation starts even if there are only tWo

?les on your disk and only one ?le has been changed. You should start defragmentation right after the installation of the operating system and, of course, after installing your defrag menter.

[0032] KnoW your disk capacity and potential disk errors.

[0033] The biggest hurdle defragmentation softWare encounters is heavily loaded hard disks. There must be a minimum of 15% free disk space to start the defragmenta tion.

[0034] Broken hard disks (e.g. hard disks containing bad sectors) shouldn’t be defragmented. So, check your disks for errors before defragmenting.

[0035] Alperstadt ?nds the most critical aspect in defrag menting a server is the availability of the server. The defragmenter should not use all the resources for the defrag mentation. It should leave enough free memory and proces sor time so the server can ful?ll its main tasks While being defragmented. If the server is not defragmented periodically, it can be a time consuming process because there are large amounts of ?les being stored on them.

[0036] Running defragmentation softWare, like running

any other softWare on a computer, costs performance time.

So if it is desired to defragment hard disks, leaving the computer alone for a While (maybe a long While), and letting the defragger do its job, is recommended. Some defrag tools address this issue. They have an integrated technology that listens to the system and stops the defragmentation if the user Works With the machine. If the user pauses, the defrag process continues automatically.

[0037] Defragmentation usually doesn’t con?ict With other applications. If the defragger ?nds a ?le locked by another application, this ?le Will not be touched. HoWever, neWer defraggers Write these ?les to a database and defrag ment them during the neXt boot process.

[0038] If you compare a ?le server With a database server, you Will ?nd many differences. The defragmentation soft

Ware should respect these differences. On ?le servers, the softWare should not only defragment ?les, it should reorder them by the date of last ?le access. So a computer oWner/ user can thus save time, and therefore money, if it is needed to search for a ?le later.

[0039] Although the various computer defragmentation schemes and softWare not strictly relevant to the present invention save to shoW that there are all types and qualities of defragmentation, Alperstadt advises not to rely on the built-in WindoWs defragger. In WindoWs 2000/XP built-in softWare calls itself a defragger. This tool is sloW, incom plete and has a limited scheduling capability. Further, it can only defrag one drive volume on a machine at a time.

[0040] In summary Aperstadt ?nds that it is absolutely necessary for administrators of large enterprise netWorks to be the only ones Who manage the defragmentation of their

Work stations and servers. They should ask themselves: Can

Work station users defragment themselves? Keep in mind that most users don’t have administrator rights on their machines.

[0041] In still yet another article “Case study: Ending the remote defrag drag” by Jan Stafford, 20 Feb. 2002, at the searchWindoWsManageability.com site, Momentum Health

Ware Information Systems IT manager Paul Beaudry ?nds that the attitude “If it’s not broken, don’t ?X it” could be the slogan for many businesses’ IT shops, said. With that attitude, he Would have simply Zipped past an ad for a disk defragmentation tool that could improve his system’s per formance. After all, his eXisting defrag tool Wasn’t broken.

[0042] “It’s easy to get complacent, stick With the vendor you knoW and not keep your eyes and ears open,” said

Beaudry. Often, this approach results in so-so performance and higher total cost of oWnership in systems Worth tens of thousands of dollars. Making poor use of large system investments is not acceptable for Beaudry. “If I see a Way to get a percentage point improvement in my system, I’m going to go for it,” he said.

[0043] The fact that MHIS has many remote Workers poses a tough management problem for an ef?ciency-fo cused IT manager. The Winnipeg, Manitoba, Canada-based

MHIS creates ?nancial, clinical, client and dietary Informa tion softWare for the health care industry. Working as

US 2004/0148476 A1

Jul. 29, 2004 salespeople or implementation specialists, MHIS employees travel With laptops running Microsoft Windows NT or

WindoWs 2000 and Microsoft’s SQL Server database. Disk fragmentation is a common occurrence in WindoWs-based computers. As fragmented ?les pile up in one system, performance deteriorates.

[0044] “Unless you can centrally manage PCs, you don’t knoW if they’re being defragged regularly,” said Beaudry.

Defragging may not be taking place for various reasons, ranging from lack of disk space to the poWer being off for long periods to softWare errors.

[0045] Unfortunately, MHIS’ legacy defrag tool—Dis

keeper from Burbank, California-based Executive Soft

Ware—requires that each “disk be managed individually.”

Beaudry couldn’t keep tabs on laptops that remained out of the main of?ce for Weeks at a time. Users Would return after long absences and complain that their laptops Were running sloWly. Often, the cause Was disk fragmentation.

[0046] With this problem in mind, Beaudry Was draWn to an ad for Defrag Commander. The ad said the tool could be managed from one computer. Also, Defrag Commander— created by Austin, Tex.-based Winternals SoftWare—doesn’t require manual installations on desktops.

[0047] Intrigued, Beaudry ordered a demo copy and ran a test on a WindoWs 2000-based server. He found that Defrag

Commander defragged quickly in a single-pass. Also, it offered daily reports detailing activities on each computer on the defrag schedule.

[0048] With Defrag Commander, defrags run on a sched ule set the IT manager. “If someone’s machine isn’t on When the defrag is scheduled, the defrag happens automatically

When they poWer up again,” Beaudry said. Less user support is needed, because users aren’t involved in the process. In fact, they don’t necessarily even need to knoW about it.

[0049] “We ran trials on machines that had Diskeeper installed,” said Beaudry. “In all cases, We Were able to defrag beyond What Diskeeper could do.” Also, he added, “Dis keeper is signi?cantly more expensive.” In fact, he couldn’t

?nd any other add-ons that, for the same money, could match

Defrag Commander’s performance.

[0050] Rather than scrapping Diskeeper, Beaudry decided to use Defrag Commander as a complementary solution and for upgrades. The initial investment of $1,100 gave him central management capabilities for over 150 desktops.

[0051] Beaudry installed Defrag Commander on a Win doWs 2000 server in November 2001.“It’s running so smoothly I can practically forget about it,” he said. “From an

IT management and TCO perspective, it doesn’t get any better than this.”

[0052] The Nature of Digital Audio Files

[0053] Extraction, or “RIPPING” of audio from a CD? is explained in the article “About Digital Audio Extraction” by

Bob Starrett a=on the World side Web circa 2002 aT <http://

WWW.cdpage.com>.

[0054] Accurately copying a Red Book (audio) track from an audio compact disc to hard disk or another CD is a continuing challenge, but it has recently become less dif? cult due to advances in hardWare and softWare technology.

[0055] Audio tracks are not like regular computer data

?les; they are made up made up of data that is meant to stream, and this stream contains more than music. The stream itself is not simple; it is interleaved, meaning that portions of a song that naturally folloW each other When playing the song do not folloW each other in the physical layout of the disc itself. This is part of the disc’s error correction, used to ensure that errors (caused by dust and scratches, for example) do not cause audible errors When the disc is played.

[0056] Digital Audio Extraction, or DAE, is sometimes,

perhaps unfortunately, called “ripping”. Ripping involves

moving the contents of an audio track on a CD to a hard drive or other storage device, by reading the track from the

CD and creating a ?le that can then be manipulated in ing AIFF on the Macintosh and the WAV format under

WindoWs.

[0057] Why is it sometimes difficult to get good-quality audio extracted from a disc? And Why is the process so sloW in many cases? This takes a little understanding of hoW the data on an audio disc is organiZed.

[0058] An audio disc consists of frames, each of Which contains 24 bytes of user data, synchroniZation, error cor rection, and control and display bits. The audio CD’s data is not arranged on the disc in distinct physical units. The data in one frame is interleaved With the data in other frames.

This prevents a scratch or other defect in or on the disc from destroying a frame beyond the ability of the reader to correct rather than a Whole frame or frames, so, using error correc tion technologies, the missing data can be recovered and the disc can play normally Without discernible loss of content or

quality.

[0059] Use these tips When ripping audio and your chances for success Will increase:

[0060] 1. Make sure the disc is clean, free of dust, ?nger prints and other foreign matter. Discs can be cleaned With commercially available cleaners and cleaning kits, but these are not necessary to ensure a clean, readable disc. Simply hold the disc under Warm, running Water. Lather one hand

With hand soap (bar or liquid), and rub the soap gently on both sides of the disc With your ?ngers. Rise your hands and the disc Well With Warm Water and pat the disc dry With a soft, lint-free cloth or toWel.

[0061] 2. Make sure the disc does not suffer from any of the folloWing conditions: Warping, deep scratches, or a nicked or peeling re?ective surface. These can cause the reading drive to seek excessively as it tries to read damaged or unreadable errors, resulting in long ripping times or corrupted ?les.

[0062] 3. Use your best drive for ripping, even if it is not your fastest drive. If you have more than one CD recorder or CD-ROM drive, try your fastest drive ?rst. If the results are not satisfactory (you can tell by listening to the ripped

?le!, use a sloWer drive.

[0063] “Best drive” is, of course, a subjective judgment that you Will need to make for yourself after some experi mentation. You can usually depend on drives from Well knoWn manufacturers to do a good job at audio extraction.

US 2004/0148476 A1

Jul. 29, 2004

On the other hand, some models from major manufacturers have been known to do extraction poorly or not at all. Many inexpensive, non-branded drives rip audio just ?ne. NeWer drives Will perform better than older drives, not just because they are neWer, but because many of them incorporate neW technology that makes ripping faster and more accurate.

While many older CD-ROM drives Will Work for extracting audio, they Were not built or optimiZed for that task, and extraction softWare Will have to Work longer and harder to get the audio track from the disc into a clean ?le for recording to CD-R.

[0064] If possible, dedicate a hard disk drive to ripped

?les, perhaps an older, smaller hard drive that you have lying around. This prevents hard disk phenomena (such as cross linked ?les and excessive fragmentation) from causing prob lems When you re-record the ?les to CD. If you use a separate drive, you should have to defragment it less fre quently, as all the ?les on it Will be large ?les. An added bonus is that, instead of defragmenting the drive, you can just format it after you have made your CD and be assured of clean contiguous disc space for your next extraction job.

(Recall that full defragmentation of a large hard drive takes quite a bit of time, and ties up your computer until it’s done.)

Get a good CD-ROM drive for audio extraction. HoW do you knoW Which ones are good? The Adaptec CD-R dis cussion list is a good place to ?nd out the opinions of many other CD-R users; the question has been discussed exten sively in the list in the past, and is frequently re-discussed as neW models are released. To see What’s been said most recently, have a look at the list archives at http://listserv.a daptec.com. You can also join the list yourself and ask; see http://WWW.cdrcentral.com/community/policies.html for more information.

[0065] To understand Why audio ripping can be so unpre dictable, We need to look at the structure and function of audio discs as opposed to data discs. Copying ?les from a data disc to hard disk is easy and reliable. This is not alWays the case With audio tracks. An audio (Red Book) disc is divided into three distinct areas: the Lead In, the Program

Area, and the Lead Out. The location, or address, of each audio track on a disc is stored in the disc’s Table of Contents

(TOC) in the Lead In area of the disc.

[0066] The TOC of an audio disc, much like a book’s, is a good source for ?nding out What is Where on the disc, but it cannot alWays lead you to the right place in the book. Let’s say We have a chapter in a book that is entitled “HoW to

Record an Audio CD”. If We Want to learn about ripping, the

TOC Will tell us that this chapter begins on page 123, but it does not tell us Where Within the chapter the part about ripping begins. The Table of Contents on an audio CD tells the CD-ROM drive approximately Where a song begins on the disc, but, unlike a data CD-ROM, it doesn’t tell the drive exactly Where it starts.

[0067] Since audio discs Were designed to be played sequentially in real time, it Was not thought necessary to have information on the disc that pinpointed the exact location of the beginning of a track; it Was good enough to get close to the location. To have that extra data With an exact starting address for every track Would have taken up space on the disc that could otherWise be used for music.

[0068] The sectors on a data CD, on the other hand, has only 2,048 bytes of user data in each 2,352-byte CD-ROM sector. These sectors can be accessed exactly because the header information (the remaining 304 bytes) in each sector holds the precise address of the data block.

[0069] An audio block also contains 2,352 bytes, but all of these bytes are used for audio. There is no header, so there is no information Within the block to alloW for the exact positioning of a drive’s read head over a particular block. To locate a speci?c audio block, a CD drive must take advan tage of the Q subcode, but this alloWs head positioning only to Within 1 second of the true block address. When seeking an audio block, a CD-ROM drive only moves the read head to a position close to the requested block, and then it compares the Q subcode to the block address being sought.

The Q subcode references the minute, second, and frames relative to the start of the track and also the Absolute Time

(that is, the time in minutes, seconds, and frames relative to the Whole disc).

[0070] When a drive is asked to seek to an audio sector, it begins reading, then compares the Q subcode information to the block address it is looking for. Data transfer begins When the drive has located a Q subcode address close to the requested block address. Many CD-ROM drives seek an audio address Within four Q subcode addresses of the address being sought (4/75th of a second in playback time).

In this scenario, a request for a particular audio block could return any of nine blocks close to the desired position. This is Why extraction is not exact. Clicks and pops that you sometimes hear in ripped ?les can be caused by this inexact

positioning.

[0071] Recently, some advances in extraction technology have made ripping much less troublesome, and completely error-free in many cases. The ATAPI (SFF8020) speci?ca by many drive manufacturers in current lines of CD-ROM drives. The Multimedia Command Set (MMC) has this advantage: many of the commands that Were previously performed in softWare can noW be executed by the CD

ROM’s controller chip. One of these functions is the real time error correction of Layer 3 Reed-Solomon Product-like

Code (RSPC). Others are error detection, real-time ECC correction of one byte per P-Word and Q-Word, and repeated

ECC passes. Repeated ECC passes increase the reliability of the drive’s read function. Controllers from Oak Technology and Winbond, the most Widely used CD-ROM drive con troller chips, have these functions built-in. Accordingly, recorders and drives With these chips can extract audio more effectively and ef?ciently; less complicated algorithms can be used by the ripping softWare. As these controller chips position the read head more accurately than before, existing synchroniZed read algorithms Will also Work faster. This is because data comparisons Will match sooner and the head can then move to the next portion of data quickly. This neW feature is called “Accurate Streaming”. Drives using Accu rate Streaming can rip in a burst mode. Thus, extraction speeds are faster and the extraction is much more accurate.

[0072] The present invention ?rst contemplates perform ing the defragmentation of a magnetic hard disk, and of a

Winchester-type magnetic hard disk drive, automatically conditioned upon assessment of any of the fragmentation status of the disk, (ii) access performance to records upon

US 2004/0148476 Al

Jul. 29, 2004 the disk during use, and/or (iii) exhaustion of available disk recording space, this assessment of the remaining disk recording space being especially relevant Where the disk’s recording space has been consumed by a novel procedure

Where neWly added ?les are added to the disk sequentially from disk beginning to disk end. In simplest terms, the present invention accords for recogniZing that a Winchester type magnetic hard disk drive needs defragmentation as may be determined by any one or ones of a number of status and/or (ii) performance indices. drive

[0073] The present invention further, second, contem plates a strategy and a method for reducing the fragmenta tion of records Written upon a Winchester-type magnetic hard disk drive in the ?rst place. The method has, hoWever, a requirement—in the nature of a trade-off—that an accom

panying “defragmentation-type” operation—generally

shorter, simpler and faster than What is normally considered a defragmentation—should be often performed, especially for disk drives that become substantially full.

[0074] 1. The Particular Consequences of Hard Disk Drive

Fragmentation for Portable Digital Music Recorder/Players

[0075] The present invention is of particular utility in

non-personal-computer type portable digital devices having

read/Writable magnetic disks such as, among other similar devices, portable recorders and players of digital music (of any format). These devices are prone, as are all disk drives, to becoming fragmented during the reading and Writing of

?les. Reasonable patterns of usage of music player/recorders can make that such fragmentation accrues as, at the least, (1) negatively affects poWer consumption as the mechanical read head of the disk must be frequently repositioned during the retrieval (or Writing) of a single ?le, or, at the Worse, (2) prevents uninterrupted playback and/or (3) precludes error less recording.

[0076] Nonetheless to this occurrence—inevitable With the installing and un-installing of many ?les (i.e., song tracks) over time—digital recorder/players are being sold circa 2002 that do not even have a defragmentation capa bility. It Will thus likely be a surprise to the oWner/users of these units that, at least after some years of use during Which some interchange of the contents recorded on the disk occurs, performance may become so degraded that neW tracks (?les) cannot be accurately recorded at all, (ii) frag mented old tracks (?les) cannot be read Without discernable defects in the audio playback, and/or (iii) overall storage capacity diminishes as a function of the accrued fragmen tation of the disk. Of course, should the recording/ playback device have a computer interface and its oWner/ user have (ii) a computer (iii) accommodating this interface also With (iv) adequate storage capacity, it may be possible to off-load the disk of the device to the computer, and to then re-Write contents (i.e., ?les) onto the disk substantially sequentially, and With reduced fragmentation. HoWever, in other cases it may come as a rude surprise to the oWner/users of digital music recorder/players to note that their multi-year accumulation of music tracks has become moribund due to fragmentation problems With the hard drive of the recorder/

player.

[0077] 2. Eliminating Hard Disk Drive Fragmentation in the First Instance

[0078] The second aspect of the present invention—the strategy for reducing the fragmentation of records Written upon magnetic hard disk drives in the ?rst place—is noW

?rst discussed because, if disk fragmentation can be avoided or minimiZed in the ?rst place, then the importance of defragmentation, automatic or not, is diminished. HoWever, the elegance, sophistication and innovation in both recog niZing any need for defragmentation, and in automatically performing defragmentation, as is accorded by ?rst aspect of the present invention Will be seen to be complimentary of use With this second aspect of the present invention. In fact, and as Will be explained, both aspects have their oWn merit, and applicability.

[0079] Fragmentation avoidance in accordance With the present invention is embodied in a special method of man aging the digital recording of ?les on the hard disk drives of, most typically, generally-portable digital-recording-and playback devices, most commonly as are used for digital music. These devices most typically have only modest amounts of (1a) high-speed semiconductor memory, if not also only modest (2a) instruction set architectures and/or

(3a) logical performance capabilities, relative to the (1b) memory capacities, (2b) instruction sets, and/or (3b) com putational performance of computers. The special method is based on the recognition of several differences betWeen, on the one hand, (1) computers and their typical uses and, on the other hand, (2) digital music recorder/playback devices and their typical uses.

[0080] First, (1) computers often retrieve a program from a hard disk drive to semiconductor memory and commence to use it for a time that is relatively long, With but modest further disk references, relative to (2) a digital music player,

Which is essentially but a reading, Writing and interpretation unit for encoded records digitally Written upon the hard disk drive.

[0081] Second, any (1) buffer to the hard disk drive itself, plus (2) such buffer to the hard disk drive that is innately accorded by the relatively high-speed semiconductor memory of a computer, plus, to a much lesser importance,

(3) a possible cache memory (of even higher speed) to the computer microprocessor itself, all serve to make that a computer is more unlikely to be negatively impacted by modest levels of hard disk fragmentation than is a simple recorder/player of digital music, or the like.

[0082] Of course, one Way to attack the disk fragmentation problem Within a digital recorder/player is to put a commo dious semiconductor memory buffer Within the recorder/ player in order to substantially eliminate—if not the frequent and poWer-consuming seeks by the head of the magnetic disk—the substantial possibility of breaks in the data stream upon reading or Writing due to excessive fragmentation of the read ?les. This is, hoWever, the Wrong Way to go: (1) simply delaying the inevitable as fragmentation gets Worse and Worse, (2) increasing cost, and (3) failing to accord for such higher recording and reading rates as may in the future is to keep the disk drive adequately defragmented.

[0083] Third, a computer typically has, With its typically larger high-speed semiconductor memory and its more extensive digital logics, a better and more poWerful capa bility to defragment a hard disk drive than does a much, much less expensive recorder/player. In other Words, although a?cionados of digital music recorded in, for example, the MP3 format may keep their music tracks (?les)

US 2004/0148476 Al

Jul. 29, 2004 on both their thousand-dollar level personal computers and also on their hundred-dollar level portable recorder/players, the computer has much more “horsepower” to defragment a disk drive When and as proves necessary or prudent.

[0084] According to all these considerations, it is rela tively more desirable to prevent the hard drive of a portable

digital recorder/player device from becoming fragmented,

let alone badly fragmented, in the ?rst place than it is, by

Way of comparison, to prevent the hard drive of a personal computer from becoming equally as fragmented.

[0085] In accordance With the second aspect of the present invention, fragmentation is completely avoided upon the

initial Writing of digital records, particularly digital music,

by the simple eXpedient—implemented in the logical design of the hard disk drive recording control (micro) program— of Writing neW ?les into, and starting at the then beginning of, a (generally, relatively) commodious open and terminal area of the hard disk called “free space”. The hard disk drive

?le Writing control is set to permit neW ?les to be Written into this free space only. As the free space ?lls and as previously

Written ?les are erased, then the hard disk drive—even though erased ?les and their attendant voids have become present—is still technically non-fragmented. It is also, of course, replete With such voids betWeen records as make usage of the full storage capacity of the hard disk is at least

temporarily inef?cient, and sub-optimal.

[0086] In accordance With this second aspect of the present invention, upon the completion of ?lling the de?ned free space to some predetermined eXtent, a message Will preferably be sent, either audible or visual, to the device’s user demanding or petitioning that compaction of the hard disk drive should proceed. Although such compaction is but a simple, and degenerate, form of general defragmentation, there is little use of confusing the user With this minor distinction nor, for that matter, presenting him or her With the need to make a decision. Accordingly, the preferred form of the user notice is a visual message similar to the folloW ing: “Automatic Defragmentation Will start in [a predeter mined period of time; as is predetermined and displayed to the user]; no ?le recording can proceed until ?nished.”

[0087] The automatic simpli?ed defragmentation, as is most commonly implemented in ?rmWare, Will then start moving complete ?les upon the hard disk drive into a continuous, tight-packed, sequence commencing With space previously occupied by the noW-erased ?le closest to the beginning of the hard disk drive. The simpli?ed defragmen tation operation Will complete upon the “doWn” relocation drive Will then be registered to the control (micro)program, and available for use. By this procedure fragmentation of old or neW ?les is not possible because all ?les are Written linearly into the “free space” of the hard disk drive only.

[0088] 3. Automatic Defragmentation of a Hard Disk

Drive

[0089] In its primary aspect the present invention is embodied in an automatic defragmentation method. The

“automatic” of the method is more for the recognition of

When a hard disk drive—particularly as may be used in a

generally-portable digital-recording-and-playback device

most commonly as is used for music—needs defragmenting than for the manner of actually conducting the defragmen tation of ?les, Which is substantially conventional.

[0090] In accordance With the present invention, fragmen tation of a hard disk drive is automatically detected either directly, by reading the records (?les) stored upon the hard drive and assessing the eXtent of their fragmentation, and/or

(ii) indirectly, by assessing read/Write performance of the

hard drive in a manner that is unique, and un-associated With computers.

[0091] When fragmentation is detected directly, then either a factory fragmentation level is preset, or a user de?nable fragmentation level is set, and thereafter fragmen tation is automatically checked upon each start up of the mobile or non computer hard disk drive device. If the fragmentation level is detected to be under the factory or user de?nable preset/set, then the further automatic defrag mentation function is by-passed. If the fragmentation level is at or above factory or user de?nable preset/set, then the further automatic defragmentation function is activated.

[0092] The automatic defragmentation preferably pro ceeds by ?rst checking the poWer levels to ensure defrag mentation can be accomplished Without poWer loss. Next an alert audible or visual or both is sent to the user stating automatic defragmentation is required and Will start in a variable preset amount of time, permitting the user to disable this function if he chooses not to proceed. Upon automatic start-up or user manual initiation of defragmentation, all operational functions of the non-computer hard disk drive device Will normally be locked out, and disabled, for the duration of the defragmentation operation. Sometimes, hoW ever, certain or all of the operational functions of the device are non-con?icting With (certain, normal) defragmentation processes, and may be permitted to transpire in even time

With the defragmentation. In this case the “automatic defrag mentation” or, more properly, the ?le defragmentation por tion thereof, is said to transpire “transparently in the back

ground”. The permitted operational functions alWays

eXclude poWering off, or shutting doWn, the hard disk drive.

[0093] As is substantially conventional in a hard disk drive

?le defragmentation process, the hard disk drive is ?rst analyZed by the auto-defragmentation program Which is, for the instance of a portable digital device, commonly imple mented in ?rmWare. Defragmentation of the hard disk drive then occurs; protecting the ?le allocation tables (FATs) and

?le structures While realigning the segments and clusters to eliminate fragmentation of the ?les.

[0094] After completion of the auto-defrag function, a reanalysis of the hard disk drive preferably occurs automati cally. Status is preferably displayed to the user as either

“complete” or “?nished” or the like and, preferably, the neWly-adjusted free space capacity of the hard disk drive— especially if changed because of the defragmentation—is

preferably displayed.

[0095] Further in accordance With the present invention, it is alternatively possible to (ii) indirectly assess the fragmen tation level of a hard disk drive by assessing the read/Write performance of the hard disk drive. This assessment depends upon having a general, if not also a speci?c (derived from the ?le allocation tables), knoWledge of the siZe and (ii) nature of the ?les that are stored in the digital device, and the

(iii) normal manner of their use. The assessment is thus not suitable to a computer, Where ?les of many different lengths, types and uses are stored on the computer’s hard disk drive.

[0096] HoWever, a straightforWard, and important, eXample of Where such an assessment may usefully be made

US 2004/0148476 A1

Jul. 29, 2004 or other format—of a digital music recorder/player device.

Many of these ?les Will exceed a certain siZe, as is charac teristic of a song or other musical Work. The substantial number of ?les may be assumed to contain digital music.

Finally, one normal manner of the use of these ?les is to read then out from beginning to end, as permits the playing of music.

[0097] The (micro)program that causes the reading of digital data from the disk can, by reference to a Watchdog timer or the like, or to an interrupt attendant upon a buffer under?oW of the like, that there has been an interruption in the retrieval of the digital data, and in the playing of What is presumed to be music. An occurrence of this for one, or some feW, times may not be conclusive of anything. HoW ever, an up-doWn “pseudo fault” counter may be kept, and/or like programming techniques employed, to determine both

(i) Whether things are changing (i.e., getting Worse) over time, and/or (ii) Whether defragmentation—Which may be at times and from time to time user initiated—has any affect on the occurrence of apparent “faults”. If the user seems to like to manually initiate defragmentation of the hard disk drive—putatively for cause—and (ii) some change of some moment can be detected in the “fault” counter, then the

?rmWare program can act to thereafter alert the user to a detected accrual, or escalation, in detected “faults”, and ask the user to approve an automatic defragmentation of ?les.

[0098] This alternative method does not alWays Work to detect a single, or some feW, highly fragmented ?les. This method may take some time—dependent upon the types and lengths of ?les being processed, the user attentiveness to the audio output and his/her action (if any) dependent upon any detected faults in this output, and/or the effectiveness of the

(micro)program to recogniZe that an untoWard condition is

(re)occurring—to stabiliZe, and to contribute to the conduct of defragmentation When, and only When, both propitious and timely. HoWever, this alternative method does have the advantage of Working in a hard disk drive device that is never shut off, and/or is shut off infrequently relative to its accrual of unacceptable fragmentation levels.

[0099] It is possible to use both methods at once, both directly and indirectly assessing the need for defragmenting the hard disk drive.

[0100] These and other aspects and attributes of the present invention Will become increasingly clear upon ref erence to the folloWing draWings and accompanying speci

?cation.

BRIEF DESCRIPTION OF THE DRAWINGS

[0101] Referring particularly to the draWings for the pur pose of illustration only and not to limit the scope of the invention in any Way, these illustrations folloW:

[0102] FIG. 1 is a schematic diagram of an exemplary digital hard disk drive device, to Wit: a portable combination

CD-ROM and MP3 recorder-player, in Which any of the automatic defragmentation methods of the present invention are operative.

[0103] FIG. 2 is a How chart of a preferred embodiment of a ?rst automatic defragmentation method in accordance

With the present invention.

[0104] FIG. 3 is a How chart of a preferred embodiment of a ?rst automatic defragmentation method in accordance

With the present invention.

[0105] FIG. 4 is a How chart of a less preferred embodi ment of only a defragmentation operation as may be per formed as part of the automatic defragmentation of the present invention.

DESCRIPTION OF THE PREFERRED

EMBODIMENT

[0106] The folloWing description is of the best mode presently contemplated for the carrying out of the invention.

This description is made for the purpose of illustrating the general principles of the invention, and is not to be taken in a limiting sense. The scope of the invention is best deter mined by reference to the appended claims.

[0107] Although speci?c embodiments of the invention

Will noW be described With reference to the draWings, it should be understood that such embodiments are by Way of example only and are merely illustrative of but a small number of the many possible speci?c embodiments to Which the principles of the invention may be applied. Various changes and modi?cations obvious to one skilled in the art to Which the invention pertains are deemed to be Within the spirit, scope and contemplation of the invention as further de?ned in the appended claims.

[0108] 1. An Exemplary Digital Hard Disk Drive Device on Which any of the Automatic Defragmentation Methods of the Present Invention are Operative disk drive device—to Wit: a portable combination CD-ROM and MP3 recorder-player—in Which any of the automatic defragmentation methods of the present invention are opera tive is shoWn in the schematic diagram of FIG. 1.

[0110] This entire section 1 is substantially only to shoW, and explain, that in a disk-based digital recorder/player, digital records—digitaliZed music ?les—are at times, and from time to time, recorded to and read from the hard disk drive. Moreover, in doing so, the records, or ?les, become fragmented. Readers Who ?nd this simply concept com pletely clear and blatantly obvious may usefully skip to the next section 2. Other readers Who Want to knoW exactly hoW, under programmed control, digital data encoding music

(sound) may be moved to and from a hard disk drive for purposes of Writing (recording) and for reading (playing) may usefully read this section 1.

[0111] The device of FIG. 1 is the subject of the inventor’s co-pending US. patent application Ser. No. 09/860,935 ?led

May 18, 2001, for a PORTABLE CD-ROM/ISO TO HDD/

MP3 RECORDER WITH SIMULTANEOUS CD-READ/

MP3 -ENCODE/HDD-WRITE, OR HDD-READ/MP3

-DECODE, TO PLAY, POWER-SAVING BUFFER, AND

ENHANCED SOUND OUTPUT. That application is itself descended from, and claims bene?t of priority of, US. provisional patent application Serial No. 60/205,936 ?led on

May 18, 2000 for an ECHO MUSIC SYSTEM. This par ticular device, and its salient characteristics, are in no Way required for the practice of any and all of the methods of the present invention. The device of FIG. 1 simply represents one, exemplary, platform upon Which the methods of the present invention may usefully be implemented.

US 2004/0148476 A1

Jul. 29, 2004

[0112] For the sake of completeness, the explanation of the device as explained in the companion predecessor appli cation is as folloWs:

[0113] The device of FIG. 1 supports as its principle function the playing and recording of digitally encoded music. More particularly, it conventionally performs a sequence of 1) ?rst-converting at a ?rst time successive

?rst-bit-length ?rst-encoded ?rst digital Words to a ?rst analog signal; 2) ?rst playing at the ?rst time this ?rst analog signal through speakers or headphones or the like to the human ear, While also 3) second-encoding and re-digitiZing, preferably at the ?rst time, this ?rst analog signal into a successive second-bit-length second-encoded second digital

Words, folloWed by 4) storing these second digital Words until, at a later second time, 5) second-converting the second digital Words into a second analog signal, and 6) second playing also at the second time this second analog signal through speakers or headphones or the like to the human ear, or the like.

[0114] In this substantially conventional sequence the device of related application realiZes, inter alia, (1) (re

)encoding an audio Wave form (for later playback) in a longer code Word, and better encoding format, than that

Word and format in Which the audio Wave form Was initially encoded; (2) conserving poWer in a portable CD-ROM and

MP3 player-recorder by various strategies of (2a) minimiZ ing data references to a hard disk drive (HDD) by use of a large data buffer, (2b) eliminating any reference to the HDD

for instructions, and (2c) eliminating any microprocessor (in

performance of MP3 encoding/decoding); (3) simulta neously reading cd-rom While encoding MP3 and Writing a

HDD, or reading the HDD and decoding MP3; (4) the retrospective selection of songs for recording; and (5) com puterless high-speed transfer betWeen MP3 player-record ers, commonly called a “bulk dump”.

[0115] The elements of the recorder-player device shoWn in the schematic diagram of FIG. 1 appearing beloW the horiZontal dashed line are substantially pre-existing and conventional. The elements of the invention that is the subject of the related invention are substantially shoWn above the horiZontal dashed line—although the nature and function of these particular elements is in no Way required for operation of the present invention.

[0116] Referring to FIG. 1, beloW the horiZontal dashed line a Motor Driver 12, preferably type MM1538 or

FAN8038, poWers rotation of a CD-ROM (not shoWn) so that a Servo 11, preferably type CXA2550, CXD3068

OPU(KSM900), under control of a Micro-controller 13, Will deliver, during rotation of the CD/ROM digital data in the form of ISO CD/ROM code Words to the digital signal processor MP3 DSP 14, preferably type RSM88131A or

TR2101. The entire CD mechanism may be, for example,

Sanyo type DA23.

[0117] The digital data from the CD/ROM is buffered in a each (NOTE: this buffer memory should not be confused

With the buffer Memory 32). Decoded digital data—repre senting an audio Wave form—from the MP3 DSP goes to audio digital-to-analog converter DAC 15, preferably type

WM8725 or AK4352, and also to MP3 Encoder/Decoder 34

Which is a neW chip type YMPC-3001 from Yountel of

Korea.

[0118] MeanWhile, an audio signal from the DAC 15 goes to audio companding de-companding circuit Audio CODEC

33, preferably type UDA1342TS from Philips.

[0119] The elements added to this base structure of a

CD/ROM reader in order to realiZe the combination

CD/ROM and MP3 recorder-player are noW introduced in the context of an exemplary function that, at various times and under various user/operator control, is performed by these element. One function, and operational mode, of the combination CD/ROM and MP3 recorder-player is called

“play, and record from analog”. In this operational mode, and for this function, an audio signal from the DAC 15

40 of nominal 12 db gain, and then to Headphone Amp 17, and then for play to any of Headphone 18a, and/or (ii)

Speaker 18c1, and/or (iii) through Radio Transmitter 18a'1 and antenna 18a'2 via a loW poWer radio signal (preferably

FM) to a proximate radio (not shoWn) for reception and play through the sound output system of the radio. MeanWhile this audio signal is also passed through the Audio CODEC

33 to the MP3 Encoder/Decoder 34 Where it is encoded to

MP3 code, preferably at a 24 bit code Word bit length.

[0120] The MP3 encoded data is passed though the ?le substituted for purposes of the present invention a micro processor—?rst to the buffer Memory 32, Which is prefer ably of the FLASH or DRAM types. When the buffer

Memory 32, Which is preferably 64K or larger in siZe, becomes ?lled, then its contents (such as are then selected for permanent recording) are moved en masse through and the Winchester type, and is more preferably a magnetic disk of 10 Gbyte or greater capacity.

[0121] At the conclusion of the “play, and record from analog” operation, the audio CD/ROM has been played, and

MP3 encoded data in respect of the contents thereof the

CD/ROM lodged on the Hard Disk 30.

[0122] Another, similar, function, and operational mode,

of the combination CD/ROM and MP3 recorder-player is called “play, and record from digital”. In this operation mode a digital signal (re?ective of an analog audio Wave form) from the MP3 DSP 14 bypasses Audio CODEC 33 and is sent to MP3 Encoder/Decoder 34. The decoding of this signal to analog audio is sent to the Audio CODEC 33 and then to the Ampli?er 40 and so on, meaning to the Head phone Amp 17, and then for play to any of Headphone

18a, and/or (ii) Speaker 18c1, and/or (iii) through Radio

Transmitter 18a'1 and antenna 18a'2 via a loW poWer radio signal (preferably FM) to a proximate radio (not shoWn) for reception and play through the sound output system of the radio.

[0123] MeanWhile the MP3 encoded data from the MP3 undergoes the same treatment as it Was previously. Namely, it is passed ?rst to the buffer Memory 32 and then, When the buffer Memory 32 becomes ?lled, the MP3 data is moved en masse through and by the MPU 31 to the Hard Disk 30,

Where it is stored.

[0124] Accordingly, at the conclusion of the “play, and record from digital” operation, the audio CD/ROM has again been played, and MP3 encoded data in respect of the contents thereof the CD/ROM has again become lodged on the Hard Disk 30.

US 2004/0148476 A1

Jul. 29, 2004

[0125] Both the “play, and record from analog” opera tional mode illustrated in FIG. 2a, and, more preferably, the

“play, and record from digital” operational mode illustrated

Memory 32. The MPU 31 also serves to issue successive

MP3-encoded data Words to the MP3 Encoder/Decoder 34 noW acting as an MP3 decoder. The MP3 data decoded to a companded and encoded audio signal is sent to the Audio

CODEC 33 Where it is de-companded and further decoded to produce the pure audio signal sent to the Ampli?er 40. As is by noW understood, the path of the audio signal from the

Ampli?er 40 ultimately permits that it is transduced to sound in, by Way of example, Headphone 18a.

[0127] The portable combination CD/ROM and MP3 recorder-player of FIG. 1 may transfer MP3 data to a like unit—normally over a code-Word or otherWise protected

proprietary transfer-level-protocol-protected interface—to

an identical, or like, unit. MP3 data from the Hard Disk 30 is transferred by action of MPU 31 to be buffered in buffer

Memory 32 and then, as called for by Display/Keyboard

Processor 35—Which manages the Universal Serial Bus 38a, or the Infrared Transceiver 38b for purposes of data transfer to the other device—to the Display/Keyboard Processor 35 and to the Duplicate Unit 1a over, by Way of example, a

Universal Serial Bus 38a or an Infrared Transceiver 38b.

[0128] Needless to say, this transfer can be very fast, up to

10 Mbits/second. Accordingly large numbers of tracks of musical Works Which are stored in MP3 (or related) com pressed format on the Hard Drive 30 of one unit may be transferred in gross, (ii) in accordance With a “transfer list” analogous to a “play list”, (iv) as differing in title, or (v) track by track under user control, to the Hard Drive 30 of the other unit. The transfer mode (iv) is especially poWerful, permitting a user/operator/oWner With a virgin Hard Drive but access to another fully populated CD/ROM and MP3 recorder-player in accordance With the present invention

(such as might be oWned by a friend) to load large numbers of musical Works, typically up to the approximately 1200 that Will ?t Within a 10 Gbit disk storage, to his/her unit in mere minutes.

[0129] Additional elements shoWn in the schematic of

FIG. 1 Will be substantially self-explanatory to a practitio ner of the electronic music system design arts. PoWer is

normally supplied through three separate options: 1) 110

220 volt a.c. input, 2) a battery jack, or 3) batteries. Inputs to the Audio CODEC 33, and associated operational modes, are provided to digitaliZe (to MP3 format) and record audio information both from a Radio 42a (using an antenna 42b) and a Microphone 43. The Keyboard/Keypad Processor 35 manages the poWer selection and control, and the operator interface via the Keypad 37 and the Dot Matrix Display

Module 36. An output port for the audio signal is provided through plug jack Line Out 39. be played in real time, (ii) the entire process of MP3 encoding and storage may be run faster, essentially as fast as the Weakest link in the chain of reads, decodes and/or conversions, and Writes Will run. Normally the Weakest link is the CD/ROM, Which is then spun at 4x to 6x normal speed. Because of settling time in the de-companding cir cuits of the CODEC 33, it is preferred that the MP3 encoded data be developed in and by the “record from digital” operational mode.

[0126] The entire purpose of logging MP3 data to the Hard

Disk 30 has been, or course, to provide for later retrieval and play. In an operational mode, and function, to “playback

MP3 from hard disk” operational mode of the player recorder. During playback the MP3 data from the Hard Disk automatic defragmentation method in accordance With the present invention is shoWn in FIG. 2. In this method both the

?les and “free space” of the disk are fragmented, and the defragmentation procedure performed serves to defragment both. Namely, the ?les are made to be contiguous upon the disk one ?le folloWing another, normally commencing at the beginning of the disk, While the free space remaining, ex of the ?les, upon the disk is located as one contiguous area, normally at the end of the disk.

[0132] In the preferred ?rst method shoWn in the How chart of FIG. 2, the controller (i.e., control logics) of that digital recorder/player Which incorporates as (one of its) storage media a hard disk is in a master “idle” control loop

201, Which condition is alWays assumed When the recorder/ player is “on” (i.e., energiZed) and is not presently tasked to play, or to record, or to convert in format, digital ?les,

normally digital music.

[0133] In decision box 202 the question is asked as to

Whether or not the recorder/player is idle, meaning devoid of playing or recording or converting tasks. The most common ansWer to this question is “no”, making entrance into block

206 to process any normal recorder/player operations is made via path 203. At the conclusion of each such operation, the decision block 202 is re-entered via path 205.

[0134] When in decision block 202 the question as to

Whether or not the recorder/player is idle is ansWered “yes”, then another, second, decision block 204 is entered via path

207. If the question “does the hard disk drive (HDD) need defragmentation” asked in this block is ansWered “no”, then block 206 is entered as before.

[0135] If, hoWever, the HDD is determined in decision block 204 to need defragmentation, then a linear path through blocks 208, 210, 212, 214 and 216 is entered. The decision may be so ansWered “yes” based on any one or ones of criteria including (1) seeks (repositionings of the disk read head) in the retrieval of a single record (as such record may further be quali?ed by length or by time) (Which record is most commonly a single digital musical Work) having exceeded a certain threshold, (2) any “breaks” having exceeding a certain threshold time in the How of data (most typically representing audio data) in a previous read of a record (normally a song “track”), and/or, most commonly and in full accordance With that particular preferred method that is ?oW-charted in FIG. 2, (3) running to the end of a que of disk space because all ?les Were contiguously Written at the then-existing “end” of the When ?rst recorded, and must noW be compacted. (This compaction is of course possible only When some recorded ?les have since been deleted.)

[0136] The sequence of defragmentation in blocks 208,

210, 212, 214 and 216 is entered. PoWer levels are ?rst checked in block 208 to ensure defragmentation can be

US 2004/0148476 A1

Jul. 29, 2004 accomplished Without power loss. An audible or visual alert

(or both) may optionally be sent to the user indicating that automatic defragmentation is required and Will start in a variable preset amount of time unless disabled by the user.

Upon automatic start-up or user manual initiation of defrag mentation, all operational functions of the non-computer hard disk drive device Will normally be locked out, and disabled, for the duration of the defragmentation operation.

[0137] The recorded sectors of the hard disk drive are analyZed by the auto-defragmentation program in blocks

210 and 212. This Well-knoW function is, for the instance of a portable digital device, commonly implemented in ?rm

Ware. Defragmentation of the hard disk drive then occurs in blocks 214 and 216. The ?le allocation tables (FATs) and ?le structures While realigning the segments and clusters to eliminate fragmentation of the ?les.

[0138] After completion of the auto-defrag function, a reanalysis of the hard disk drive preferably occurs automati cally as shoWn in the path 205 leading back to decision blocks 202 and 204. Defragmentation may even be per formed iteratively, but, unless a user has steadfastly resisted automatic defragmentation While proceeding to fragment his or her disk drive, need not normally be so performed.

[0139] Status is preferably displayed to the user as either

“complete” or “?nished” or the like and, preferably, the neWly-adjusted free space capacity of the hard disk drive— especially if changed because of the defragmentation—may

optionally be displayed.

mentation method in accordance With the present invention is shoWn in FIG. 3.

[0142] The crucial block 304 determines the need for defragmentation. If successively recorded ?les are not Writ ten to the “end” of the hard disk drive, as in the method of the previous section 2, then automatic initiation of defrag mentation contingent upon reaching the “end” of the record able area is clearly inappropriate. Nonetheless, those other criteria of the previous section by Which a need for defrag mentation is determinable are still validly made in block

304. In accordance With the present invention, it is alterna tively possible in block 304 to indirectly assess the frag mentation level of a hard disk drive by assessing the read/Write performance of the hard disk drive. This assess ment depends upon having a general, if not also a speci?c in the playing of What is presumed to be music. Occurrence of but one, or some feW, times are not normally determina tive of a requirement for defragmentation of the hard disk.

HoWever, an up-doWn “pseudo fault” counter may be kept, and/or like programming techniques employed, to determine both Whether things are changing (i.e., getting Worse) over time, and/or (ii) Whether defragmentation—Which may be at times and from time to time user initiated—has any affect on the occurrence of apparent “faults”.

[0144] If the user seems to like to manually initiate defragmentation of the hard disk drive—putatively for cause—and (ii) some change of some moment can be detected in the “fault” counter, then the ?rmWare program can act to thereafter alert the user to a detected accrual, or escalation, in detected “faults”, and ask the user to approve an automatic defragmentation of ?les.

[0145] This might be called “adaptive defragmentation”; namely, defragmentation proportional to both (1) the ?les

Written, stored and read, and (2) the uses to Which they are put—regardless of What are the ?les or the uses. This is a very poWerful technique. For eXample, consider the battle

?eld of the future Where a combatant may assimilate data upon the hard drive of his (or her) “Wearable” computer.

Some specialiZed combatants may shoot (and ultimately transmit) digital video records of battle, battlegrounds, tac tical dispositions and situations and the like, Which digital video records Will generally be quite voluminous. Other specialiZed combatants may be probing the environment,

monitoring machines, and accumulating and reporting digi

tal status records in batches at times and from time to time.

These digital status records are generally short.

[0146] Clearly the hard drives of both combatants Will, ultimately, require defragmentation. Once the concepts of the present invention are assimilated, programmers or advanced skills are eXpected to be able to think just as clearly about strategies and practice for the maintaining the combat system disk drive as, for eXample, accumulating and using poWer from the poWer pack of the combat system.

[0147] The block 306 of FIG. 3 is analogous, and per forms the like function, to block 206 of FIG. 2. The fetching of the unused sectors in block 308, and the relocation of ?les in block 308, realiZe a simple, and “brute force”, form of

defragmentation.

[0148] 4. A Less Preferred Method of Defragmentation

DraWing Attention to the Present Invention as Primarily any

Form of Defragmentation Automatically Performed Predi cated on Fragmented Conditions Sensed, and not as any

Particular Algorithm for or Process of Defragmentation device, and the (iii) normal manner of their use. This type of assessment is thus not suitable to a computer, Where ?les of many different lengths, types and uses are stored on the computer’s hard disk drive. It is, hoWever, generally suitably applied to assess the substantially linear Writing and reading, mostly at a substantially even data transfer rate, of substan tially even-length (generally Within a multiplier factor of, most commonly, x4), ?les of digital music.

[0143] As a still further alternative, or complimentary, evaluation performed in block 304, a (micro)program that causes the reading of digital data from the disk can, by reference to a Watchdog timer or the like, or to an interrupt attendant upon a buffer under?oW of the like, that there has been an interruption in the retrieval of the digital data, and a defragmentation operation as may be performed as part of the automatic defragmentation of the present invention is shoWn in FIG. 4. In so shoWing only the process of defragmentation, and not hoW it might be entered into in an automated fashion, the How chart of FIG. 4 corresponds to the right column only of FIGS. 2 and 3.

[0150] FIG. 4 is included in this speci?cation not simply as an alternative method of defragmentation—of Which there are many in the prior programming arts and of Which the particular method of FIG. 4 is not particularly elegant— but in order to draW attention to the present invention as primarily any form of defragmentation automatically per

US 2004/0148476 A1

Jul. 29, 2004 formed predicated on fragmented conditions sensed, and not as any particular algorithm for or process of defragmenta tion. In simplest terms, the forte of the present invention is not simply that defragmentation may be performed, or that it may preferably be so performed by neW methods that are particularly Well suited to a hard disk used for the substan tially linear Writing and reading at substantially even demand rates of substantially even-length (generally Within a multiplier factor of, most commonly, ><4) ?les of digital music. Instead, the forte of the present invention—to Which the preferred methods are admittedly contributory, inte grated, and effective—is to recogniZe that, and When, defragmentation should be performed in the ?rst place.

[0151] Therefore, by shoWing yet another substitute (sub

stantially) for the right column of FIGS. 2 and 3, FIG. 4 actually serves to emphasiZe the block “Does HDD need defrag?” in both FIGS. 2 and 3. As explained in the

Background of the Invention section of this speci?cation, this question is not be asked, (ii) is being asked too seldom, and/or (iii) is being asked inappropriately, and

Without consideration of those factors taught herein that properly make that a disk—especially as is used in recording

(Writing), storing and playing (reading) digital music—

needs defragmentation.

[0152] In interpretation of FIG. 4, the “File SiZe” is the number of sectors, clusters, or other storage units needed to hold the data. “Contiguous” means that the ?le data is in one or more continuous sequential block(s) upon the hard disk drive. “Condense” means to move ?le data until it is contiguous. “Size Match” means that the siZe of each of arbitrary ?les under evaluation is related to the “Free Space

Block” (“FSB”) siZe presently being ?lled, using a best ?t

algorithm.

[0153] Assumptions in the operation of the defragmenta tion of FIG. 4 are that minimal CPU memory is available (or at least used). The ?les are not buffered in RAM, only the ?le tables. Further, approximately 10% to 15% of the recording area of the hard disk drive is free space, With at least one large open block alWays being greater than or equal to the largest fragmented ?le. Finally in the ?oW-charted method the tables can hold part of the ?le system information in a sliding WindoW scheme.

[0154] These constructs Will be Well understood by those skilled in the programming arts, as Will the defragmentation process of FIG. 4 Without further explanation.

[0155] In accordance With the preceding explanation, variations and adaptations of the automatic defragmentation method in accordance With the present invention Will sug gest themselves to a practitioner of the digital computer programming arts.

[0156] For example, delays to fragmentation could be monitored by hardWare “Watchdogs” so as to trigger soft

Ware processes (of the preferred types taught herein).

[0157] In accordance With these and other possible varia tions and adaptations of the present invention, the scope of the invention should be determined in accordance With the folloWing claims, only, and not solely in accordance With that embodiment Within Which the invention has been

taught.

What is claimed is: hard disk drive comprising:

Writing any and all neW ?les onto the hard disk drive starting at a location Which is then, at the time of the

Writing of each ?le, at the beginning of a commodious open and terminal area of the hard disk called the “free space” of the hard disk, one ?le folloWing the next in sequence as and When each ?le is Written until, the free space of the disk becoming ?lled to a predetermined extent, simpli?ed-defragmenting ensues, the simpli?ed-defrag menting simply moving each ?le upon the hard disk toWards the beginning of the hard disk, and into tight packed proximity With a neighboring earlier ?le, as is possible, the simpli?ed-defragmenting making that ear lier unerased unmodi?ed recorded ?les upon the hard disk become tightly packed together While, to such extent as the tight packing of ?les opens up space upon the disk, the free space of the disk is reconstituted in

Whole or in part;

Wherein if a speci?ed ?le in the tight-packed area of the disk is erased, or modi?ed, then neither it nor any other and neWly-Written ?le are then Written into the hard disk space previously occupied by the speci?ed ?le,

Which space is simply cleared, but any modi?ed ver sion of this ?le Will instead be Written into the “free space” area of the hard disk;

Wherein fragmentation of records is substantially avoided at the cost of having to perform simpli?ed-defragment ing Where ?les not tightly packed are moved into tight-packed positions upon, and from the beginning of, the disk drive.

2. The method according to claim 1 that, When the free space of the disk has become ?lled to the predetermined extent, further comprises: alerting a user of the hard disk drive that the simpli?ed defragmenting Will ensue.

3. The method according to claim 2 that, When the free space of the disk has become ?lled to the predetermined extent and the user alerted, further comprises: permitting the user to postpone the simpli?ed-defrag

menting.

4. The method according to claim 1

Wherein recording of neW ?les upon the hard disk drive is prohibited during duration of the simpli?ed-defrag

menting.

5. An automatic defragmentation method for a hard disk drive comprising: recogniZing during normal use of the hard disk drive, and

Without any manual or any scheduled invocation of any fragmentation assessment routine, When ?les of a hard disk drive are undesirably fragmented; and, respon sively to the recogniZing, defragmenting the ?les of the hard disk drive until they are at least temporarily no longer recogniZed as unde

sirably fragmented.

6. The hard disk drive automatic defragmentation method according to claim 5 Wherein the recogniZing comprises:

US 2004/0148476 A1

Jul. 29, 2004 directly reading the ?les stored upon the hard drive; and assessing the eXtent of their fragmentation.

7. The hard disk drive automatic defragmentation method according to claim 6 Wherein the assessing of the eXtent of the fragmentation of ?les is relative to a level preset for the hard disk drive upon manufacture of any device in Which the hard disk drive is contained.

8. The hard disk drive automatic defragmentation method according to claim 6 Wherein the assessing of the eXtent of the fragmentation of ?les is relative to a level set for the hard disk drive by a user of a device in Which the hard disk drive is contained.

9. The hard disk drive automatic defragmentation method according to claim 5 Wherein the recogniZing comprises: indirectly assessing read/Write performance of the hard drive so as to impute the fragmentation condition of the

?les.

10. The hard disk drive automatic defragmentation method according to claim 5 Wherein the defragmenting

comprises:

?rst checking poWer levels of a device in Which the hard disk drive is contained to ensure defragmentation of

?les can be accomplished Without eXhaustion of poWer.

11. The hard disk drive automatic defragmentation method according to claim 5 Wherein the defragmenting

comprises:

making an alert to the user of a device in Which the hard disk drive is contained, the alert stating both that automatic defragmentation is required and Will start in a variable preset amount of time.

12. The hard disk drive automatic defragmentation method according to claim 11 Wherein the defragmenting further comprises: permitting the user to postpone defragmenting if he/she chooses not to proceed.

13. The hard disk drive automatic defragmentation method according to claim 5 Wherein normal operational functions using the hard disk drive are disabled in a device in Which the hard disk drive is installed for the duration of the defragmenting.

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement