Discussion:
[Freedos-user] Thousands of "Run chkdsk: Bad FAT I/O: 0x..." messages, error when formatting
André Bachmann
2012-11-09 15:47:19 UTC
Permalink
Hi there,

I was going to install FreeDOS 1.1 on a USB drive within qemu 1.1.1 on
Opensuse 12.2 32 bit. After selecting the language in the FreeDOS
installer, my notebook was busy during the next hour with thousands of
thousands of messages like "Run chkdsk: Bad FAT I/O: 0x...".
Here is exactly what I did:
- plugged in a USB drive
- erased all partition data with "dd if=/dev/zero of=/dev/sdb bs=1M count=16"
- created a new FAT16 partition with fdisk (1 GB, partition label 6),
set this to active
- created the filesystem with "mkfs -t vfat -n FreeDOS /dev/sdb1"

After that, I started qemu with "qemu-system-i386 -hda /dev/sdb -cdrom
fd11src.iso -boot d". The FreeDOS installer started, I begun the
installation with "1". It let me choose my language, and after this
the enormous amount of error messages. About an hour later, the
installer finally asked me where to install - I chose C: (the
installer showed me mysteriously only 255 MB). Then it asked me if I
want to format the drive with FAT32 - which I accepted. However, now
it showed me the following error message:

Invalid Drive! Aborting.
[Error 61]
FORMAT status: 4
Could not format your hard disk

So what is wrong here?

André
Bernd Blaauw
2012-11-09 18:17:35 UTC
Permalink
Post by André Bachmann
Hi there,
I was going to install FreeDOS 1.1 on a USB drive within qemu 1.1.1 on
Opensuse 12.2 32 bit. After selecting the language in the FreeDOS
installer, my notebook was busy during the next hour with thousands of
thousands of messages like "Run chkdsk: Bad FAT I/O: 0x...".
I've seen this as well, usually with a drive C: (primary active FAT32
partition) that didn't have a filesystem on it yet (done by FORMAT) Some
installation tools check drive C: to see if it's present.
Post by André Bachmann
- plugged in a USB drive
- erased all partition data with "dd if=/dev/zero of=/dev/sdb bs=1M count=16"
- created a new FAT16 partition with fdisk (1 GB, partition label 6),
set this to active
- created the filesystem with "mkfs -t vfat -n FreeDOS /dev/sdb1"
You could try providing this USB Flash Device to QEMU without first
assigning a partition and filesystem. FreeDOS is able to do it by itself
using the FDISK program to create a partition, and FORMAT program (after
rebooting QEMU once FDISK has finished). FORMAT C: /Q should do the
Post by André Bachmann
After that, I started qemu with "qemu-system-i386 -hda /dev/sdb -cdrom
fd11src.iso -boot d". The FreeDOS installer started, I begun the
installation with "1". It let me choose my language, and after this
the enormous amount of error messages. About an hour later, the
installer finally asked me where to install - I chose C: (the
installer showed me mysteriously only 255 MB). Then it asked me if I
want to format the drive with FAT32 - which I accepted. However, now
Invalid Drive! Aborting.
[Error 61]
FORMAT status: 4
Could not format your hard disk
Not seen this error before, sorry.

Is your USB stick more emulator-friendly if performing the partitioning
with Gparted or something?

Standard reference procedure should be something like detailed in:
http://sourceforge.net/apps/mediawiki/freedos/index.php?title=VirtualBox

Bernd
Eric Auer
2012-11-09 18:42:14 UTC
Permalink
Hi Bernd, Andre,
Post by Bernd Blaauw
Post by André Bachmann
I was going to install FreeDOS 1.1 on a USB drive within qemu 1.1.1 on
Opensuse 12.2 32 bit. After selecting the language in the FreeDOS
installer, my notebook was busy during the next hour with thousands of
thousands of messages like "Run chkdsk: Bad FAT I/O: 0x...".
The kernel produces that message when "getblock" fails. Bernd,
the message is printed by "clusterMessage" and "getblock" is a
macro for "getblk" (x, y, FALSE) which apparently is, more or
less, a wrapper for "dskxfer" to let BUFFERS do their work...

Probably something tried to access the drive as if it already
was formatted while it was not, maybe failed to set a flag to
mark the drive as unformatted in some internal processing...
Post by Bernd Blaauw
I've seen this as well, usually with a drive C: (primary active FAT32
partition) that didn't have a filesystem on it yet (done by FORMAT) Some
installation tools check drive C: to see if it's present.
That might fit the above, yes. Is it specific to USB drives?
Post by Bernd Blaauw
Post by André Bachmann
- plugged in a USB drive
- erased all partition data with "dd if=/dev/zero of=/dev/sdb bs=1M count=16"
- created a new FAT16 partition with fdisk (1 GB, partition label 6),
set this to active
- created the filesystem with "mkfs -t vfat -n FreeDOS /dev/sdb1"
You should reboot between the last 2 steps if it were DOS,
but apparently you used Linux. When you create DOS drives
in Linux, you might accidentally mismatch CHS, LBA, FAT32
and FAT16 at some point, although I am not sure if there
is a risk to do so during the steps described above. Also,
at least with older mkdosfs (from dosfstools) it happened
that the partition offset and/or geometry were not nicely
set in the boot sector, causing extra work for my boot
sector installing Perl script sys-freedos-linux. I think
that using SYS in DOS itself had no problems, though, at
least when you booted via any non-virtual way first :-)
Post by Bernd Blaauw
You could try providing this USB Flash Device to QEMU without first
assigning a partition and filesystem. FreeDOS is able to do it by itself
using the FDISK program to create a partition, and FORMAT program (after
rebooting QEMU once FDISK has finished). FORMAT C: /Q should do the
Actually you should NOT use FORMAT /Q in this case: That
would try to backup some details to support later UNFORMAT
which does not make much sense on a freshly partitioned
drive. You can use FORMAT /Q /U to avoid the saving of
unformat data if speed is an issue, or just use FORMAT
without /Q option to get a non-quick format process :-)
If you use /U without /Q, the whole drive contents will
be wiped which can take a very long time in DOS.
Post by Bernd Blaauw
Post by André Bachmann
After that, I started qemu with "qemu-system-i386 -hda /dev/sdb -cdrom
fd11src.iso -boot d". The FreeDOS installer started, I begun the
installation with "1". It let me choose my language, and after this
the enormous amount of error messages. About an hour later, the
installer finally asked me where to install - I chose C: (the
installer showed me mysteriously only 255 MB). Then it asked me if I
want to format the drive with FAT32 - which I accepted. However, now
Invalid Drive! Aborting.
[Error 61]
FORMAT status: 4
Could not format your hard disk
The main.c source code of FORMAT suggests that this will
happen if your drive is neither remote nor SUBST-ed but
still you cannot get a truename of X:\ where X is the
drive letter of the drive in question... Truename here
is used to check for ASSIGN, JOIN or SUBST, but as it
fails to check this at all, the drive is probably not
even registered for DOS yet... Maybe rebooting between
the FDISK and the FORMAT step would help here - in the
QEMU case virtually rebooting is of course enough :-)
Post by Bernd Blaauw
Is your USB stick more emulator-friendly if performing the partitioning
with Gparted or something?
I would also suggest that. GPARTED makes it very easy
to partition and format a drive with a few mouse clicks
and as you have QEMU, you apparently already have Linux.
If not, there are also a number of nice ISOs to make a
bootable CD or DVD with GPARTED, or make a boot stick.
Post by Bernd Blaauw
http://sourceforge.net/apps/mediawiki/freedos/index.php?title=VirtualBox
Good point. We already have that howto for VirtualBox,
somebody could make a howto for Qemu based on that :-)

Eric
Felix Miata
2012-11-09 19:11:44 UTC
Permalink
Post by Eric Auer
Post by André Bachmann
I was going to install FreeDOS 1.1 on a USB drive within qemu 1.1.1 on
Opensuse 12.2 32 bit. After selecting the language in the FreeDOS
installer, my notebook was busy during the next hour with thousands of
thousands of messages like "Run chkdsk: Bad FAT I/O: 0x...".
The kernel produces that message when "getblock" fails. Bernd,
the message is printed by "clusterMessage" and "getblock" is a
macro for "getblk" (x, y, FALSE) which apparently is, more or
less, a wrapper for "dskxfer" to let BUFFERS do their work...
Probably something tried to access the drive as if it already
was formatted while it was not, maybe failed to set a flag to
mark the drive as unformatted in some internal processing...
The Bad FAT I/O: 0x000000x topic has appeared on the DFSee mailing list
several times without leading to any solution, e.g.:
http://tech.groups.yahoo.com/group/dfsee-support/message/10101
http://tech.groups.yahoo.com/group/dfsee-support/message/12917
http://tech.groups.yahoo.com/group/dfsee-support/message/13536
http://tech.groups.yahoo.com/group/dfsee-support/message/14049
--
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata *** http://fm.no-ip.com/
André Bachmann
2012-11-10 11:11:42 UTC
Permalink
Post by Eric Auer
Hi Bernd, Andre,
Post by Bernd Blaauw
Post by André Bachmann
I was going to install FreeDOS 1.1 on a USB drive within qemu 1.1.1 on
Opensuse 12.2 32 bit. After selecting the language in the FreeDOS
installer, my notebook was busy during the next hour with thousands of
thousands of messages like "Run chkdsk: Bad FAT I/O: 0x...".
The kernel produces that message when "getblock" fails. Bernd,
the message is printed by "clusterMessage" and "getblock" is a
macro for "getblk" (x, y, FALSE) which apparently is, more or
less, a wrapper for "dskxfer" to let BUFFERS do their work...
Probably something tried to access the drive as if it already
was formatted while it was not, maybe failed to set a flag to
mark the drive as unformatted in some internal processing...
Yesterday I tested a little bit more and I noticed that these messages
("Run chkdsk: Bad FAT I/O: 0x...") don't appear if I change only one
small step in my way: If I use the partition label c (FAT32) instead
of 6 (FAT16), all is fine. Maybe this helps you to further track down
the errors?
Post by Eric Auer
Post by Bernd Blaauw
I've seen this as well, usually with a drive C: (primary active FAT32
partition) that didn't have a filesystem on it yet (done by FORMAT) Some
installation tools check drive C: to see if it's present.
That might fit the above, yes. Is it specific to USB drives?
Post by Bernd Blaauw
Post by André Bachmann
- plugged in a USB drive
- erased all partition data with "dd if=/dev/zero of=/dev/sdb bs=1M count=16"
- created a new FAT16 partition with fdisk (1 GB, partition label 6),
set this to active
- created the filesystem with "mkfs -t vfat -n FreeDOS /dev/sdb1"
You should reboot between the last 2 steps if it were DOS,
but apparently you used Linux. When you create DOS drives
in Linux, you might accidentally mismatch CHS, LBA, FAT32
and FAT16 at some point, although I am not sure if there
is a risk to do so during the steps described above. Also,
at least with older mkdosfs (from dosfstools) it happened
that the partition offset and/or geometry were not nicely
set in the boot sector, causing extra work for my boot
sector installing Perl script sys-freedos-linux. I think
that using SYS in DOS itself had no problems, though, at
least when you booted via any non-virtual way first :-)
Post by Bernd Blaauw
You could try providing this USB Flash Device to QEMU without first
assigning a partition and filesystem. FreeDOS is able to do it by itself
using the FDISK program to create a partition, and FORMAT program (after
rebooting QEMU once FDISK has finished). FORMAT C: /Q should do the
Actually you should NOT use FORMAT /Q in this case: That
would try to backup some details to support later UNFORMAT
which does not make much sense on a freshly partitioned
drive. You can use FORMAT /Q /U to avoid the saving of
unformat data if speed is an issue, or just use FORMAT
without /Q option to get a non-quick format process :-)
If you use /U without /Q, the whole drive contents will
be wiped which can take a very long time in DOS.
Post by Bernd Blaauw
Post by André Bachmann
After that, I started qemu with "qemu-system-i386 -hda /dev/sdb -cdrom
fd11src.iso -boot d". The FreeDOS installer started, I begun the
installation with "1". It let me choose my language, and after this
the enormous amount of error messages. About an hour later, the
installer finally asked me where to install - I chose C: (the
installer showed me mysteriously only 255 MB). Then it asked me if I
want to format the drive with FAT32 - which I accepted. However, now
Invalid Drive! Aborting.
[Error 61]
FORMAT status: 4
Could not format your hard disk
The main.c source code of FORMAT suggests that this will
happen if your drive is neither remote nor SUBST-ed but
still you cannot get a truename of X:\ where X is the
drive letter of the drive in question... Truename here
is used to check for ASSIGN, JOIN or SUBST, but as it
fails to check this at all, the drive is probably not
even registered for DOS yet... Maybe rebooting between
the FDISK and the FORMAT step would help here - in the
QEMU case virtually rebooting is of course enough :-)
Post by Bernd Blaauw
Is your USB stick more emulator-friendly if performing the partitioning
with Gparted or something?
I would also suggest that. GPARTED makes it very easy
to partition and format a drive with a few mouse clicks
and as you have QEMU, you apparently already have Linux.
If not, there are also a number of nice ISOs to make a
bootable CD or DVD with GPARTED, or make a boot stick.
I will try it with gparted.
Post by Eric Auer
Post by Bernd Blaauw
http://sourceforge.net/apps/mediawiki/freedos/index.php?title=VirtualBox
Good point. We already have that howto for VirtualBox,
somebody could make a howto for Qemu based on that :-)
Eric
Well, all of this problems would be much less annoying if there would
be an image on the FreeDOS site which I can simply dd to an USB drive
- all of these error prone steps would be unnecessary.
Post by Eric Auer
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Freedos-user mailing list
https://lists.sourceforge.net/lists/listinfo/freedos-user
Bernd Blaauw
2012-11-10 12:07:51 UTC
Permalink
Post by André Bachmann
Well, all of this problems would be much less annoying if there would
be an image on the FreeDOS site which I can simply dd to an USB drive
- all of these error prone steps would be unnecessary.
Which emulation or (para)virtualisation product uses/produces harddisk
images that can directly be 'dd'ed to a physical disk? I've experimented
a bit with Isohybrid images (CD image with harddisk header) that can be
written to USB stick, but afterwards Windows doesn't like the stick
anymore as it wants to format it. Also installing FreeDOS on the same
stick isn't that much of a success.

USB stick partition layout:
* MBR (not UEFI/EFI's GPT)
* partition 1: active, primary, (unknown / non-DOS) read-only ISO9660
* partition 2: primary, FAT32, writeable.

After writing the FreeDOS CD to partition 1, and booting from the stick,
the idea is a small bootdisk image is loaded in memory from this CD
filesystem (DOS boots only from FAT, not ISO9660) after which the rest
of the 1st partition is accessed. Unfortunately no CD driver exists for
this kind of scenario.
A workaround is loading a secondary ISO file in memory from this 1st
partition, allowing FreeDOS to find its files using the ELTORITO.SYS driver.
With the files found, creation and installation to partition 2 is possible

Windows insisting on removable media not being allowed to have
partitions, let alone using unrecognised filesystems on them, isn't
helping at all to proceed.

[
http://code.google.com/p/nanox-microwindows-nxlib-fltk-for-dos/wiki/XFDOS ]
uses a bootable harddisk image but no individual harddisk image file is
available, only a CD which uses harddisk-emulation.

Bernd
Eric Auer
2012-11-10 13:10:44 UTC
Permalink
Hi!

(Note to Felix: That yahoo group seems to be not open?)
Post by André Bachmann
Yesterday I tested a little bit more and I noticed that these messages
("Run chkdsk: Bad FAT I/O: 0x...") don't appear if I change only one
small step in my way: If I use the partition label c (FAT32) instead
of 6 (FAT16), all is fine. Maybe this helps you to further track down
the errors?
Maybe your drive is too big (more than 8 GB if geometry
is perfect) or has confused geometry (USB does not have
any real CHS geometry, so mismatches between different
components about what CHS should be are frequent) which
made FAT16 CHS a problem? Try using type e (FAT16 LBA)
and maybe compare if type b (FAT32 CHS) fails as type 6
(FAT16 CHS) if you want to do some more experiments :-)
Post by André Bachmann
Post by Eric Auer
Actually you should NOT use FORMAT /Q in this case: That
would try to backup some details to support later UNFORMAT
I think FORMAT /Q /U or format without options are nice.
Post by André Bachmann
Well, all of this problems would be much less annoying if there would
be an image on the FreeDOS site which I can simply dd to an USB drive
- all of these error prone steps would be unnecessary.
That would be relatively easy with a FAT partitioned image
but gives you side effects: If the image is for size X and
your stick has more space, the rest just stays unused. But
then on the other hand, more fancy approaches like Bernd's
image with ISO and FAT partitions combined have other side
effects, in his case making Windows think that the stick is
so weird that Windows wants to format it :-p

I think because everybody has sticks around and prices are
low, we could try to make people happy with a small image
(whatever is appropriate, maybe 1 GB? Then you also have a
lot of space to add your own data) with fixed partitioning.

Advanced users can use e.g. GPARTED to grow the partition
to fill the stick or can add more partitions, while others
can just re-format the stick when they are done with using
it for DOS. I assume re-formatting is easy in Windows??

Regards, Eric

Loading...