我正在尝试在文件中创建文件系统。
在linux下很简单:
创建一个大小为 8 gb 的空白文件
dd of=fsFile bs=1 count=0 seek=8G
“格式化”驱动器:
mkfs.ext2 fsFile works great.
但是在从/usr/sbin ./mkfs.ext2 运行的 cygwin 下 有各种奇怪的错误(我假设是因为一些抽象)
但是使用 cygwin 我得到:
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.
甚至更糟(如果我尝试通过/cygdrive/...访问文件
mkfs.ext2: Bad file descriptor while trying to determine filesystem size
:( 请帮忙, 谢谢
最佳答案
好吧,看来解决它的方法是不要在您要修改的文件上使用任何路径。 这样做似乎已经解决了问题。
我的 8 gig 文件似乎确实有一个太大的文件大小,它似乎重置了大小变量,即
$ /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
还是谢谢
关于windows - cygwin 中的 mkfs.ext2 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5927718/