grub4dos icon indicating copy to clipboard operation
grub4dos copied to clipboard

Cannot write to small NTFS files on large partitions

Open steve6375 opened this issue 5 years ago • 10 comments

I thought this was fixed (issue #12)???

image

The test file must be freshly made so it only uses $MFT for data to see the error.

steve6375 avatar Nov 10 '19 14:11 steve6375

no problem. You download it again and try again.

In addition, virtual machines can't really write.

yaya2007 avatar Nov 17 '19 03:11 yaya2007

Where is new download? image I tested in VM and on real system. Same problem. Can you reproduce it?

Partition 1 SIZE=123087.514MiB Type: 07 NTFS\exFAT
START POS = CYL:0 HD:32 SEC:33 END POS = CYL:1023 HD:254 SEC:63 START (LBA) = 2,048 (00000800) SIZE (LBA) = 252,083,229 (0F067C1D) [End=252,085,276]

BPB TYPE=NTFS 000B Bytes Per Sector = 512 (0200h) 000D Sectors Per Cluster = 8 (08h) 0015 Media Descriptor = 248 (F8h) HDD 0020 Total Log. Sectors (big) = 0 (00000000h) 0028 Total Sectors on HDD = 000000000F067C1Ch 0030 Log. Cluster no. for $MFT file = 0000000000003C66h 0038 Log. Cluster no. for $MFTMirr file = 0000000000005589h 0040 Clusters per MFT Record = 246 (F6h) 0044 Clusters per Index Buffer = 117 (75h) 0048 Volume ID Serial No. = 1EB2B426B2B40475h

This is a large 512GB drive which has probably had partitions resized.

steve6375 avatar Nov 17 '19 08:11 steve6375

Works OK on larger files.

image

BPB TYPE=NTFS 000B Bytes Per Sector = 512 (0200h) 000D Sectors Per Cluster = 8 (08h) 0015 Media Descriptor = 248 (F8h) HDD 0020 Total Log. Sectors (big) = 0 (00000000h) 0028 Total Sectors on HDD = 000000000F067C1Ch 0030 Log. Cluster no. for $MFT file = 0000000000003C66h 0038 Log. Cluster no. for $MFTMirr file = 0000000000005589h 0040 Clusters per MFT Record = 246 (F6h) 0044 Clusters per Index Buffer = 117 (75h) 0048 Volume ID Serial No. = 1EB2B426B2B40475h

steve6375 avatar Nov 17 '19 08:11 steve6375

Works OK on smaller drive So problem to do with the NTFS partition size?

image

BPB TYPE=NTFS 000B Bytes Per Sector = 512 (0200h) 000D Sectors Per Cluster = 8 (08h) 0015 Media Descriptor = 248 (F8h) HDD 0020 Total Log. Sectors (big) = 0 (00000000h) 0028 Total Sectors on HDD = 000000000733B7C0h 0030 Log. Cluster no. for $MFT file = 00000000000C0000h 0038 Log. Cluster no. for $MFTMirr file = 0000000000000002h 0040 Clusters per MFT Record = 246 (F6h) 0044 Clusters per Index Buffer = 152 (98h) 0048 Volume ID Serial No. = C442273E42273498h

Partition 1 SIZE=58998.969MiB Type: 07 NTFS\exFAT ACTIVE START POS = CYL:0 HD:32 SEC:33 END POS = CYL:1023 HD:254 SEC:63 START (LBA) = 2,048 (00000800) SIZE (LBA) = 120,829,889 (0733B7C1) [End=120,831,936]

steve6375 avatar Nov 17 '19 08:11 steve6375

Here is blocklist results for different sizes of file on the large 512GB drive 58GB partition

If file is over 680 bytes then data is written to new cluster, not resident $MFT record.

image

steve6375 avatar Nov 17 '19 09:11 steve6375

image image

Note $mft in two parts!!! blocklist address for file 680.txt does not look correct ???

image image image image image

steve6375 avatar Nov 17 '19 09:11 steve6375

This is the original note: Limitations:

  1. Don't support >1K MFT record size, >4K INDEX record size
  2. Don't support encrypted file
  3. Don't support >4K non-resident attribute list and $BITMAP

Now "MFT record size"is up to 948K! Now "INDEX record size"is up to 608K! Some are still normal, Can't expect too much .

Of course, there are still some problems with grub4dos support for NTFS.

yaya2007 avatar Nov 17 '19 10:11 yaya2007

OK. I didn't see that limitation. Why is no error reported? Not even if debug 3 or debug msg=3 is used? It would be useful to tell user that write failed. image

steve6375 avatar Nov 17 '19 10:11 steve6375

For completeness, please could you outline the limitations for all supported filesystems? e.g. writes to exFAT, writes to ext2/3/4, etc? It would be useful to be aware of the limitations.

steve6375 avatar Nov 17 '19 10:11 steve6375

I have a simple ntfs code: https://github.com/tpunix/GRNB/blob/master/fs_ntfs.c

tpunix avatar Nov 19 '19 15:11 tpunix