Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print elapsed time and estimated time to completion #46

Open
AlexDaniel opened this issue Mar 17, 2019 · 6 comments
Open

Print elapsed time and estimated time to completion #46

AlexDaniel opened this issue Mar 17, 2019 · 6 comments

Comments

@AlexDaniel
Copy link

AlexDaniel commented Mar 17, 2019

When trying to recover large drives, it helps to know how much time you need to wait.

For example, photorec displays this:

Elapsed time 0h00m04s – Estimated time to completion 0h22m54

P.S. Thank you for this tool, looks promising! Although I'm still waiting for it to scan the whole drive…

Edit: It worked! I recovered the files when both testdisk and photorec didn't help at all. Amazing.

@Lazza
Copy link
Owner

Lazza commented Mar 17, 2019

This is actually a very useful suggestion, thank you.

@thinrope
Copy link

The dirty hack for a progress bar is using pv to attach to the running process :-D
Assuming 17201 is the PID (e.g. use ps aux|fgrep main.py to find it), we need to attach to fd/3:

$ pv -petrabd 17201:3
 325GiB 0:00:25 [ 298MiB/s] [ 306MiB/s] [====>                              ]  5% ETA 4:53:12 

Of course that is just the first pass...
May be you can close fd/3 and open fd/4 for next pass and so on. Actually, since pv can monitor several at the same time, opening both fd/3 and fd/4 to the file and using fd/3 for first pass, fd/4 for 2nd and so on (if you read the whole disk once again).

@Lazza
Copy link
Owner

Lazza commented Feb 20, 2021

@thinrope thank you for your suggestion. The plan for the future is to implement a progress bar with tqdm or a similar library.

@ilos-vigil
Copy link

For dirty hack mentioned above, if you use sudo to run the script, make sure you choose PID without sudo prefix

root       63157  0.0  0.0  10844  5344 pts/3    S+   14:30   0:00 sudo pypy3 main.py
root       63158 48.5  0.5 108388 96276 pts/3    D+   14:30   0:04 pypy3 main.py
pv -petrabd 63158:3

Otherwise, you'll see this message

pv: pid 63157: fd 3: pipe:[779070]: not a regular file or block device

@crotron
Copy link

crotron commented May 21, 2021

Although it doesn't produce a progress bar, I found that adding tqdm to feed_all's main loop is still quite helpful. If the code cannot find anything for a while, it at least gives some feedback to the user that the program isn't frozen (side note: I'm currently running it on a clone of a bad drive and I hope that this isn't a bad sign...). Also, it gives you an estimate of the number of iterations/second, which can still be useful if you know how many sectors are on the hard drive.

@Lazza
Copy link
Owner

Lazza commented May 25, 2021

I can confirm. I am experimenting with tqdm but unfortunately I don't have a lot of free time in this period.

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

No branches or pull requests

5 participants