Ok, guys this is pretty much required reading if you ever want to be able to install Linux and understand what your doing.
I know its dry stuff so I'll try to keep it short.
How a hard disk works(NOT SSD) -- You'll find lots of different explanations, most are correct, just different ways of thinking about it.
A hard disk has platters that look much like a cd, but smaller, they are usually double sided. There is a head much like the one on old record players
that moves back and forth(straight and back), while the platter spins. The head essentially magnetizes(1) or de-magnetizes(0) a small small portion of
the disk to write data. This could get a lot more technical, but I'm a software guy so I can't honestly delve into the specifics, but for our purposes
this works.
What are partitions?
We've learned how a hard disk works. Now lets imagine a hard disk like a room. We can partition that room into several more rooms. It's the same with
hard disks. On the first(or couple) of the hard disk is the information for how a hard disk is partitioned. ie Partition one starts at sector 5 and
goes to sector 10912121, partition 2 starts at 10912122(one sector ahead of the last partition) and ends at 30092322. When you look in Windows you
will see these partition labels as C: and E: (the next available alphabet). So partitioning is just separating out areas of the disk which Windows
actually looks at like separate disks. So you could have just a C: partition and save say 100gb of data for a Linux partition in the future. It is
also possible to resize a Windows partition. Windows 7 and above typically have 2 partitions one is the boot partition, that is hidden and the other
is the system partition, which is visible as C:. In Windows you can view your partitions in two ways. Go to My Computer and right click, then click on
Manage. Then click on Storage and Disk Management. Those are your hard disks/partitions. Here you can resize your partitions for a future Linux
install. I'd recommend at least 50GB for Linux.
How does the Operating System know about files?
When the computer looks at a hard disk, it only see's block's(boxes) of data. It knows nothing about file names or files. The operating system creates
something that is called the File Allocation Table(remember FAT?). This starts shortly after the first sector on the partition. Using the above
example, partition 1 started at sector 5, so the FAT would start at sector 6 or 7, or very close. The FAT table can be thought of as a table of
contents. It literally states that file "Josh.txt" starts at sector 20.
Example
Josh.txt 10
John.txt 20
Win.ini 30
You get the idea. The operating system uses this table to identify files and where they start. When the operating system reads a file, it reads until
it hits a "0". Also when a file takes up more than one box, the end of the sector will tell the operating system which sector is the continuation of
the file until the last sector of that file is read. That is why the FAT table doesn't contain an end sector. It should be noted that different
filesystems call this table different things. Master File Table for NTFS. FAT for FAT16/32 and exFAT. It should be mentioned that most filesystems
have two copies of their table of contents just case one gets corrupted. Again things can get much more complicated here, but this gives you inside
glimpse of how the computer see's things. So essentially a filesystem is a way for the operating system to manage where files are and give them
names.
What happens when I delete a file?
When you delete a file the operating system crosses it's name off the table of contents. It doesn't actually erase the data. If we delete Josh.txt and
then asked for data at sector 20, the information that Josh.txt had inside of it, is still there, that is why data recovery is possible. Now when
files are copied back to the system there is a good chance sector 10 will be overwritten with the new data, at that point Josh.txt is gone. So if you
accidentally delete a file that you need, its best to turn off the computer, get a copy Linux on a boot cd with testdisk on it, and immediately start
the recovery process to another hard disk. If you wait and copy new files to your computer, you could overwrite your accidentally deleted file. This
is also the reason file shredders are used. They will go to the sector that the file is on and overwrite it several times to make sure that data is
not recoverable without seriously expensive tools.
What is defragmenting or fragmentation?
Imagine John.txt takes up 1 box(sector) and to the left and right of John.txt is Josh.txt and Win.ini. Now lets delete John.txt. There is an empty
box(s) left. Now lets say we have a file that is twice as big as John.txt. The operating system copies a portion of the file to the old
John.txt(sector 20) and the rest to sector 185(next free box). Now the file is fragmented because it is not in consecutive order on the disk. As you
can imagine the old record player, it slows down reading the file because the drive has to make at least 2 passes(circle). One pass to get sector 20
and one pass to move the head to the correct location for sector 185. Now imagine this happening hundreds of times. Now you have a badly fragmented
filesystem. The head has to reposition it self several times just to get one file, but if a file where on sector 2,3, and 4 the disk head could read
all the data in one pass. Making it work less and read faster. The same goes for writing a file. So when you defragment the software looks for free
space and moves everything it can there, then it slowly rearranges the files so all their boxes are right next to each other. Much like you would
organize a room. If like items aren't together than you have to walk across the room.
So a typical Windows partition setup looks like this:
Boot 350MB - Hidden - Contains the Windows boot files. It is hidden so that you can't accidentally delete essential files to booting.
System Drive C: - This drive contains all Windows files, Programs, and Documents. It is always the C: drive except in rare cases where someone has
reinstalled and made a mistake.
A typical Linux partition setup looks like this:
/boot - 500MB or less.
/ - this is the system partition which contain all applications and system files. It varies in size but is typically 50+GB
/home - this partition contains all user files.
Now I know I just confused you because Windows referred to partitions as C: D: E: etc. Linux doesn't do that. It refers to partitions as / or commonly
called ROOT. Partitions are mounted in Linux(possible in Windows to). I'll do up a second tutorial on how to understand Linux
filesystem/partitions.
A typical Windows + Linux setup
Boot - 350MB - Hidden Windows boot partition
C: - 100GB - System partition
/boot - 500MB - Linux kernel and boot files
/ -50gb - Linux system files
/home - 100gb - your files
A boot loader such as Grub would be used to choose Linux or Windows.
So you can see that partitions are the trick to understanding how to get Linux and Windows to play together.
Hopefully you have a better understanding of Partitions and how the computer looks at files now. For the techies there are lots of stuff I didn't
address I'm not addressing this to you guy, I'm trying to make it short and understandable for those who don't already know.
I'll throw up a Linux+Virtualbox tutorial next to get people comfortable in Linux.
edit on 02015b2015 by lobograndemalo because:
Spelling/Grammer - Sorry its poor