umsdos ruins ext2 file system

umsdos ruins ext2 file system

Post by Andreas Hel » Sat, 08 Jul 1995 04:00:00



I just remade a DOS partition into a ext2 file sytem. Since I forgot to
update the rc scripts, this partition was mounted as an umsdos file system.
This actually worked despite of the lack of a DOS FAT file system. First
suspicions came when df and du gave different answers about the contents of
this partition. Then I noticed that directory size was 8 KB and that file
names were truncated to 8 characters. Then I umounted the file system and
checked it with e2fsck. This program could not handle what if found and gave
up with a memory allocation error.
I think either mount or the kernel should check wether a DOS FAT file system
is present when mounting a partition as umsdos. My kernel was 1.2.8.

Andreas
--
*  Andreas Helke,  Institut fuer molekulare Genetik, Universitaet Heidelberg
**                        Im Neuenheimer Feld 230, 69122 Heidelberg, Germany
***                                 WWW: http://orion.mgen.uni-heidelberg.de
**** ftp://orion.mgen.uni-heidelberg.de - filemanager and Unix tools for DOS

 
 
 

umsdos ruins ext2 file system

Post by Alain Kna » Mon, 10 Jul 1995 04:00:00



: >I just remade a DOS partition into a ext2 file sytem. Since I forgot to
: >update the rc scripts, this partition was mounted as an umsdos file system.
: >This actually worked despite of the lack of a DOS FAT file system. First
: >suspicions came when df and du gave different answers about the contents of
: >this partition. Then I noticed that directory size was 8 KB and that file
: >names were truncated to 8 characters. Then I umounted the file system and
: >checked it with e2fsck. This program could not handle what if found and gave
: >up with a memory allocation error.
: >I think either mount or the kernel should check wether a DOS FAT file system
: >is present when mounting a partition as umsdos. My kernel was 1.2.8.

: This has been discussed before...
: It is caused by the fact that "mke2fs" does not overwrite the first sector
: of the partition, which is where the DOS filesystem stores its parameters.
 No, it is caused by the fact that the msdos filesystem checks for its
magic numbers in the first sector *only*. It should also do some consistency
checks using the FAT sectors. Moreover, msdos filesystems made by very old
DOS versions don't have any meaningful information in their first sector.
(Only the bootprogram, which is too variable to be used as "magic number").
For these old systems, all geometry information is encoded in the media
descriptor byte (first byte of the FAT).

 All other Linux filesystem check for magic numbers in the *second* sector.
The first sector is reserved for a boot program, and should not be overwritten
nor used by mk*fs.

: Hence, when you change a partition from DOS to ext2fs type, the DOS filesystem
: code still recognizes it.

: This can be avoided by clearing the bootsector of the partition, e.g.:

: dd if=/dev/zero of=/dev/sda1 bs=512 count=1

: (don't mis-type that command, or you will cause even greater havoc...)
 A good workaround, until the dosfs code is fixed.

: I think there was also some consensus that mke2fs should (optionally?)
: erase the first sector of the partition, but I don't know if this was
: really implemented or in what release that was done.
 I hope it was not :-) First, it wouldn't fix the problem (which would still
exist for the zillions of other filesystem types that Linux supports), and
second, it might make some disks unbootable.

: Rob
: --
: +------------------------------------+--------------------------------------+


: +------------------------------------+--------------------------------------+

--
 Alain

 
 
 

umsdos ruins ext2 file system

Post by Alain Kna » Tue, 11 Jul 1995 04:00:00



[...]
: Anyway, when the DOS filesystem code is changed it should not only make
: better checks, but it should also read the parameters and actually report
: them back to the floppy driver.  As it is now, when a diskette with 10
: sectors per track (DD) is used and mounted from /dev/fd, the system will
: report no errors but it will logically damage the disk because the
: filesystem's calculations of cluster locations are not consistent with
: the physical location on the floppy :-(
: So, when the diskette says "I'm 10 sectors/track" both the filesystem and
: the floppy driver should be notified of that.
 That's the reason why you should use mmount instead of mount for
these filesystems. Mmount takes care of these issues.

: >: I think there was also some consensus that mke2fs should (optionally?)
: >: erase the first sector of the partition, but I don't know if this was
: >: really implemented or in what release that was done.
: > I hope it was not :-) First, it wouldn't fix the problem (which would still
: >exist for the zillions of other filesystem types that Linux supports), and
: >second, it might make some disks unbootable.

: I don't believe that.
: The bootcode in the partition bootsector (or first sector on a floppy) os
: too dependent on the structure of the filesystem to survive a change of
: filesystem type.  A disk that had a DOS filesystem with a valid bootsector
: will never boot after it has been changed to ext2fs, no matter if you
: preserve the bootsector.

 Not true. One example: On my floppy disks, I have a boot sector which
transfers the boot process to hard disk. This way, I don't need to
remove disks from my drive when rebooting (Yes, I know about viruses,
but these are Linux only disks, and thus the risk is quite
small). With your proposed change, this boot sector would go away
after e2fsck. (Yes, it is easy to replace, but why cause an
inconvenience just to work around a bug in the msdos fs code, which
could be easily fixed in the msdos fs code?)

: Rob
: --
: +------------------------------------+--------------------------------------+


: +------------------------------------+--------------------------------------+

--
 Alain

 
 
 

umsdos ruins ext2 file system

Post by Alain Kna » Tue, 11 Jul 1995 04:00:00


:   If I'm not mistaken, the signature 0xAA55 is the last word on the
: first sectory of _any_ MSDOS file system. All mke2fs should do is
 But unfortunately not _only_ of MSDOS file systems...

: make _SURE_ that those two bytes are zeroed.  Since this signature
: is required, all MSDOS boot sectors should have it, and all MS-DOS
: boot sector routines shouldn't ever use those last two bytes.
 No, 0xAA55 is the signature of any bootable sector. It has nothing to
do with msdos per se. We shouldn't make mke2fs inconvenient to use
just to work around a bug in msdosfs. Bugs in msdosfs should be fixed
in msdosfs itself.

: --
: Copyright 1995 Jason McMullan.  License for the Microsoft Network to distribute
: this text for $100,000 U.S. dollars per copy is hereby granted.  All other use
: of this text by the Microsoft Network, including storing, relaying, or reuse is
: expressly prohibited. Distribution by the Microsoft Network indicates full
: acceptance of the licensing terms.

--
 Alain

 
 
 

umsdos ruins ext2 file system

Post by Jason Mcmull » Tue, 11 Jul 1995 04:00:00



: :   If I'm not mistaken, the signature 0xAA55 is the last word on the
: : first sectory of _any_ MSDOS file system. All mke2fs should do is
:  But unfortunately not _only_ of MSDOS file systems...

: : make _SURE_ that those two bytes are zeroed.  Since this signature
: : is required, all MSDOS boot sectors should have it, and all MS-DOS
: : boot sector routines shouldn't ever use those last two bytes.
:  No, 0xAA55 is the signature of any bootable sector. It has nothing to
: do with msdos per se. We shouldn't make mke2fs inconvenient to use
: just to work around a bug in msdosfs. Bugs in msdosfs should be fixed
: in msdosfs itself.

I beg to differ: the BIOS looks for the byte 0xE9 as the first byte of a
drive to determine bootablity. Take a floppy and try zapping the "signature"
and it will _still_ boot, but take out that jump opcode (0xE9) and the bios
won't think it's bootable.

--
Copyright 1995 Jason McMullan.  License for the Microsoft Network to distribute
this text for $100,000 U.S. dollars per copy is hereby granted.  All other use
of this text by the Microsoft Network, including storing, relaying, or reuse is
expressly prohibited. Distribution by the Microsoft Network indicates full
acceptance of the licensing terms.

 
 
 

umsdos ruins ext2 file system

Post by Jason Mcmull » Tue, 11 Jul 1995 04:00:00


  If I'm not mistaken, the signature 0xAA55 is the last word on the
first sectory of _any_ MSDOS file system. All mke2fs should do is
make _SURE_ that those two bytes are zeroed.  Since this signature
is required, all MSDOS boot sectors should have it, and all MS-DOS
boot sector routines shouldn't ever use those last two bytes.

--
Copyright 1995 Jason McMullan.  License for the Microsoft Network to distribute
this text for $100,000 U.S. dollars per copy is hereby granted.  All other use
of this text by the Microsoft Network, including storing, relaying, or reuse is
expressly prohibited. Distribution by the Microsoft Network indicates full
acceptance of the licensing terms.

 
 
 

umsdos ruins ext2 file system

Post by Alain Kna » Tue, 11 Jul 1995 04:00:00


: I beg to differ: the BIOS looks for the byte 0xE9 as the first byte of a
: drive to determine bootablity. Take a floppy and try zapping the "signature"
: and it will _still_ boot, but take out that jump opcode (0xE9) and the bios
: won't think it's bootable.

 Wrong on the first part. Just look at any non-lilo linux bootdisk, and
tell me which byte you find there :-)
 Maybe you're confusing with the method that Dos uses to differentiate
between Dos 1.x disks and later disks. If the jump opcode is present,
Dos assumes that it is a later disks, and looks for the geometry
information in the boot sector. If the jump opcode is not present, Dos
assumes that it is a Dos 1.x disk, and uses the media descriptor byte
(first byte of FAT) as an index into a table of predefined geometries.
Btw, it doesn't have to be 0xE9, 0xEB (short jump) is recognized too.

 You're right about the 0xAA55 signature: it is indeed ignored
by many BIOSes.

 Alain

 
 
 

umsdos ruins ext2 file system

Post by Daniel Quinl » Wed, 12 Jul 1995 04:00:00



> I think there was also some consensus that mke2fs should (optionally?)
> erase the first sector of the partition, but I don't know if this was
> really implemented or in what release that was done.

It was added in version 0.5b of the ext2fs tools and was also recently
added to the mkfs.minix in util-linux.

--
Daniel Quinlan          Member of the League for Programming Freedom

 
 
 

1. copy umsdos file system to ext2 file system

I have a fully opperational linux file system on a dos partition installed as a umsdos
system and would like to copy it to a linux ext2 partition. Is this possible?
I am using loadlin to load linux, I do not want to use lilo.
This is my present partition table:

/dev/hdb5  6   dos 16-bit >=32M    slackware 96
/dev/hdb6  83  Linux native        redhat 4.1
/dev/hdb7  83  Linux native        empty ext2 500meg partition

Linux on hdb5 is running perfectly and I have almost 300Megs on it and I don't want
to load it from scratch.

Thaanks in advance,


2. 7248-120 Restore from mksysb...

3. How to access files in ext2 file system in windows(same system)

4. Solaris->NT print? Half-baked RFC1179 in netstandard (/usr/lib/lp/bin/netpr)

5. Mounting umsdos from ext2 system ??

6. Post Install Logon as root problems.

7. BUG in ext2 file-system (2.0.33 kernel): tried to extend a file using lseek

8. batch tiff conversion

9. Enhanced Filing system - file system like DEC Advanced File system for Linux

10. UMSDOS file system structer

11. Running "mkswap" in UMSDOS File System

12. UMSDOS Read-Only file system???

13. UMSDOS w/Win95 OSR2 FAT32 File System