chenall / grub4dos

外部命令和工具源码:https://github.com/chenall/grubutils 下载:
http://grub4dos.chenall.net
GNU General Public License v2.0
649 stars 136 forks source link

Cannot write to small NTFS files on large partitions #218

Open steve6375 opened 4 years ago

steve6375 commented 4 years ago

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.

yaya2007 commented 4 years ago

no problem. You download it again and try again.

In addition, virtual machines can't really write.

steve6375 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

image image

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

image image image image image

yaya2007 commented 4 years ago

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.

steve6375 commented 4 years ago

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 commented 4 years ago

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.

tpunix commented 4 years ago

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