Sudo command not found

Joined
Jan 31, 2016
Messages
5
Reaction score
0
Points
1
Hi,
I have problem with hard drive, which is not possible to fix. I learnt on internet that I need a special software to repair and I download free program TestDisk, I followed quide that I need to type sudo command and this program will start automatically (I have in on USB), but my problem is that when I typed sudo in terminal the answer was command not found. I typed /bin/echo $PATH and then I got this response
/usr/bin:/bin:/usr/sbin:/sbin

please can you help me what to do? I need to run program TEST DISK and I dont know how..... Thanks!
 

IWT


Joined
Jan 23, 2009
Messages
10,707
Reaction score
2,607
Points
113
Location
Born Scotland. Worked all over UK. Live in Wales
Your Mac's Specs
M2 Max Studio Extra, 32GB memory, 4TB, Sequoia 15.4.1 Apple 5K Retina Studio Monitor
nosalova

Welcome to the Forums.

Maybe; and I'm saying this for you not against you; just maybe your Heading "sudo command not found" might be telling you not to mess with Terminal? Add to that, you "learnt on the internet" tends to support the notion that Terminal is new to you.

May I respectfully suggest that you tell us exactly what problems you are having with your HDD and let us try more conventional methods to assist you.

It would be great if you could tell us which Mac you have (model and year); which OS you are running and any other info you have relating to your Mac and the HDD difficulties.

No offence. We're here to help.

Ian
 
Joined
Jul 24, 2013
Messages
5,140
Reaction score
907
Points
113
Location
Ohio (USA)
Your Mac's Specs
2023-14" M3max MBPro, 64GB/1TB, iPhone 16 Pro Max, Watch Ultra & S10
I would be very careful of using sudo commands. I will tell you the problem you are having is most likely because you are not logged in on an administrator account so you do not have root access.

As for TestDisk, I have no idea how to use the program as I have never used it. Most on here recommend Disk Warrior but it is not cheap.

Lisa
 
OP
N
Joined
Jan 31, 2016
Messages
5
Reaction score
0
Points
1
Hi thank you for response,
yes I am beginner with Macs..:-} I know terminal is a big mystery for me :-}

I have MacBook Air 2009 with El Captain installed. The Wifi on this Mac was not working. (only through USB key)
This Mac was sold but that person returned it to me and mess it up. From that time I can not boot, I can not boot in safe mode either. I can not reinstall it.
When I run hardware test from CD, I couldnt finish the test.

When I boot Mac in single user mode there was this message
Bash-3.2.# ***** [IOBluetoothHCIController][SearchForTransportEventTimeOutHandler] –Missing Bluetooth Controller Transport!



When I run disk utility - verify disk
There are some sentence in red color
Missing thread record (id=55502)
Invalid volume directory count
It should be 12748 instead of 12747
Volume header needs minor repair
The volume OS X Base System was found corrupt and needs to be repaired
File system check exit code is 8
Error: The disk needs to be repaired usi….es window appears, choose Disk Utility


When I enter Recovery mode (Command R} When I run first aid in disk utility – it is this message First Aid process has failed. If possible back up the date on this volume. Click done to continue

When I tried to erase disk, message erase process has failed.


Thanks so much for your help!
 
OP
N
Joined
Jan 31, 2016
Messages
5
Reaction score
0
Points
1
Thanks Lisa, for response, problem is I can not log in to the computer, I can not boot the system. Yes I know about Disk Warrior, TestDisk should be good free alternative, I read on internet good references.....
 
C

chas_m

Guest
If this machine was sold and then returned to you not working properly, why not just reformat it?

Boot using command-r and use Internet Recovery to erase the disk and reinstall a new system, or at least reinstall the system. That should fix the problem.
 
OP
N
Joined
Jan 31, 2016
Messages
5
Reaction score
0
Points
1
it is not possible to erase the disk, you got message erase failed. Also you can not connect on internet because wifi is not working.
 

IWT


Joined
Jan 23, 2009
Messages
10,707
Reaction score
2,607
Points
113
Location
Born Scotland. Worked all over UK. Live in Wales
Your Mac's Specs
M2 Max Studio Extra, 32GB memory, 4TB, Sequoia 15.4.1 Apple 5K Retina Studio Monitor
Chas_m,

Do you not get the impression this HDD is dead or in a terminal coma?

When you read sentences like:
Error: The disk needs to be repaired usi….es window appears, choose Disk Utility

When I run first aid in disk utility – it is this message First Aid process has failed. If possible back up the date on this volume

When I tried to erase disk, message erase process has failed.

It's a six-to-seven year old Mac.

My main point was to keep the OP away from Terminal. From his/her original post, it looks like there has been some dabbling there already. The OP has also been using TestDisk. Never heard of it, but my research suggests that it is powerful stuff said to be designed to recover data & partitions from dead/dying disks.

Ian
 

vansmith


Retired Staff
Joined
Oct 19, 2008
Messages
19,966
Reaction score
606
Points
113
Location
Queensland
Your Mac's Specs
Too many devices to list
nosalova, assuming that you're okay with dealing with any consequences that might come about using the command line, try entering the full path to sudo:
Code:
/usr/bin/sudo
 
OP
N
Joined
Jan 31, 2016
Messages
5
Reaction score
0
Points
1
I tried and there is the response usr/bin/sudo: Not such file or directory, it looks to me that I need to replace SSD, there is the only solution......
 
Joined
Nov 28, 2007
Messages
25,564
Reaction score
486
Points
83
Location
Blue Mountains NSW Australia
Your Mac's Specs
Silver M1 iMac 512/16/8/8 macOS 11.6
Time to bury that hard drive. Poor thing is long past dead!

You will have to weigh up if a seven years old computer is worth the cost of a new hard drive, or simply advertise it on auction sites as parts only.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top