LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 05-19-2008, 11:54 AM   #1
onedingo
Member
 
Registered: Jan 2006
Location: Pittsburgh, PA, US
Distribution: Arch
Posts: 69

Rep: Reputation: 19
fdisk created fat32 partition, which type 0b or 0c?


I have never been able to find any accurate information on this.

Let's say I have a 100GB hard drive (/dev/sda) and need to create a 20GB partition (/dev/sda1) to be used as Windows C:.

What partition type would be needed for this (0x0b or 0x0c) and how do you determine which to use?

Is is based on bios access method (lba or chs), size of partition, or location of partition? Maybe a little of each?

I'm guessing it has something to do with the disk geometry/filesystem limitations over the years. (528M,4G,8.4G,128G)
 
Old 05-19-2008, 01:23 PM   #2
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
Fat 32 Fat stands as you know fore File Allocation Table It is the pointers of all you,re files
In the old days when you delete a file you only remove the pointer out of the fat so until it is overwritten
you can recover it
History begins with FAT 8 and Fat 16
It has some thing to do with the address the processor can handle and the amount of bites
When storage capacity are growing the heads and the amount off disk in the hd are growing
It was I think windows Me was the last one how use this type off file system
But still any OS needs to know where he can find the files
If you have a HD of 100 GB unformatted it is less 100 GB when it is formatted

Hope it use full information

all the best
 
Old 05-19-2008, 01:28 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Go for 0x0c unless your hardware is really old (last century)
Modern BIOSs all use LBA.
 
Old 05-19-2008, 02:30 PM   #4
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 16
hey onedingo,

is this a trick question? tredegar gave the answer already but in case this is no trick question and you really want to know i am trying to answer it a bit more detailed.

Quote:
Let's say I have a 100GB hard drive (/dev/sda) and need to create a 20GB partition (/dev/sda1) to be used as Windows C:.

What partition type would be needed for this (0x0b or 0x0c) and how do you determine which to use?
it depends on your bios and it's block adressing method: lba or chs. if chs 0x0b else 0x0c.

Quote:
Is is based on bios access method (lba or chs), size of partition, or location of partition? Maybe a little of each?
a little bit of each. 0x0b is a FAT32 primary partition. access method chs, size of partition must be <= 2047 GB. location: dunno if it must be the first partion but it must be primary as said before. 0x0c is FAT32 using lba. rest is the same...

hope this helps, vadkutya
 
Old 05-19-2008, 02:44 PM   #5
onedingo
Member
 
Registered: Jan 2006
Location: Pittsburgh, PA, US
Distribution: Arch
Posts: 69

Original Poster
Rep: Reputation: 19
Something still isn't right then.

Using gparted (Under SysRescueCD), I created a FAT32 partition and this is what it gives:

Code:
Disk /dev/sdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000f2c91

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4699    37744686   83  Linux
/dev/sdb2            4700        4865     1333395    b  W95 FAT32
It went with 0x0b even though the drive must(?) be using LBA as:

1. I have it set that way in the BIOS.
2. Drive size is greater than 7.8 GiB. (Extended BIOS CHS Limit)
3. dmesg has this tasty bit:
ata1.01: ATA-5: WDC WD400BB-00AUA1, 18.20D18, max UDMA/100
ata1.01: 78165360 sectors, multi 16: LBA

While this may not be an issue for Linux as it does not care about CHS, it may be an issue for Windows.

Possible bug in gparted or is 0x0b still used for (small?) partitions on LBA drives?
 
Old 05-19-2008, 02:53 PM   #6
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 16
b is indeed FAT32 without LBA. if the partition is still free convert the filetype with fdisk:
Code:
# fdisk /dev/sdb
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): c
Command (m for help): w
now you have FAT32 LBA.

vadkutya
 
Old 05-19-2008, 03:41 PM   #7
onedingo
Member
 
Registered: Jan 2006
Location: Pittsburgh, PA, US
Distribution: Arch
Posts: 69

Original Poster
Rep: Reputation: 19
@vadkutya
I understand how to change the type, but that may create "issues".

Here is what I just did:

1. Booted SysRescueCD
2. As root, dd if=/dev/zero of=/dev/sdb bs=512 count=1
3. Use gparted to create msdos partition layout and create 1 primary partition formatted as FAT32

Resulting in:
Code:
Disk /dev/sdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000a5875

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4865    39078081    b  W95 FAT32
So either my understanding is off or there is a bug in gparted.
 
Old 05-20-2008, 11:53 AM   #8
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 16
hey onedingo,

i never used gparted so i don't know if there's an option you are probably missing or so. also, i don't understand why fdisk might create "issues". but another way would be using mkfs.msdos or so...

but look at this: http://gparted.sourceforge.net/larry.../2-main-2a.gif

is your FAT32 partition within an extended? i can see a flags column with lba in the picture. can you flag the FAT32 partition after you created it? or the extended, if you use one?

good luck, vadkutya
 
Old 05-20-2008, 11:42 PM   #9
onedingo
Member
 
Registered: Jan 2006
Location: Pittsburgh, PA, US
Distribution: Arch
Posts: 69

Original Poster
Rep: Reputation: 19
@vadkutya

I think gparted does have an LBA checkbox but you would expect it to do that itself in that case.

Most of the "issues" affect old msdos software so I won't waste time with it here.

So here is what I learned so far:

After spending way too much time at Wikipedia under Logical Block Addressing and a dozen or so links from the references section, I decided to zero both sda & sdb and just see what Windows would do.

1. During install select a 5000MB C: Drive (/dev/sda1)
2. Finish install & reboot
3. Using the Disk Management thing, create a 2000MB D: (/dev/sda2) & a 10,000MB E: (/dev/sda3)
4. Reboot to SystemRescueCD

The results were surprising...
Code:
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x16c616c6

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         637     5116671    b  W95 FAT32
/dev/sda2             638         892     2048287+   b  W95 FAT32
/dev/sda3             893        2167    10241437+   c  W95 FAT32 (LBA)
It appears that you should use 0x0b even on LBA drives as long as the created partition does not touch cylinder 1025 or above.

I would like to thank MICROS~1 for not putting this information anywhere in their knowledge base.

Last edited by onedingo; 05-20-2008 at 11:44 PM.
 
Old 05-21-2008, 08:33 AM   #10
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 16
hey onedingo,

it seems that the horse doesn't jump higher than it has to . 0x0b (FAT32 without LBA) still uses the old BIOS INT 13 (low level disk read/write) which means it can adress a maximum of 7.8GB disk space. you created a partition of first 5GB than 2 GB (= 7GB) so windows is not forced to use BIOS INT 13h extensions. with the third partition however, it switches to LBA because it has to.

so far so good, but you created a primary partition with gparted which is 40GB. according to my understanding it must use BIOS INT 13h extension, hence no (E)CHS is possible and LBA is the only alternative. so the ID should be c NOT b. i am really confused by now...

maybe it's really a bug. on the other hand. unless you really install windows it doesn't matter since windows will setup the correct mode. the question remaining is can you access the whole 40GB if you mount the hd under linux. this shouldn't be possible. but i am not a hardware expert, sry...

vadkutya
 
Old 05-21-2008, 08:42 AM   #11
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 16
Quote:
Originally Posted by onedingo View Post
Something still isn't right then.

Using gparted (Under SysRescueCD), I created a FAT32 partition and this is what it gives:

Code:
Disk /dev/sdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000f2c91

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4699    37744686   83  Linux
/dev/sdb2            4700        4865     1333395    b  W95 FAT32
one additional point. the oder in which the partitions appear in fdisk is not neseccariliy the order in which they reside on your hd. if the BIOS uses only the INT13 routines it cannot map higher than 7.8GB so the FAT32 partition would be out of range. however, if the order is reverse this is no problem. also, if the os is linux the FAT format is not of interest since linux uses LBA.
 
Old 05-21-2008, 08:48 AM   #12
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 16
Quote:
Originally Posted by onedingo View Post
Code:
Disk /dev/sdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000a5875

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4865    39078081    b  W95 FAT32
addendum:

maybe gparted doesn't care about 0x0b/0x0c if you don't tell it explicitly. it doesn't really have to. the defaul might be 0x0b. if you install windows then this will be handeled during windows installation. if not and you use linux then linux talks with the BIOS and the BIOS with the disk controller and the disk controller maps it all to the correct physical adress. so if linux handles your partition this should be no problem.

but as i said before. i'm not really sure about all this.
hope this helps, vadkutya

Last edited by vadkutya; 05-21-2008 at 08:50 AM.
 
Old 05-21-2008, 08:56 AM   #13
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
I have a better idea: just don't use FAT for anything. There is no longer any reason to, and it is a primitive, limited, and error prone file system.

NTFS can now be read and written from Linux, though it is slow, and ext2/3 can be read/written from Windows. So why use FAT?
 
  


Reply

Tags
boot, dual, fat32, fdisk, windows


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fdisk and mount dont agree on file system type (fat32 vs. ntfs) schneidz Linux - Software 4 07-20-2006 12:17 PM
can fdisk or cfdisk resize a fat32 partition? toastermaker Linux - Software 6 01-29-2004 07:42 AM
Created new FAT32 partition, after that..GRUB console haunting me..what 2 do??? free_mumia Linux - Newbie 5 01-04-2004 08:02 PM
Created new FAT32 partition and now KDE freezes while loading WM Smile005 Linux - Software 4 11-09-2003 01:23 PM
Can't see files created using RH9 on the FAT32 partition in WinXP jvala Linux - General 1 09-02-2003 11:17 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration