Page 1 of 1
Linux Partitions/Filesystems
Posted: Mon Apr 16, 2007 2:53 pm
by ~
Isn't it supposed that Linux has only like 2 types of partitions, one for swap partitions an other for native partitions?
Now, the actual question is, if there's only one type of partition, how does the OS differentiates among all of the supported filesystems? How are they defined? Just like a "volume ID", the first partition 512-bytes sector that contains all of the filesystem dependent fields?
Re: Linux Partitions/Filesystems
Posted: Mon Apr 16, 2007 3:13 pm
by Alboin
~ wrote:Isn't it supposed that Linux has only like 2 types of partitions, one for swap partitions an other for native partitions?
Generally, There are a minimum of 2 partitions and a swap:
/boot - An ext2 partition that contains GRUB, etc. (32MB) 0x82
/ - The root. Can be anything. (xMB) 0x83
swap - Swap space. (512MB) 0X03?
However, I think it might be possible to just have one ext2 partition with everything. (GRUB doesn't like ext3.) I have never tried that, however.
~ wrote:Now, the actual question is, if there's only one type of partition, how does the OS differentiates among all of the supported filesystems? How are they defined? Just like a "volume ID", the first partition 512-bytes sector that contains all of the filesystem dependent fields?
There is a partition for each file system. (As far as I know. I don't think you can have more than one file system on a partition.) Moreover, you could have a single partition for each part (ie. /home, /usr, /lib, etc.) as long as you mount it with fstab.
Posted: Mon Apr 16, 2007 3:22 pm
by Aali
every filesystem has some kind of magic number or signature, usually in the first block
there's no standard that i'm aware of though
Posted: Mon Apr 16, 2007 10:15 pm
by JackScott
Alboin: GRUB doesn't mind ext3 at all. Or Reiserfs, which I used to use up until my hard drive died a slow and horrible death
. And yes, it is possible to have a single partition ext3 or Reiserfs with GRUB on it.