LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Could somebody explain the pros and cons of some of the most used file systems? (https://www.linuxquestions.org/questions/linux-general-1/could-somebody-explain-the-pros-and-cons-of-some-of-the-most-used-file-systems-689626/)

baldurpet 12-10-2008 12:01 PM

Could somebody explain the pros and cons of some of the most used file systems?
 
I'm interested in learning about different types of file systems, things I have gathered so far are
  • FAT12 and FAT16 were used by windows but you could only have files THISLONG.EXA so they made FAT32 and then vFAT or something. Most people seem to dislike the FAT system
  • NTFS seems to be the best system if you want to run on both Windows and Linux or just Windows (so NTFS would be a good format for your USB memory sticks, because you'll probably use them on computers,-not-linux right?)
  • EXT2 and 3 seem to be the best formats for Linux
  • ...I don't really know any other, maybe XFS which seems to be good for Media storage/transfer or something

If somebody knows anything about other file systems, anything more about those whom I mentioned or anything I was wrong about? :) Thank you

AuroraCA 12-10-2008 12:06 PM

Wikipedia has a very comprehensive explanation of the differences:

http://en.wikipedia.org/wiki/Filesystem

http://en.wikipedia.org/wiki/Compari...al_information

H_TeXMeX_H 12-10-2008 12:41 PM

Quote:

Originally Posted by baldurpet (Post 3370647)
  • FAT12 and FAT16 were used by windows but you could only have files THISLONG.EXA so they made FAT32 and then vFAT or something. Most people seem to dislike the FAT system
  • NTFS seems to be the best system if you want to run on both Windows and Linux or just Windows (so NTFS would be a good format for your USB memory sticks, because you'll probably use them on computers,-not-linux right?)
  • EXT2 and 3 seem to be the best formats for Linux
  • ...I don't really know any other, maybe XFS which seems to be good for Media storage/transfer or something

FAT12 and FAT16 are virtually obsolete. FAT32 is still used on USB sticks, but will soon also became obsolete due to maximum file size of 4 GB.

NTFS is used exclusively by Window$, but you can read and write to it from Linux.

ext2 is a non-journaled filesystem, while ext3 is the journaled version of it, really they're the same filesystem in different modes. There's also the new, more experimental ext4. These are all good not performance-wise, but at recovery in case you destroy a partition superblock, because there are multiple backups.

XFS and JFS are the high-performance filesystems according to numerous benchmarks. Indeed, if you do work with multimedia editing / recording or very large files, then these are the ones to get. JFS also has the benefit of using very little CPU time ... great on laptops. The recovery from these is a bit more complicated, but it is possible and in many cases you can recover stuff just as well. For example:
http://www.sinz.org/Michael.Sinz/Linux/boot.html
http://jfsrec.sourceforge.net/

There's more too, like reiserfs, which is good for lots of small files in large directory trees.

And I'll add some benchmarks:
http://linuxgazette.net/122/piszcz.html
http://digg.com/linux_unix/Linux_Fil...Benchmark_2008
Btrfs looks promising.

baldurpet 12-10-2008 01:37 PM

Quote:

Originally Posted by AuroraCA (Post 3370653)
Wikipedia has a very comprehensive explanation of the differences.

I know, I looked it up on Wikipedia too but as much as I love Wikipedia it often isn't very concise and informative (well it has information, but it's often difficult to gather it if you don't know much about the material in the first place like at the "comparison" page). I need something like H_TeXMeX_H said "FAT12 and FAT16 are virtually obsolete" or something like "most people should use y but if you're working with multimedia (or something) you should use x instead".

That sort of thing isn't on Wikipedia and in my experience only people who have been in the "biz" for a long time can explain it well

Also, H_TeXMeX_H said something about ext2 not being journaled and ext3 being journaled. Which is better? (a journaled file system logs all actions to a journal right?) Wouldn't ext3 be the best file system for a personal laptop/PC? And what about ext4, I heard it wasn't well received

AuroraCA 12-10-2008 02:24 PM

I prefer sites which offer factual information which I can read and analyze.

You got a great response from H_TeXMeX_H. He is spot on with his summary.

Many times you get feedback like "this sucks" or "don't use that" which are solely based upon opinion and provide nothing more than personal preference.

H_TeXMeX_H 12-10-2008 02:36 PM

There's also Reiser4, it's the newest version of the Hans Reiser filesystems. It's better than reiserfs in most cases.

jschiwal 12-10-2008 02:39 PM

There are websites which perform benchmarks on various filesystems. For a media server, being better as serving up very large files quickly is important. For a database server, being able to access any record quickly is important. For a workstation, reliability is more important than speed, so for your own computer which isn't a dedicated mysql or file server, ext3 or reiserfs may be the best options. They are written to be more robust and use more generic coding which will run on a larger range of computers such as old i386 computers.

While Linux can read and write to FAT and NTFS filesystems, they are good choices. They don't save Linux permissions and ownership. Also, Linux can't repair a faulty NTFS filesystem. So if you don't have access to windows, never use NTFS. If you purchase an external hard drive that uses NTFS, you are better off reformatting it if you don't run Windows as well.

GazL 12-10-2008 02:42 PM

I use JFS myself. The reasons I chose to use it are as follows.

JFS creates inodes on the fly. What this means is that
1) formatting a partition to JFS is almost instantaneous (especially nice if you use LVM and create and delete logical volumes a lot)
2) It doesn't waste diskspace by allocating lots of inodes that are never going to get used. A good example of this would be a large filesystem containing a small number of very large files.

In addition to that, you can also dynamically increase (but sadly not shrink) a jfs filesystem (another good one for LVM setups).

Finally, its meta-data journalled for that little bit of extra peace of mind.

jstephens84 12-10-2008 02:59 PM

Quote:

Originally Posted by GazL (Post 3370855)
I use JFS myself. The reasons I chose to use it are as follows.

JFS creates inodes on the fly. What this means is that
1) formatting a partition to JFS is almost instantaneous (especially nice if you use LVM and create and delete logical volumes a lot)
2) It doesn't waste diskspace by allocating lots of inodes that are never going to get used. A good example of this would be a large filesystem containing a small number of very large files.

In addition to that, you can also dynamically increase (but sadly not shrink) a jfs filesystem (another good one for LVM setups).

Finally, its meta-data journalled for that little bit of extra peace of mind.

Funny that you mention small files and inodes. I had a client that could not figure out why he could not save files even though he had more than enough space. after poking around we found out that it was due to running out of inodes.

GazL 12-10-2008 04:37 PM

Quote:

Originally Posted by jstephens84 (Post 3370879)
Funny that you mention small files and inodes. I had a client that could not figure out why he could not save files even though he had more than enough space. after poking around we found out that it was due to running out of inodes.

Indeed. I've seen that on a few occasions too. Always a giggle when you hit something like that and get to call the previous sys admin of that system dirty names for not setting the ratio appropriately! ;)

Too many inodes = wasted space, too few = unusable space. Again, another reason I like linux's jfs, you don't have to worry about it.

baldurpet 12-10-2008 06:40 PM

Quote:

Originally Posted by GazL (Post 3370855)
JFS creates inodes on the fly.

I'm not really sure what an inode is (a quick dab to Wikipedia says it something that sores information about files or directories).. but why is it so good that JFS creates inodes without stopping or on the fly? How do other file systems create inodes- do you have to make them yourself (don't remember ever having had to do that myself) or maybe they just don't make it?

Why are inodes good?

jstephens84 12-10-2008 07:30 PM

Quote:

Originally Posted by baldurpet (Post 3371060)
I'm not really sure what an inode is (a quick dab to Wikipedia says it something that sores information about files or directories).. but why is it so good that JFS creates inodes without stopping or on the fly? How do other file systems create inodes- do you have to make them yourself (don't remember ever having had to do that myself) or maybe they just don't make it?

Why are inodes good?

Simply an Inode is an location on the hard drive. When you create a file that file is then given an inode. I think the default is every 4096 bytes = 1 inode. But that can be changed. So if you are going to have a ton of small files then change it to say 2048 which will pretty much double the inode's.

here is a great read on inodes and files. http://www.ibm.com/developerworks/ai...x14/index.html

GazL 12-10-2008 07:38 PM

An inode is a control block within the filesystem. They're how the system finds the data that make up the contents of a file. Each file starts with an inode, so if you run out of them, then you can't create any new files, even if you have plenty of empty space in your filesystem.

Some filesystems such as ext create these blocks in advance when you format the filesystem and leave them unused. You normally tell the format command to put an inode every so many bytes through the filesystem, so the closer you pack them in, the more you get, but as inodes take up space on the filesystem, the more inodes you have the less space you have left for actual files.

Getting the right spacing and number of inodes can be a bit of a juggling act. Though, it's usually only an issue when dealing with extremes, like really big filesystems or huge numbers of really small files. Because ext creates its inodes in advance, When the ext filesystem needs to create a new file, it'll find an existing empty inode entry and use it for the new file.

Where JFS is different is that it doesn't create them in advance (when you format the partition), it creates them as it needs them when it creates new files. So, in practice, that means there aren't any empty ones taking up space in your filesystem that may never get used, and you can't run out of them.

As an aside, Files actually don't have names. They have inode numbers. You can see this by doing a 'ls -i' on a file. When you access a file by name, the system searches the directory for the name and looks up the correct inode number which is then used internally. A directory is really just a special type of file containing filenames and inode numbers. This is how you can sometimes have 2 (or more) links to the same file.

There's a bit more to it than that, some filesystems do things slightly differently to each other and I've simplified it a little to make it a little easier to follow, but that's roughly what its all about.

Hope that helps.

jstephens84 12-10-2008 07:47 PM

adding on to that if you look at how Dennis Ritchie discussed it, he said that it is pretty much a flat array on the disk. the inode is the selected index from this array. This array is used to tell the system the following information about the file the inode references:

1. inode number
2. number of links to the file
3. UID
4. GID
5. Size of file
6. Number of blocks file uses.

Also the inode helps by making sure that two people can edit a file until it is release back.

jschiwal 12-10-2008 10:04 PM

Is the JFS filesystem still being actively maintained in the kernel? I though I read something about it in one of the Linux Magazine.


All times are GMT -5. The time now is 10:21 AM.