iPod How Do iPods Load?

DeeGee48

macrumors regular
Original poster
Jun 28, 2007
215
15
Havertown, Pa
Just wondering....Does anybody know how HDD iPods load their material? Is there anything to read on this? What I mean is this. Let's say I load 10 CD's. Next, I add a movie. Then 10 more CD's and some iTunes downloads. After awhile I take the movie off. Now: what happens to the space where the movie WAS? Does Does iTunes re-load the iPod at that point (after the first 10 CD's), moving everything up, or does it "fill in" only as I add more songs, TV shows etc? I guess I'm wondering how it de-frags....Anybody know?
 

iBlue

macrumors Core
Mar 17, 2005
19,174
15
London, England
I am not sure I understand the question.

Loads? You mean when you import a CD?

iPods do as you tell them to, when they're plugged in and mounted they sync (as directed in preferences. you can choose to only sync and add certain things). If you remove the movie/song/whatever from your iTunes library, it will be removed from the iPod when you next sync it.
 

sammich

macrumors 601
Sep 26, 2006
4,281
212
Sarcasmville.
Okay I'll bite. The answer to your question is as easy as this:

The iPod is just like another hard drive to your computer. So whatever file system it is formatted as is how information is organised on the disk. It may just seem different since you may have disk mode turned off, or it just seems like iTunes is the only way to manage the information on the iPod.
 

rbroady

macrumors regular
Jul 17, 2007
142
0
Its just like any other harddrive, the information is always there, its not until you write over it that it goes away.
 

SilentCrs

macrumors regular
Nov 2, 2006
215
0
You guys are totally missing what he's saying.

What he's asking is if the iPod intelligently reclaims blocks of storage when files are deleted. The short answer is: no one knows.

The problem, defined: say you have the following files stored in sequence on your iPod:

[4 MB song][8 MB song][5 MB song]

You delete the middle song:

[4 MB song][8 MB space][5 MB song]

You add a 6 MB song:

[4 MB song][6 MB song][2 MB space][5 MB song]

In most modern filesystems, that 2 MB will sit there, waiting to be filled up by a really small file. If you never add a small file again, that's wasted space.

Mac OS X has an automated defrag process for the system volume. This reorders the files and ensures the free space gets pushed together. However, it's unclear if the iPod does this. My guess is "no". It only really reclaims space when being wiped/restored.
 

Black Belt

macrumors 6502a
Jun 15, 2007
710
368
California
You don't understand how hard drives or data works. It doesn't really matter where the space is. Space doesn't need to be "reclaimed" by wiping or anything like that.
 

SilentCrs

macrumors regular
Nov 2, 2006
215
0
You don't understand how hard drives or data works. It doesn't really matter where the space is. Space doesn't need to be "reclaimed" by wiping or anything like that.
Excuse me? I manage dozens of TBs on large RAIDs for a living.

Every modern file system stores files like I've described above. When storage is completely full it starts fragmenting files across the smaller spaces -- hence the need for a defrag.

You are ALWAYS going to have wasted space. Whether it's a couple of blocks or MBs. You are ALWAYS going to get a slower system if the device needs to piece together sections of the file across the volume.

The question is: when does the iPod recover space and piece together files that are disjointed (i.e. defragment). I don't think it does, and my point is that a wipe would essentially "force" it to place the files contiguously.
 

Mugetsu

macrumors newbie
Jul 29, 2007
20
0
wow, I had no idea that so many people have absolutely no clue as to what "defraging a hard drive" does.
 

TranceNW

macrumors regular
Aug 18, 2007
156
4
Essex, United Kingdom
Just wondering....Does anybody know how HDD iPods load their material? Is there anything to read on this? What I mean is this. Let's say I load 10 CD's. Next, I add a movie. Then 10 more CD's and some iTunes downloads. After awhile I take the movie off. Now: what happens to the space where the movie WAS? Does Does iTunes re-load the iPod at that point (after the first 10 CD's), moving everything up, or does it "fill in" only as I add more songs, TV shows etc? I guess I'm wondering how it de-frags....Anybody know?
If you remove that movie, iTunes does not need to then reload every single song back on to your iPod, if thats what you mean.
 

Black Belt

macrumors 6502a
Jun 15, 2007
710
368
California
Excuse me? I manage dozens of TBs on large RAIDs for a living.
Congratulations, I hire workers like you. Dozens of TBs on Raids - Woooo. Was that meant to impress? I have a couple 3 TB Raids in my house alone. Now if you tried bragging with Petabytes or even a single Exabyte I might be impressed.

"In most modern filesystems, that 2 MB will sit there, waiting to be filled up by a really small file. If you never add a small file again, that's wasted space."

Bwahahaha, then how does a disk ever get fragmented! :rolleyes:

Files are not always placed in a contiguous space. Slots like you described are filled with partial files. So pieces of one file may be located in several places, all tracked by a file table. Sure it runs slightly slower, depending on the level of fragmentation and what you are doing.

As far as the iPod, it makes no effort to defrag the drive, but yes, wiping it and reloading it would defrag it. That it might be worth the time and effort and have any noticable effect is probably marginal.
 

SilentCrs

macrumors regular
Nov 2, 2006
215
0
wow, I had no idea that so many people have absolutely no clue as to what "defraging a hard drive" does.
Defragging reorders blocks of files on a volume so that they're next to each other. This speeds reads.

Congratulations, I hire workers like you.
Sorry, I don't work for jackasses.

Dozens of TBs on Raids - Woooo. Was that meant to impress? I have a couple 3 TB Raids in my house alone. Now if you tried bragging with Petabytes or even a single Exabyte I might be impressed.
How do you think you get to Petabytes? 1 giant RAID? When I say "RAIDs", I mean hundreds of individual RAIDs set up across different sites. If you want me to make it simple for you, yes, I manage "Petabytes" distributed across 9 worldwide sites, mostly with active-active clusters connected to them. The Petabytes are broken down into 72 TB RAIDs (the limit on the EVAs we're working on). Happy?

Files are not always placed in a contiguous space. Slots like you described are filled with partial files. So pieces of one file may be located in several places, all tracked by a file table. Sure it runs slightly slower, depending on the level of fragmentation and what you are doing.
If you read my later reply you would've noticed I said exactly that.

In regards to my first reply, I left out something:

"In most modern filesystems running embedded OSes, that 2 MB will sit there, waiting to be filled up by a really small file. If you never add a small file again, that's wasted space."

Most embedded OSes don't bother to fragment files across volumes. It can waste unnecessary power and CPU cycles that are better spent on, oh, I don't know -- managing the OS and playing media files.

As far as the iPod, that it makes no effort to defrag the drive seems obvious, but yes, wiping it and reloading it would defrag it. That it might be worth the time and effort and have any noticeable effect is probably marginal.
If you're talking about an iPod Nano with 4 GB of music, yes, defragging would be of little benefit. If you're talking about a 60 GB iPod with massive video files, assuming the files are broken into chunks and spread across the volume, you're talking about potentially unnecessary reads as it bounces around the disk. That means power wasted, among other things. To say that defragging the iPod isn't a worthwhile question to ask is stupid.

Finally, may I make a suggestion (assuming you do "hire people"): belittling people's expertise when you yourself know next to nothing about the topic only makes you look foolish. Picking apart a single sentence on a message board forum only makes you look like the Comic Book Guy. May I suggest next time *contributing to the discussion civilly*. I know that's something they didn't teach you at MBA school, but it's high time you learned it.
 

iBlue

macrumors Core
Mar 17, 2005
19,174
15
London, England
Crikey, why don't you guys just get out a ruler and measure already?! :rolleyes:





To the original poster: What I am gathering is that the iPod probably doesn't de-frag but I doubt it needs to. If you notice ghostly space, I think wiping it and re-importing might accomplish a "de-frag" equivalent. This is just a speculation, however. (Assuming this is what you meant. I kinda lost you in the first post)
 

Black Belt

macrumors 6502a
Jun 15, 2007
710
368
California
Crikey, why don't you guys just get out a ruler and measure already?! :rolleyes:
I'm just laughing too hard :p I love it when they whip out credentials and start writing hilarious thesis on a simple question. It's especially funny when they continue to contradict themselves. ROTFL :D
 

iBlue

macrumors Core
Mar 17, 2005
19,174
15
London, England
I'm just laughing too hard :p I love it when they whip out credentials and start writing hilarious thesis on a simple question. It's especially funny when they continue to contradict themselves. ROTFL :D
yeah http://upc.*************/uploads/smilies/sm-eyebrow.gif HAHAHA hilarious.

http://upc.*************/uploads/smilies/errrm.gif
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,641
12
Grand Rapids, MI, USA
Le sigh. ;)

To the original poster: What I am gathering is that the iPod probably doesn't de-frag but I doubt it needs to. If you notice ghostly space, I think wiping it and re-importing might accomplish a "de-frag" equivalent. This is just a speculation, however. (Assuming this is what you meant. I kinda lost you in the first post)
This probably makes the most sense.... Here's what little I can add:

iPods formatted for Windows compatibility use FAT32. (see this) FAT32 does not have on-the-fly defragging capabilities. I don't know about anyone who's ever tried it, but in principle, if Blue's suggestion doesn't work for you, you might also be able to just run a Windows defragmentation program on the iPod. But don't blame me if it breaks it. :p And I'm not sure how it would benefit you anyway, since everyone's iPod seems to be able to handle the music and video files its capable of playing just fine. It's not like you can optimize it and listen to your 4:30 song in only 4:15 and be 1337er than everyone else.

iPods formatted for Mac-only compatibility use HFS+, which has on-the-fly defragmentation, as long as files are not extremely large (see here for instance). From what I understand, unless there's a complex reason why this aspect of HFS+ does not apply to an iPod, that means that you really should have to worry about this even less than you would otherwise, if that's even possible.
 

Aranince

macrumors 65816
Apr 18, 2007
1,104
0
California
Defragging is de-fragmenting the data on the hard drive. Its like the guy above was saying how files are stored in different blocks on the hard drive. But when there is a 2mb open space in one area then a 5mb open space in another area and you have a 7mb file...it will probably split the 7mb file and put it into those two separate places.

Now...this is what happens on Windows and is why we have to defrag. But we all know how superior OSX/Unix is so I'm not sure how it works in this world.
 

gnasher729

macrumors P6
Nov 25, 2005
16,534
3,131
Every modern file system stores files like I've described above. When storage is completely full it starts fragmenting files across the smaller spaces -- hence the need for a defrag.

You are ALWAYS going to have wasted space. Whether it's a couple of blocks or MBs. You are ALWAYS going to get a slower system if the device needs to piece together sections of the file across the volume.
You are contradicting yourself here. Files are split into pieces to use smaller unused gaps - which is exactly why the space is not _wasted_. Fragmentation means no wasted space. Think about that for a second. If you had an operating system (like the UCSD p-System 30 years ago) that is not capable of fragmenting files, _then_ you can get wasted space. Not with an operating system that fragments files.