Page 1 of 1

fat12 problem or GRUB problem...

Posted: Tue Dec 04, 2007 3:40 am
by xyjamepa
Hi...

last month I implemented fat12 file system,and I was playing with
it last night any way when I make any new folder or a new text file
I can see it from windows and it works perfectly,
but here is the problem...after creating new folder or new text file
and restarting Boch's ,I can't boot again GRUB gives me this message:
Error 16: inconsistaint file system structure...
Did any body have this problem before?
Or do you know what is wrong?

Thanx

Posted: Tue Dec 04, 2007 3:59 am
by JamesM
Sounds like windows has b0rked your filesystem: did it implicitly convert it to fat32 or something?

Posted: Tue Dec 04, 2007 9:24 am
by jal
JamesM wrote:Sounds like windows has b0rked your filesystem: did it implicitly convert it to fat32 or something?
Or put long file names in? (Don't know whether Bochs likes them on FAT12.)


JAL

Posted: Tue Dec 04, 2007 9:28 am
by Tyler
jal wrote:
JamesM wrote:Sounds like windows has b0rked your filesystem: did it implicitly convert it to fat32 or something?
Or put long file names in? (Don't know whether Bochs likes them on FAT12.)


JAL
Bochs?

Posted: Tue Dec 04, 2007 1:42 pm
by jal
Tyler wrote:Bochs?
Sorry, mind melt. Grub, of course.

JAL

Posted: Wed Dec 05, 2007 3:14 am
by xyjamepa
So...

what should I do?
:?
how can I figure out the problem?
didn't you guys have this problem before?

Any suggsetions are welcome...

Thanx.

Posted: Wed Dec 05, 2007 3:21 am
by AJ
Have you tried the LFN suggestion by jal? How about the FAT32 suggestion by JamesM? Can Windows continue to read the disk after the first write? Can another OS like Linux, or is the problem specific to GRUB?

What medium is your FS on? I read before that the type of FAT system is based purely on number of sectors, not on the information in the BPB, so it may be worth checking that.

Can you dump parts of the BPB, root and FAT yourself to verify that everything is as you expect?

Cheers,
Adam

Posted: Wed Dec 05, 2007 3:27 am
by xyjamepa
Can Windows continue to read the disk after the first write? Can another OS like Linux, or is the problem specific to GRUB?
Yes windows can read the Disk and I can see my new folder or my new text file and I can read it from windows...
the problem comes after creating new folder or text file and then
rebooting Bochs GRUB can't boot again and gives me this :
Error 16: inconsistaint file system structure
Can you dump parts of the BPB, root and FAT yourself to verify that everything is as you expect?
Yes, and every thing is as I expect...

Thanx.

Posted: Wed Dec 05, 2007 4:21 am
by JamesM
Try it on a linux liveCD - see what it gets mounted as (FAT12, FAT32) etc. Also if you go into your floppy drive mountpoint in a terminal on the liveCD (usually mounts at /media/floppy or something) then do an "ls -l", you should see EXACTLY what is on there - sizes, permissions etc.

You will also see any "hidden" or "special system files" windows may have created implicitly (I'm thinking of folders such as Thumbs_DB: That existed on XP and if you're using vista there's probably more of those such things to hold folder setup memories etc). You can also delete them from there ;)

You may want to try "ls -la" instead. The 'a' tells ls to list ALL files (files prefixed with a dot (.) are not shown normally).

Posted: Thu Dec 06, 2007 4:05 am
by xyjamepa
Unfortunatally I don't use linux, I use winxp...

As you know every fat file system has two copies of fat table,
what I do after creating my folder or my file ,I only change the
first copy of fat table and leave the second one without change,
so do you think this might be the problem?
I tried to update the second copy of fat to become identical with the first
one,but nothing changed...
the problem here I'm not sure if I did it in the right way...


Thanx.

Posted: Thu Dec 06, 2007 4:11 am
by AJ
Hi,

If GRUB is complaining about the FAT's being inconsistent, I should imagine that that is almost certainly the cause of the problem. What happens if you start with a clean FAT formatted disk again and write your code to update both FAT's from the outset?

Cheers,
Adam

Posted: Thu Dec 06, 2007 4:20 am
by JamesM
Unfortunatally I don't use linux, I use winxp...
That's why we suggested quickly checking using a liveCD: You don't need to install anything, just insert the CD and off you go! When the computer restarts it'll boot back into winXP with no data change.

Posted: Thu Dec 06, 2007 2:28 pm
by mystran
How about download GRUB source, look into it to see why it would possibly signal such an error, and then check that you aren't violating any of the assumptions GRUB makes..