Linux Partitions/Filesystems

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
~
Member
Member
Posts: 1226
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Linux Partitions/Filesystems

Post 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?
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Re: Linux Partitions/Filesystems

Post 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.
C8H10N4O2 | #446691 | Trust the nodes.
Aali
Member
Member
Posts: 58
Joined: Sat Apr 14, 2007 12:13 pm

Post 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
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Post 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.
Post Reply