[Top] [All Lists]

ADD 801063 - mkfs.xfs after having ext2 mounted on a device can fail

To: nathans@xxxxxxxxxxxxxxxxxxxx
Subject: ADD 801063 - mkfs.xfs after having ext2 mounted on a device can fail
From: pv@xxxxxxxxxxxxxxxxxxxxxx (lord@xxxxxxx)
Date: Fri, 8 Sep 2000 00:55:05 -0700 (PDT)
Cc: linux-xfs@xxxxxxxxxxx
Reply-to: sgi.bugs.xfs@xxxxxxxxxxxxxxxxx
Sender: owner-linux-xfs@xxxxxxxxxxx
 Submitter : lord                      Status : open                        
 Assigned Engineer : nathans           Priority : 3                         
*Modified Date : 09/08/00             *Modified User : lord                 
*Modified User Domain : sgi.com       *Description :
Running mkfs to build an xfs filesystem after a partition has
been mounted as ext2 has periodically failed for me. The failure
is usually this:

[root@lord /]# mkfs -t xfs -f -l size=16000b /dev/sda4
meta-data=/dev/sda4              isize=256    agcount=8, agsize=149104 blks
data     =                       bsize=4096   blocks=1192826, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=0
naming   =version 2              bsize=4096  
log      =internal log           bsize=4096   blocks=16000


From: steve lord <lord@xxxxxxx>
Date: Sep 08 2000 12:55:03AM
[pvnews version: 1.71]
> Steve,
> Please let me know whether this fixes your write error.
> I've also put a mkfs binary at babylon:/tmp/mkfs.xfs -
> could you run this one too, then send me the output and
> core file which it generates.

This fixes the error. Interestingly enough, there was just a message
in linux-fsdevel about a size off by one error in the block
device layer.

[I have been trying to get the linear md driver to work with NTFS volumes 
for several months and it never worked. - I was suspecting the NTFS driver 
(after having fixed linear md and verified that at least that worked fine) 
but today I finally found why it doesn't work:

There is a bug in reading/writing to block devices. - It manifests itself 
in the form that partitions are too small by exactly one sector!

Even though a cfdisk shows that a partition has a certain number of 
sectors, you can never seek + read and/or write to the last sector (doing 
file i/o using read/write(2) [also tried fread/fwrite(3), same result]. - 
Last sector doesn't seem to exist. However reading the actual hd (/dev/hdb 
or /dev/sda, ie. affects both IDE and SCSI) instead of the partition 
(/dev/hdb7 or whatever) the sector does exist and contains the expected 

Looks like it could be related. i.e. something is lying about the size.

<Prev in Thread] Current Thread [Next in Thread>