Windows Logical Disk Manager error
Hi,
while using a disc partitioned with ldm the following error occures:
sda:<6>ldm_validate_vmdb(): VMDB and TOCBLOCK don't agree on the database size.
[LDM] sda1 sda2 sda3 sda4
One partition is then unaccessible (though it works in windows). Kernel version is 2.6.8.1, but the problem also seems to appear in earlier versions.
# mount -t ntfs /dev/sda1 /mnt/d # ls /mnt/d ls: reading directory /mnt/d: Input/output error
# dmesg attempt to access beyond end of device sda1: rw=0, want=58136241, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136240. attempt to access beyond end of device sda1: rw=0, want=58136242, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136241. attempt to access beyond end of device sda1: rw=0, want=58136243, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136242. attempt to access beyond end of device sda1: rw=0, want=58136244, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136243. attempt to access beyond end of device sda1: rw=0, want=58136245, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136244. attempt to access beyond end of device sda1: rw=0, want=58136246, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136245. attempt to access beyond end of device sda1: rw=0, want=58136247, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136246. attempt to access beyond end of device sda1: rw=0, want=58136248, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136247. attempt to access beyond end of device sda1: rw=0, want=58136241, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136240. attempt to access beyond end of device sda1: rw=0, want=58136242, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136241. attempt to access beyond end of device sda1: rw=0, want=58136243, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136242. attempt to access beyond end of device sda1: rw=0, want=58136244, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136243. attempt to access beyond end of device sda1: rw=0, want=58136245, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136244. attempt to access beyond end of device sda1: rw=0, want=58136246, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136245. attempt to access beyond end of device sda1: rw=0, want=58136247, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136246. attempt to access beyond end of device sda1: rw=0, want=58136248, limit=54138987 NTFS-fs error (device sda1): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 58136247. NTFS-fs error (device sda1): ntfs_readdir(): Reading index allocation data failed.
Signature · 1 line
mg
Quoted 5 lines · Marcin Gibuła
while using a disc partitioned with ldm the following error occures:
sda:<6>ldm_validate_vmdb(): VMDB and TOCBLOCK don't agree on the database size.
[LDM] sda1 sda2 sda3 sda4
Can you compile in ldm debugging support and then send the full debug output at boot time?
Also can you download the ldm tools
(http://linux-ntfs.sourceforge.net/downloads.html) and copy the ldm database to a file and make it available to me?
To dump the database do:
download linux-ldm-0.0.8.tar.bz2 then:
tar xvjf linux-ldm-0.0.8.tar.bz2
cd linux-ldm-0.0.8/test
./ldminfo --copy /dev/sda
tar cvjf ldmdump.tar.bz2 sda.data sda.part
The created file ldmdump.tar.bz2 is what we need.
Thanks in advance.
Best regards,
Anton
Signature · 4 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/
Quoted 2 lines
Can you compile in ldm debugging support and then send the full debug output at boot time?
Here it goes:
SCSI device sda: 320173056 512-byte hdwr sectors (163929 MB)
SCSI device sda: drive cache: write back
sda:<7>ldm_validate_partition_table(): Found W2K dynamic disk partition type.ldm_parse_privhead(): Parsed PRIVHEAD successfully. ldm_parse_privhead(): Parsed PRIVHEAD successfully. ldm_parse_privhead(): Parsed PRIVHEAD successfully. ldm_validate_privheads(): Validated PRIVHEADs successfully. ldm_parse_tocblock(): Parsed TOCBLOCK successfully. ldm_parse_tocblock(): Parsed TOCBLOCK successfully. ldm_parse_tocblock(): Parsed TOCBLOCK successfully. ldm_parse_tocblock(): Parsed TOCBLOCK successfully. ldm_validate_tocblocks(): Validated TOCBLOCKs successfully. ldm_parse_vmdb(): Parsed VMDB successfully.ldm_validate_vmdb(): VMDB and TOCBLOCK don't agree on the database size. ldm_parse_vblk(): Parsed VBLK 0x401 (type: 0x45) ok. ldm_parse_vblk(): Parsed VBLK 0x406 (type: 0x51) ok. ldm_parse_vblk(): Parsed VBLK 0x403 (type: 0x34) ok. ldm_parse_vblk(): Parsed VBLK 0x408 (type: 0x32) ok. ldm_parse_vblk(): Parsed VBLK 0x40a (type: 0x33) ok. ldm_parse_vblk(): Parsed VBLK 0x500 (type: 0x51) ok. ldm_parse_vblk(): Parsed VBLK 0x504 (type: 0x33) ok. ldm_parse_vblk(): Parsed VBLK 0x448 (type: 0x33) ok. ldm_parse_vblk(): Parsed VBLK 0x44a (type: 0x33) ok. ldm_parse_vblk(): Parsed VBLK 0x506 (type: 0x33) ok. ldm_parse_vblk(): Parsed VBLK 0x502 (type: 0x32) ok. ldm_parse_vblk(): Parsed VBLK 0x527 (type: 0x33) ok. ldm_parse_vblk(): Parsed VBLK 0x523 (type: 0x51) ok. ldm_parse_vblk(): Parsed VBLK 0x525 (type: 0x32) ok. ldm_parse_vblk(): Parsed VBLK 0x444 (type: 0x51) ok. ldm_parse_vblk(): Parsed VBLK 0x446 (type: 0x32) ok. ldm_parse_vblk(): Parsed VBLK 0x415 (type: 0x34) ok.
[LDM] sda1 sda2 sda3 sda4ldm_partition(): Parsed LDM database successfully.
Quoted 3 lines
Also can you download the ldm tools
(http://linux-ntfs.sourceforge.net/downloads.html) and copy the ldm database to a file and make it available to me?
I've sent it on your e-mail.
Signature · 1 line
mg
Quoted 9 lines · Marcin Gibuła
Hi,
while using a disc partitioned with ldm the following error occures:sda:<6>ldm_validate_vmdb(): VMDB and TOCBLOCK don't agree on the database size.
[LDM] sda1 sda2 sda3 sda4One partition is then unaccessible (though it works in windows). Kernel version is 2.6.8.1, but the problem also seems to appear in earlier versions.
Ok, I have now had the time to look at the ldm database you sent me. The problem is very simple. You are using spanned volumes which are not supported by the Linux LDM driver. You need to use the software raid (MD) driver in Linux to assemble the LDM partition devices (shown above) into the correct MD devices and then mount the created md device(s). See linux-2.6/Documentation/filesystems/ntfs.txt for detailed description of what you need to do.
The details you may want to know are that you have 4 volumes, three with NTFS and one with FAT16:
Volume1: NTFS: Letter C in Windows: Size 10GiB
Volume2: NTFS: Letter D in Windows: Size 46GiB
Volume3: FAT16: Letter in Windows unknown: Size 28GiB
Volume6: NTFS: Letter in Windows unknown: Size 109GiB
Volume1 is a simple one partition volume which is the first LDM partition on your other harddisk (i.e. the one you did not send me the ldm dump from). You can just mount that with the NTFS driver.
Volume2 is a two partition concatenated volume made up of partitions sda1 (26GiB) and sda3 (20GiB) (in this order) on the disk you sent me the ldm dump from. This is why you get the errors when you try to mount sda1. It tries to access data that is outside sda1, i.e. in sda3, but sda1 ends at the end of sda1 (obviously) so the data is not readable. You need to assemble sda1 and sda3 using the instructions in the ntfs documentation (see above) and then mount the created MD device with the ntfs driver.
Volume3 is a simple one partition volume which is the second LDM partition on your other harddisk. You can just mount that with the vfat driver.
Volume6 is a two partition concatenated volume mad up of partitions sda4 (109GiB) and sda2 (32kiB!) (in this order!) on the disk you sent me the ldm dump from. You should assemble this as described for Volume2 and then mount the created MD device with the ntfs driver.
btw. You can obtain all the above information yourself in the future by running:
linux-ldm-0.0.8/test/ldminfo --dump /dev/sda
And then putting the displayed info together.
Let me know how it goes. Both success and failures are interesting to me as I do not remember anyone actually having had spanned ldm volumes before so it would be nice to know it all works...
Best regards,
Anton
Signature · 4 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/
Quoted 3 lines
Volume3 is a simple one partition volume which is the second LDM partition on your other harddisk. You can just mount that with the vfat driver.
Yep, it's working.
Quoted 4 lines
Volume6 is a two partition concatenated volume mad up of partitions sda4 (109GiB) and sda2 (32kiB!) (in this order!) on the disk you sent me the ldm dump from. You should assemble this as described for Volume2 and then mount the created MD device with the ntfs driver.
Maybe I should explain what is my disc layout...
Volume2 is one partition, and Volume6 is mounted as one of its directories, something like:
D:\ <- Volume2
D:\download <- Volume6
Volume6 works fine without using software raid though. Volume2 does not.
Quoted 3 lines
Let me know how it goes. Both success and failures are interesting to me as I do not remember anyone actually having had spanned ldm volumes before so it would be nice to know it all works...
I've tried the following:
# mdadm --build /dev/md1 -l linear -n 2 /dev/sda1 /dev/sda3 mdadm: array /dev/md1 built and started. # mount /dev/md1 /mnt/d # ls /mnt/d ls: reading directory /mnt/d: Input/output error
dmesg output:
NTFS volume version 3.1.
NTFS-fs error (device md1): ntfs_readdir(): Actual VCN (0x6e68dc76fa7923) of index buffer is different from expected VCN (0x4). Directory inode 0x5 is corrupt or driver bug.
Signature · 1 line
mg
Quoted 5 lines · Marcin Gibuła
Quoted 4 lines
Volume6 is a two partition concatenated volume mad up of partitions sda4 (109GiB) and sda2 (32kiB!) (in this order!) on the disk you sent me the ldm dump from. You should assemble this as described for Volume2 and then mount the created MD device with the ntfs driver.
Quoted 8 lines
Maybe I should explain what is my disc layout...
Volume2 is one partition, and Volume6 is mounted as one of its directories, something like:D:\ <- Volume2
D:\download <- Volume6Volume6 works fine without using software raid though. Volume2 does not.
I would not advise you to use volume6 without the md driver. You are then missing the last 32kb off the end and you never know when they might be needed and access to the volume might fall over just when you expect it least. Also the backup bootsector is in the last sector so you are at present missing that and even worse something like chkdsk could think "corrupt volume, lets fix it" and damage your volume because you are missing the end.
Quoted 9 lines
Quoted 3 lines
Let me know how it goes. Both success and failures are interesting to me as I do not remember anyone actually having had spanned ldm volumes before so it would be nice to know it all works...
I've tried the following:
# mdadm --build /dev/md1 -l linear -n 2 /dev/sda1 /dev/sda3 mdadm: array /dev/md1 built and started. # mount /dev/md1 /mnt/d
Volume2 not working can have a possible explanation in that it might be assembled incorrectly. For example, Windows is using 512-byte blocks but Linux 1024-byte blocks so if your first partition has an odd number of sectors Windows will use the last sector whereas Linux will cut off the last sector and hence all data in the second partition will be shifted by 512-bytes in the array which you cause all data to appear corrupt in the second part of the volume. I have seen this happen in my own experiments on the Windows NT4 fault tolerant linear raid volumes, I have not done experiments with Windows 2k/xp LDM linear raid volumes. If this is the case you cannot use the md driver and are stuck I am afraid. At least I am not aware of any Linux utility/driver that will allow you to work in this case.
Alternatively maybe Windows 2k/XP LDM linear raid volumes are using the cluster size as the block size instead of 512-byte blocks. If that were the case and your cluster size is > 1024 bytes (very likely on such a large volume, it is probably 4096 bytes) then the second part of the volume is again misaligned when assembled but in the opposite direction. Fortunately you can fix this case by using the "--rounding=" parameter to mdadm. So if you have a cluster size of 4k try --rounding=4. (If you don't know your cluster size enable debugging in the ntfs driver and then do the mount and "dmesg | grep cluster_size" will tell you the answer. To enable debugging in the driver it must be compiled with debugging enabled and you need to, as root, do: "echo 1 > /proc/sys/fs/ntfs-debug" after loading the module if modular and before doing the mount command.)
# ls /mnt/d
Quoted 7 lines
ls: reading directory
/mnt/d: Input/output errordmesg output:
NTFS volume version 3.1.
NTFS-fs error (device md1):ntfs_readdir(): Actual VCN (0x6e68dc76fa7923) of index buffer is different from expected VCN (0x4). Directory inode0x5is corrupt or driver bug.
I have seen this particular error before and it was due to the volume having been upgraded from FAT to NTFS (and the conversion utility apparently had screwed up the vcns in at least one directory). Running "chkdsk /f" on it fixed it in that particular case (even though chkdsk reported no errors, apparently it fixed them without telling anyone!). So this is worth trying before you start messing around with --rounding= and mdadm.
Best regards,
Anton
Signature · 4 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/
Quoted 2 lines
I would not advise you to use volume6 without the md driver. You are then missing the last 32kb off the end and you never know when they
Well, I can't even build it... mdadm failes and driver complains with
md: Dev sda2 smaller than chunk_size: 0k < 32k
Different chunk size doesn't make any difference.
Quoted 8 lines
direction. Fortunately you can fix this case by using the "--rounding=" parameter to mdadm. So if you have a cluster size of 4k try --rounding=4. (If you don't know your cluster size enable debugging in the ntfs driver and then do the mount and "dmesg | grep
cluster_size" will tell you the answer. To enable debugging in the driver it must be compiled with debugging enabled and you need to, as root, do: "echo 1 >/proc/sys/fs/ntfs-debug" after loading the module if modular and before doing the mount command.)
According to ntfs driver output my cluster size is indeed 4kb, but it still failes to read mounted fs.
Error is now:
NTFS-fs error (device md1): ntfs_readdir(): Actual VCN (0x20006500680054) of index buffer is different from expected VCN (0x4). Directory inode 0x5 is corrupt or driver bug.
Oh, and my system (and kernel) is x86-64 if it matters.
Quoted 4 lines
"chkdsk /f" on it fixed it in that particular case (even though chkdsk reported no errors, apparently it fixed them without telling anyone!). So this is worth trying before you start messing around with --rounding= and mdadm.
I've tried that. No effect though.
Signature · 1 line
mg
Quoted 6 lines · Marcin Gibuła
Quoted 2 lines
I would not advise you to use volume6 without the md driver. You are then missing the last 32kb off the end and you never know when they
Well, I can't even build it... mdadm failes and driver complains with
md: Dev sda2 smaller thanchunk_size: 0k < 32k
Different chunk size doesn't make any difference.
That is a bug in the md driver then.
Quoted 9 lines
Quoted 8 lines
direction. Fortunately you can fix this case by using the "--rounding=" parameter to mdadm. So if you have a cluster size of 4k try --rounding=4. (If you don't know your cluster size enable debugging in the ntfs driver and then do the mount and "dmesg | grep
cluster_size" will tell you the answer. To enable debugging in the driver it must be compiled with debugging enabled and you need to, as root, do: "echo 1 >/proc/sys/fs/ntfs-debug" after loading the module if modular and before doing the mount command.)
Quoted 7 lines
According to ntfs driver output my cluster size is indeed 4kb, but it still failes to read mounted fs.
Error is now:
NTFS-fs error (device md1):ntfs_readdir(): Actual VCN (0x20006500680054) of index buffer is different from expected VCN (0x4). Directory inode0x5is corrupt or driver bug.
So the number has changed. Means it is aligning the two pieces differently. But still not correctly. Actually, having looked at the dump of your LDM database again, it is not rounding anything at all. It behaves exactly like the NT4 fault tolerant arrays, i.e. it uses all 512-byte sectors to store data.
You can see it from:
Volume2 Size: 0x05AB2EA2 (46437 MB)
Volume2-01
Disk2-01 VolumeOffset: 0x00000000 Offset: 0x00000000 Length:
0x033A186B
Disk2-02 VolumeOffset: 0x033A186B Offset: 0x033A18AA Length:0x02711637
Disk2-01 contains 0x033a186B sectors == 5413987 in decimal an you can see the number is odd and hence the Linux md driver cannot work as it uses 1024 bytes minimum so it can never work. )-:
Disk2-02 starts at the offset Disk2-01 stops and hence the Linux md driver again cannot work.
Sorry but with current Linux md driver and tools it is not possible to make your linear arrays work.
Quoted 1 line
Oh, and my system (and kernel) is x86-64 if it matters.
It doesn't.
Best regards,
Anton
Signature · 4 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/
Quoted 46 lines · Anton Altaparmakov
Quoted 6 lines · Marcin Gibuÿÿa
Quoted 2 lines
I would not advise you to use volume6 without the md driver. You are then missing the last 32kb off the end and you never know when they
Well, I can't even build it... mdadm failes and driver complains with
md: Dev sda2 smaller thanchunk_size: 0k < 32k
Different chunk size doesn't make any difference.That is a bug in the md driver then.
Quoted 9 lines
Quoted 8 lines
direction. Fortunately you can fix this case by using the "--rounding=" parameter to mdadm. So if you have a cluster size of 4k try --rounding=4. (If you don't know your cluster size enable debugging in the ntfs driver and then do the mount and "dmesg | grep
cluster_size" will tell you the answer. To enable debugging in the driver it must be compiled with debugging enabled and you need to, as root, do: "echo 1 >/proc/sys/fs/ntfs-debug" after loading the module if modular and before doing the mount command.)Quoted 7 lines
According to ntfs driver output my cluster size is indeed 4kb, but it still failes to read mounted fs.
Error is now:
NTFS-fs error (device md1):ntfs_readdir(): Actual VCN (0x20006500680054) of index buffer is different from expected VCN (0x4). Directory inode0x5is corrupt or driver bug.So the number has changed. Means it is aligning the two pieces differently. But still not correctly. Actually, having looked at the dump of your LDM database again, it is not rounding anything at all. It behaves exactly like the NT4 fault tolerant arrays, i.e. it uses all 512-byte sectors to store data.
You can see it from:
Volume2 Size:
0x05AB2EA2(46437 MB)Volume2-01 Disk2-01 VolumeOffset: 0x00000000 Offset: 0x00000000 Length: 0x033A186B Disk2-02 VolumeOffset: 0x033A186B Offset: 0x033A18AA Length:
0x02711637Disk2-01 contains
0x033a186Bsectors == 5413987 in decimal an you can see the number is odd and hence the Linux md driver cannot work as it uses 1024 bytes minimum so it can never work. )-:
Quoted 5 lines
Disk2-02 starts at the offset Disk2-01 stops and hence the Linux md driver again cannot work.
Sorry but with current Linux md driver and tools it is not possible to make your linear arrays work.
I should add an AFAIK here. I am by no means familiar (enough) with EVMS, LVM1/2, and the kernel Device Mapper itself, to be able to tell if there isn't some clever way of making it work with existing drivers and tools...
Best regards,
Anton
Signature · 4 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
Quoted 3 lines
I should add an AFAIK here. I am by no means familiar (enough) with EVMS, LVM1/2, and the kernel Device Mapper itself, to be able to tell if there isn't some clever way of making it work with existing drivers and tools...
Good news, when I did the following:
# dmsetup create test 0 54138987 linear /dev/sda1 0 54138987 40965687 linear /dev/sda3 0
# mount /dev/mapper/test /mnt/d # ls /mnt/d
... it worked!
(the same with sda4 + sda2 volume, i've taken numbers from ldminfo output)
Maybe it's worth to update Documentation/filesystems/ntfs.txt :)
Signature · 1 line
mg
Quoted 10 lines · On Sat, 2 Oct 2004, Marcin [iso-8859-2] Gibu³a wrote:
Quoted 3 lines
I should add an AFAIK here. I am by no means familiar (enough) with EVMS, LVM1/2, and the kernel Device Mapper itself, to be able to tell if there isn't some clever way of making it work with existing drivers and tools...
Good news, when I did the following:
# dmsetup create test 0 54138987 linear /dev/sda1 0 54138987 40965687 linear /dev/sda3 0
Quoted 7 lines
# mount /dev/mapper/test /mnt/d # ls /mnt/d... it worked!
(the same with sda4 + sda2 volume, i've taken numbers from ldminfo output)Maybe it's worth to update
Documentation/filesystems/ntfs.txt:)
Great stuff! Well done. Thanks for letting me know. It is definitely time for an update of Documentation/filesystems/ntfs.txt. (-:
Best regards,
Anton
Signature · 4 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/