XPlotter error, need administrator privilege (doesnt occur with wplotgenerator) #3

Closed
Pascal66 opened this Issue Jan 4, 2017 · 7 comments

Comments

Projects
None yet
2 participants

Pascal66 commented Jan 4, 2017

XPlotter v1.0 for BURST
programmers: Blago, Cerr Janror, DCCT

Checking directory...
Drive x:\ info:
Name: Disque 1
File system: NTFS
Serial Number: 3916110242
FILE_SUPPORTS_SPARSE_FILES: no
Bytes per Sector: 512
Sectors per Cluster: 2
The token does not have the specified privilege.
For faster writing you should restart plotter with Administrative rights.
Error creating stream for file x:\burst\plots\12247834136664705924_2400000001_100096_100096

x:\Burst>

Blagodarenko commented Jan 4, 2017 edited

can you get more info about your drive and OS?
(version of ntfs)
X: drive is local drive?

Pascal66 commented Jan 5, 2017 edited

os: w10
drive ntfs on localnetwork
BUT -> Mapped drives are not visible on elevated privilege (Admin)
That's why

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365544(v=vs.85).aspx
MSDN:
"Note: The file cannot be a network file, or be compressed, sparse, or transacted."

also https://msdn.microsoft.com/en-us/library/windows/desktop/aa364404(v=vs.85).aspx
"If a file being copied has a data stream and the network redirector is used, the file can only be copied if the client has both the read permission and the read attributes permission."

Pascal66 commented Jan 6, 2017

I agree, but that was working with wplotgenerator wich doesnt need elevated privilege, so why xplotter need it ?

wplotgenerator writing data to the file sequentially, and you get unoptimized (for reading) plot.

"When you use SetEndOfFile to increase the length of a file, the logical file length changes and the necessary disk space is allocated, but no data is actually physically written to the disk sectors corresponding to the new part of the file. The valid data length remains the same as it was.

This means you can use SetEndOfFile to make a file very large very quickly, and if you read from the new part of the file you'll just get zeros. The valid data length increases when you write actual data to the new part of the file.

That's fine if you just want to reserve space, and will then be writing data to the file sequentially. But if you make the file very large and immediately write data near the end of it, zeros need to be written to the new part of the file, which will take a long time. If you don't actually need the file to contain zeros, you can use SetFileValidData to skip this step; the new part of the file will then contain random data from previously deleted files."

Pascal66 commented Jan 9, 2017 edited

Agree another time. but it doesnt explain the need of elevated privileges.
Is it a way to avoid NAS users to plot quickly a network drive ? Nobody care, we can hotplug them.
We can made those accessible to admin, that's not the question, but if they are with user privilege, then it's a reason for that to avoid admin privilege.
And what if sequentially then optimized on the fly ? Both wplotgenerator and plototimzer do that
Btw, for now, Xplotter is very slow, so comined together can improve things

Pascal66 closed this Jan 9, 2017

My test for create 2Tb plot:
run w/o admin rights - 115671 seconds - 32 hrs 8 min (avg ~3958 nonces/min)
run with admin rights - 91026 seconds - 25 hrs 17 min (avg ~5029 nonces/min)

SetFileValidData() - unsecure function, that's why it need elevated privileges (example of using http://www.drdobbs.com/beware-of-file-slack-attacks/184405835)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment