
Re: possible driver bug in ntfs-3g
Hello,
Following steps are used to create such a ntfs-volume and reproduce such error:
Create empty disk with size of 4K*102400 (419 MB)
root@teletex:/mnt/sd/d/1# dd if=/dev/zero of=testx.img bs=4k count=102400
102400+0 records in
102400+0 records out
419430400 bytes (419 MB) copied, 9.55843 s, 43.9 MB/s
Tell vdisk handler to add /mnt/sd/d/1/testx.img with blocksize=4096 (will be sector size for windows?) labeled as testx.
root@teletex:/mnt/sd/d/1# echo "add_device testx filename=/mnt/sd/d/1/testx.img;blocksize=4096" > /sys/kernel/scst_tgt/handlers/vdisk_fileio/mgmt
Show vdisk labled testx from 21:00:00:e0:8b:xx:5d:xx to any
root@teletex:/mnt/sd/d/1# echo "add testx 4" > /sys/kernel/scst_tgt/targets/qla2x00t/21:00:00:e0:8b:xx:5d:xx/luns/mgmt
Again for multipath
root@teletex:/mnt/sd/d/1# echo "add testx 4" > /sys/kernel/scst_tgt/targets/qla2x00t/21:00:00:e0:8b:yy:63:yy/luns/mgmt
Run diskmgmt.msc on Microsoft Windows [Version 6.1.7601] (Windows 2008 R2).
* MPIO already configured for disk SCST_FIOtestx.
1) Initializing disk with MBR partition style.
2) Creating New Simple Volume.
* Size 397 in MB
* Assigning drive letter X:
* Format this volume with following settings:
* File system: NTFS
* Allocation unit size: 64K
* Volume Label: testx
* [x] Perform quick format
3) Create a few directories on volume x: under directory admin
X:\admin>mkdir a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad a
e af ag ah ai aj ak al ao ap aq ar as at au av aw ax ay az
4) Mark device offline
5) Determine the partition start with hexdump:
root@teletex:/mnt/sd/d/1# hexdump -C testx.img |less
00040000 eb 52 90 4e 54 46 53 20 20 20 20 00 10 10 00 00 |.R.NTFS .....|
Offset is 00040000
Determine it in decimal
root@teletex:/mnt/sd/d/1# bc -l
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
obase=10
ibase=16
00040000
262144
6) losetup device
losetup -o 262144 -r /dev/loop1 testx.img
7) mount
ntfs-3g -o ro /dev/loop1 /mnt/loop1/

try to access the inode of x:\admin:
root@teletex:/mnt/sd/d/1# ls /mnt/loop1/admin/
ls: reading directory /mnt/loop1/admin/: Input/output error
Oct 31 18:50:43 teletex ntfs-3g[10981]: Version 2010.3.6 integrated FUSE 27
Oct 31 18:50:43 teletex ntfs-3g[10981]: Mounted /dev/loop1 (Read-Only, label "testx", NTFS 3.1)
Oct 31 18:50:43 teletex ntfs-3g[10981]: Cmdline options: ro
Oct 31 18:50:43 teletex ntfs-3g[10981]: Mount options: ro,silent,allow_other,nonempty,relatime,fsname=/dev/loop1,blkdev,blksize=4096
Oct 31 18:50:43 teletex ntfs-3g[10981]: Ownership and permissions disabled, configuration type 1
Oct 31 18:50:51 teletex ntfs-3g[10981]: Actual VCN (0x8) of index buffer is different from expected VCN (0x1) in inode 0x23.
Sorry about the imperative instructions.
I can tell you that Windows Disk Management is also against using blocksizes larger than 4K (Volume Manager crashes and does not start before taking disks of larger blocksize off from SAN).
Br,
-Mikko Kortelainen