Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5157

Raspberry Pi OS • Full Partition grep Causes a Complete Freeze

$
0
0
Hi all


I am on RPi4 4GB,
and RPi OS Lite 32bit Bookwork.


Imagine that you're looking for all script files that contain the string "uname -a".

So you "cd /" to get to the root folder,
then run:

Code:

grep -F -r -s "uname -a"
I did not specify a File/Folder here,
but grep will not use the Standard Input, because of the -r switch.

(so the problem here is not the noob style "freeze" that people see when running grep without a file name,
which causes grep to wait for data from the Standard Input, and which can easily be overcome via pressing Ctrl-C)


So now it will work, and give some results,
but after a few seconds the RPi will completely hang.

It's not that grep is going thru a long search and you think that the computer hanged.
It's a true hang, where you cannot do Ctrl-C,
you cannot connect with a second terminal session,
you cannot do anything except disconnect the power cable,
and hope that your file system is not corrupt after that power disconnection that you had to perform..


Why is it happening?
Might it be because grep touches some file handle that is actually a device or something like that,
that when touched it causes the computer to hang?


If yes, how can we avoid this, so we can do a full partition search successfully?


Thank you

Statistics: Posted by spaceman5 — Fri Sep 06, 2024 5:28 am



Viewing all articles
Browse latest Browse all 5157

Trending Articles