File Systems
Windows uses FAT12, FAT16, FAT32 and/or NTFS with NTFS almost always being the best choice. The FATx file systems are older and have assorted limitations on file and partition size that make them problematical in the current environment. Linux also has a number of its own native file systems. The default file system for Linux used to be ext2, now it is typically ext3. Other supported file systems includes XFS, JFS, JFFS and Reiser3. Reiser4 is in development.
The ext3 file system is being replaced by ext4. Among the improvements in ext4 is an increase in the maximum filesystem size from 16 terabytes in ext3 to one exabyte. The largest file in ext3 is 2 terabytes, in ext4 it is 16 terabytes. OpenSolaris includes ZFS which seems like a drastic change in file system design.
File systems can be either journaled or not. Non-journaled systems are subject to problems when stopped abruptly. All the FAT variants and ext2 are non-journaled. After a crash, they should be examined by their respective health check utilities (Scan Disk or Check Disk or fsck). In contrast, when a journaled file system is stopped abruptly, recovery is automatic at the next reboot. NTFS is journaled. Linux supports several journaled file systems: ext3, ext4, reiserfs and jfs.
All the file systems use directories and subdirectories. Windows separates directories with a back slash, Linux uses a normal forward slash. Windows file names are not case sensitive. Linux file names are. For example "abc" and " aBC" are different files in Linux, whereas in Windows it would refer to the same file. Case sensitivity has been a problem for this very web page, the name of which is " Linux.vs.Windows.html". At times, people have tried to get to this page using " linux.vs.windows.html" (all lower case) which resulted in a Page Not Found error. Eventually, I created a new web page with the name in all lower case and this new page simply re-directs you to the real page, the one you are reading now (with a capital L and W).
Fragmentation: Windows file systems all suffer from fragmentation, which results in a file being scattered all over the hard disk. I'm told that Linux file systems are much less prone to this, but I don't know the details and whether it applies to all or some of the Linux file systems. With classic magnetic platter based hard disks, fragmentation can be a big deal as the disk is much slower than the RAM or CPU and having to walk all over the hard disk to get a file slows things down. How this will play out on newer SSDs I don't know. While there is no waiting for spinning platters, SSDs have to deal with wear leveling, a feature designed to extend their limited lifespan. Speaking of fragmentation, I've heard very good things about Raxco's PerfectDisk for Windows.
Crossing Over: As for supporting each others file systems, Linux can read/write FAT16 and FAT32. When I first wrote this topic, only some Linux distributions could read NTFS partitions. Now more can both read and update NTFS, a feature critical to using Linux as a Rescue CD for a broken copy of Windows.
Captive-NTFS was "the first free NTFS read/write filesystem for GNU/Linux". It is no longer being maintained. In its place is the NTFS-3G Read/Write Driver which the website describes as "an open source, freely available read/write NTFS driver for Linux, FreeBSD, OS X, and NetBSD." NTFS-3G is fairly new, being considered stable only since February 2007. It can deal with the multiple versions of NTFS used by Windows XP, Windows Server 2003, Windows 2000 and Windows Vista. At least 85 distributions support NTFS-3G in some manner, among them: Ubuntu, Red Hat, Debian, Knoppix and Mandriva.
In September 2005, PC Magazine reviewed a product called NTFS for Linux from the Paragon Software Group that gives Linux read/write access to NTFS partitions. For more information on Linux and NTFS, see the Linux NTFS Project.
On its own, Windows can not read partitions formatted with any Linux file system. However, a number of products (I haven't tried any of them) enable this:
- Explore2fs by John Newbigin can be used to read Linux ext2 and ext3 partitions.
- Ext2Fsd claims to be an Ext2 File System Driver for Windows, An open source project, the Ext2 File System Driver for Windows.
- The free Linux Reader for Windows from Diskinternals can read the Ext2/Ext3 file systems.
- The Ext2 Installable File System For Windows is free and provides full read and write access to partitions and floppy disks formatted with either Ext2 or Ext3. It works with Windows NT4, 2000, XP, Server 2003, Vista and Server 2008. It's also referred to as Ext2 IFS for Windows. If you are running a NAS device, it may very well be storing files using the Ext2 or Ext3 file system.
File Hierarchy: Windows and Linux use different concepts for their file hierarchy. Windows uses a volume-based file hierarchy, Linux uses a unified scheme. Windows uses letters of the alphabet to represent different devices and different hard disk partitions. Under Windows, you need to know what volume (C:, D:,...) a file resides on to select it, the file's physical location is part of it's name. In Linux all directories are attached to the root directory, which is identified by a forward-slash, "/". For example, below are some second-level directories:
/bin/ ---- system binaries, user programs with normal user permissions
/sbin --- executables that need root permission
/data/ --- a user defined directory
/dev/ ---- system device tree
/etc/ ---- system configuration
/home/ --- users' subdirectories
/home/{username} akin to the Windows My Documents folder
/tmp/ ---- system temporary files
/usr/ ---- applications software
/usr/bin - executables for programs with user permission
/var/ ---- system variables
/lib --- libraries needed for installed programs to run
Every device and hard disk partition is represented in the Linux file system as a subdirectory of the lone root directory. For example, the floppy disk drive in Linux might be /etc/floppy. The root directory lives in the root partition, but other directories (and the devices they represent) can reside anywhere. Removable devices and hard disk partitions other than the root are attached (i.e., "mounted") to subdirectories in the directory tree. This is done either at system initialization or in response to a mount command.
There are no standards in Linux for which subdirectories are used for which devices. This contrasts with Windows where the A disk is always the floppy drive and the C disk is almost always the boot partition.
Hidden Files: Both support the concept of hidden files, which are files that, by default, are not shown to the user when listing files in a directory. Linux implements this with a filename that starts with a period. Windows tracks this as a file attribute in the file metadata (along with things like the last update date). In both OSs the user can over-ride the default behavior and force the system to list hidden files.
Case: Case sensitivity is the same with commands as with file names. When entering commands in a DOS/command window under any version of Windows, "dir" is the same as "DIR". In Linux "dir" is a different command than "DIR".