Search code examples
windowsfilesystemscygwinext2

mkfs.ext2 in cygwin not working


I'm attempting to create a fs within a file.

under linux it's very simple:

create a blank file size 8 gb

dd of=fsFile bs=1 count=0 seek=8G

"format" the drive:

mkfs.ext2 fsFile works great.

however under cygwin running from /usr/sbin ./mkfs.ext2 has all kinds of weird errors (i assume because of some abstraction)

But with cygwin i get:

mkfs.ext2: Device size reported to be zero. Invalid partition specified, or partition table wasn't reread after running fdisk, due to a modified partition being busy and in use. You may need to reboot to re-read your partition table.

or even worse (if i try to access a file through /cygdrive/...

mkfs.ext2: Bad file descriptor while trying to determine filesystem size

:( please help, Thanks


Solution

  • Well it seems that the way to solve it is to not use any path on the file you wish to modify. doing that seems to have solved it.

    also it seems that my 8 gig file does have a file size that's simply to big, it seems like it resets the size var i.e.

    $ /usr/sbin/fsck.ext2 -f testFile8GiG
    e2fsck 1.41.12 (17-May-2010)
    The filesystem size (according to the superblock) is 2097152 blocks
    The physical size of the device is 0 blocks
    Either the superblock or the partition table is likely to be corrupt!
    Abort? no
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    testFile8GiG: 122/524288 files (61.5% non-contiguous), 253313/2097152 blocks

    Thanks anyway