Discussion Locked

Filesystems, Ext2 / swap / FAT

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Happy new Linux year!
Is there a guru out there who could try to explain to a newbie how the Ext2 and swap partitions are formatted? How do they differ from each other, and from FAT?
Thanks.
hpoppe@c2i.net

6 replies

by bradleyr

not a guru, but can answer your question. when you first intall linux, you should put the boot disk in, let it boot up, then at the prompt you put the root disk in, and when it is done, before you go through the setup you must format your partitions for linux oru can'tinstall it. you do that by typing fdisk at the prompt (just like you do in DOS - which uses FAT). You really do not need to know much of the difference between FAT and ext2 except that Windows 9x uses FAT and Linux uses ext2. So, you type in fdisk, it will give you a menu to do you formatting from. select n for new partition, add 1st primary partition (at this point you must remember to leave room for linux swap -about 80Mb on mine), so, when youare done with that createanother primary partition for 80Mb. Swap in Linux is like a swapfile in Windows - lets you use your harddisk for memory. Then you select "a" from the menu and make the 1 partition active. then select "t" from the menu and then select 82 to assignswap partition to the second partiotion you created. Then select "w" to create these partitions. The most important thing to rememberthat after you are done with fdisk, when you type setup at the prompt to install Linux, you need to make the swap partition active. You will see this selection in the menu interface. Well, hope this helped. if you need more help, just email me - i will clarify it for you if this is not enuf. Good luck -I love Linux!

by hpoppe

I know how to partition. The question was abot how the Ext2 FS is organized as opposed to FAT, and how the actual formatting of the swap is done. How does the Ext2 and swap FS work? Not the partitions.
hpoppe@c2i.net

by zbrain75

To learn about the ext2 filesystem go to:
http://e2fsprogs.sourceforge.net/ext2.html
http://e2fsprogs.sourceforge.net/ext2intro.html

Many of the differences involve the fact that the FAT filesystem does not support user level security. That is, they do not keep records about the owners of files nor information about access rights. I used to be a guru on the DOS filesystem writing file recovery programs. I will try to remember and give a brief description.

The DOS filesystem is organized by sectors (512 bytes I think). In the area where files are stored, data is stored in clusters. Clusters are groups of sectors, usually 4, 8, 16, or 32. The DOS filesystem has several main areas of storage which are:
1. Boot sector
2. FAT information (sectors) - I think FAT information was originally divided into 24 bit records. It may have been 16.
3. Directory information (sectors)
4. File information (clusters)

The boot sector is where a bootstrap program may reside to passcontrol to an operating system.

The Directory information section contains sets of records for each file entry including file name, extension, date, file size, some bits such as archive, read only, system bits, and most importantly the number of the cluster the file begins on.

The FAT section is a table pointing to where the next part of the file is (when the file size exceeds the size of the cluster). If the file ends at that sector, the value is FFF hexadecimal (16 bit FAT). I believealso, the first entry in the FAT section tells the type of disk indicating the size of the FAT section, the directory section, and how many sectors per cluster. I can't remember if this is exactly correct but believe it was based on some value. Ifyou need more detailed information, I have a book about it (in my basement) and may be able to find it and look it up.

by zbrain75

(The rest of the answer)

Anyhow, this way the system knows where to look for the first part of where file information is stored.

When a file is accessed the process works like this. The system looks up the file name entry and finds the numberof the starting cluster. It then uses that value to locate the data on the filesystem. It reads the first cluster and determines by the FAT entry for that cluster where the next part of the file is. It may not be contiguous (may be fragmented). It continues until it reads the last cluster, and by the value of the last cluster, can tell the file has been read. It also uses the filesize to tell how many bytes of the last cluster to read.

Realizing the size of sectors, there is a limit to the maximum partition for a FAT filesystem. It is 512 bytes times 2^24 times the maximum sectors per cluster (I think 32).

Also there are two other types of FAT:
1. VFAT
2. FAT32

FAT32 uses 32 bit clusters and has some other enhancements. VFAT allows long filenames to be used since the original FAT only supported 8 + 3 (extension).

The original IBM Technical Reference Manual has excellent information about the inner workings of the original file systems with full details including BIOS code listings, if you can find a copy.

by hpoppe

Thanx,
your links answered most of this.
The question was a difficult one, and U get the points. Do you (or anyone else know where to get a copy of "The original IBM Technical Reference Manual"?? I'm still looking for in-depth answers to the question, and will reward 1000 techpoints to whoever can give even better answers. to get the points; mail me at: hpoppe@c2i.net.
Thanx!!!

This discussion is closed to new replies.