Click to See Complete Forum and Search --> : How does file systems work?
Yosuke_
06-14-2004, 04:59 AM
Hi!
I was wondering, there are many file systems, ext2, ext3, swap, fat, whats the diference?
I mean how do thay work? For example Linux use ext3, does linux use this to read data diferent? And.... :confused: I'm confused... Can you please explain me whats the diference? And what changes in the hard-drive? Thank you!
XiaoKJ
06-14-2004, 05:30 AM
ext2 is the normal linux file system nowadays, and ext3 just added journallising to it.
reiserfs is another file system altogether, and has journallising too.
fat is yet another file system, but M$ made it and its far behind ext2. but when it was made it was quite ok...
journallising is a way to keep hard discs efficient -- when you write to a journalised file system you write to a designated area, before you actually write the data. that means that your newly created file will either be there or not there, and not cause hard disc disorders.
You really should search google for answers.
and swap isn't a file system, it just mimicks RAM...just very slow...
hard candy
06-14-2004, 05:31 AM
Linux mainly uses:
1. Ext2 filesystem
2. Ext3 filesystem
3. Reiserfs filesystem
The last two are the ones in most use today in Linux.
Now I'm pointing you to the Filesystem Howto (http://www.tldp.org/HOWTO/Filesystems-HOWTO.html) which explains a lot.
XiaoKJ
06-14-2004, 05:42 AM
Ok, more on journalising.
Take for example, you wrote a file and want to save it. Suddenly there was a power outage. If the power outage happened before you saved, then your file is gone. If you saved before the power went out, your file is there.
What about if they came together? you will lose whatever is in your hard disc was writing -- if you previously had a saved file and you wrote to it, you will find that a bit of the file was the new one and a bit of it the old, and your file is corrupted, and so is your hard disc.
journalising works by designating a portion of your file system to do caching -- you write to the portion, and writing again to the file, and you delete the entry in the portion. If you completely wrote to the cache before the power went out, then your file is definitely there. If not, your file is not. you will not get a corrupted hard disc.
In ext2, when you encounter a power outage, you will have to check every bit of the file system for errors. If you used ext3 or reiserfs or xfs or jfs, they will only check the caches for data and clear or write them.
How do the computer know that the file system is filthy? somewhere in the file system will have one bit that controls it -- if you shut down properly at the end the computer will erase the bit to read clean. at startup the computer will then not check for trouble. then the computer will reset it back to unclean till shutdown.
XiaoKJ
06-14-2004, 05:59 AM
for fat, there is much problems.
in original fat, all files have a limit of 8 for the file name and 3 for the file extension. that is why you have files ending with .html and .htm -- the .htm one is on dos naming convention of 8.3 <--the technical name
and for fat16, there exists a limitation for space -- a fat 16 partition can be only 2gb or less. This is because of its design and is related to the 16 in fat16. in fat32, the limit was pushed to 32gb (a coincidence).
For microsoft, when they came up with Windows 95, they began to see the fact that people want to safe files with names longer than 8.3, so they invented what linux users call vfat -- both the 8.3 name and long filename are stored, with the 8.3 name outside. windows reads the long filename and dos reads the 8.3 outside. [I think M$ is trying to patent this]
The restriction for 8.3 is kept in place as people still want to run dos and still some apps are running on windows that are designed to read dos filenames.
If you are using NTFS, the restriction is formally removed as DOS doesn't read ntfs, unless you use MSDOS 7.10 by China Dos Union :D
NTFS is a file system the M$ made based on IBM?? HPFS therefore they share the same number in fdisk's partition types. NTFS's NT is the NT from windows NT, and the first NTFS appeared in windows NT. It is supported in windows NT based kernels after 3 or 4[not sure here] Windows 2000 and XP use NT based kernels and not Windows 95, 98 or ME
BTW, NTFS isn't supported in linux(much) as the NTFS system isn't known to linux users -- NTFS is quite new and unstable with tons of proprietary code that bloats the file system and makes it less efficient like M$ Office is(read up on M$ Office and why it sucks)
NTFS is also known to break some binary files -- when I tried to copy my boot sector from my linux partition to my NTFS, it failed as the files were edited. Binary files should not be edited! :mad:
Yosuke_
06-14-2004, 06:14 AM
THank you very much!!!
XiaoKJ
06-14-2004, 06:31 AM
Thanking us not not very important -- if you read all our posts, search for answers and read all the manuals or whatever, we would be glad.
If you later come back and HELP us we will have very happy! :D