Loading ...
Sorry, an error occurred while loading the content.

Re: [nslu2-linux] Vfat partition and DOSFSCK

Expand Messages
  • Robert Hammond
    In message , Robert Hammond writes ...
    Message 1 of 2 , Nov 20, 2007
      In message <SEr$bBEknIPHFw9w@...>, Robert Hammond
      <rob.hammond@...> writes
      >Just for curiosity I tried to run the Dosfsck program on my vfat
      >partition /dev/sda4
      >The console output seems to infer major problems with this partition as
      >follows :-
      >dosfsck /dev/sda4
      >dosfsck 2.11, 12 Mar 2005, FAT32, LFN
      >Warning: FAT32 root dir is in a cluster chain, but a separate root dir
      > area is defined. Cannot fix this easily.
      >There are differences between boot sector and its backup.
      >Differences: (offset:original/backup)
      <Snip - both boot sectors are totally different here so have snipped>
      >FSINFO sector has bad magic number(s):
      > Offset 0: 0x00000600 != expected 0x41615252
      > Offset 484: 0x00000000 != expected 0x61417272
      > Offset 510: 0x0000 != expected 0xaa55
      >1) Correct
      >2) Don't correct (FSINFO invalid then)
      >? 2
      >File system has 2043269 clusters but only space for 0 FAT entries.
      I managed to copy and save all of the data from the partition.

      I seem to have encountered a whole list of problems.

      Firstly I originally formatted the partition as FAT32 using partition
      magic on a windows box. I think that this caused the original problem
      with the boot sectors and magic numbers.

      I have now reformatted the partition using the Optware dostools version
      2.11 and certain parts of both the mkdosfs and dosfsck programs seem to
      be broken when running on the NSLU2 (most likely also broken on other
      chip sets/devices).

      The mkdosfs program seems to work just fine just so long as the -b
      command line argument is not used. Using -b causes a 'Segmentation
      Fault'. I have checked through the created boot sectors and magic
      numbers etc and compared to the published design specs for FAT32 and all
      seems fine.

      But running the dosfsck tool always seems to bring up the response
      'Logical sector size is zero' but I know that it is not zero because I
      have check the relevant boot sector offset and it is correct, including
      the backup copy of the boot sector in sector 6. Strange that it
      worked OK with the broken filling system but will not work with a newly
      created one.

      I have looked through the source code files for this program and they
      are quite primitive, I think that for some unknown reason the whole
      boot sector is not being read by this program into it's buffer, perhaps
      because it cannot open the /dev/sda4 device or read from it or the read
      buffer is not created properly, or it reads the wrong sector something
      similar. Again unfortunately the program does not do rudimentary
      checks for these errors, the first check that is done is to check the
      Logical sector size and erroneously reports it as being zero when it is

      Unsure if these errors will ever be fixed with these programs.
      Robert Hammond
    Your message has been successfully submitted and would be delivered to recipients shortly.