Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Terminal: chroot-command results in "no such file or directory", but the HD is there when using "cd"

Hello,

I am unable to start up from my harddisk with Yosemite and I am 98% sure that it's because I'm affected by the Chrome VAR bug. I try to apply the VAR bug fix, but I am stopped by this strange problem:

I start up from a different HD with Mojave installed. In terminal I can change directory to "Macintosh HD" (the Yosemite-disk) using the cd command. But when I us the chroot command I get the reply "no such file or directory".


This is copied from Terminal:

Prasads-Mini:Macintosh HD prasad-mojave$ chroot/Volumes/Macintosh\ HD 
-bash: chroot/Volumes/Macintosh HD: No such file or directory



As you can see the HD is recognised in line 1, but apparently not in when using chroot.

When doing the same in Recovery mode I get the same result.


Two more things:

  1. When my Mac started acting strange - before rebooting - I ran disk utility and also CleanMyMac. Could it be that CMM has deleted something that has caused this problem? I have run it several times before with no issues, but perhaps a combination of VAR and CMM-cleanup is unfortunate?
  2. I know very little about Unix and terminal commands.

iMac Line (2012 and Later)

Posted on Sep 26, 2019 4:36 AM

Reply
Question marked as Best reply

Posted on Sep 26, 2019 5:39 AM

Not knowing what fix you are looking at, or more than the headlines about the Chrome /var deleting, cannot tell you if what you are doing is correct.


BUT, I can tell you the syntax error in the command you are showing.


You need a space between 'chroot' and /Volumes/Macintosh\ HD

chroot     /Volumes/Macintosh\ HD


Similar questions

11 replies
Question marked as Best reply

Sep 26, 2019 5:39 AM in response to prasado

Not knowing what fix you are looking at, or more than the headlines about the Chrome /var deleting, cannot tell you if what you are doing is correct.


BUT, I can tell you the syntax error in the command you are showing.


You need a space between 'chroot' and /Volumes/Macintosh\ HD

chroot     /Volumes/Macintosh\ HD


Sep 26, 2019 6:17 AM in response to BobHarris

Oh yes you're right about that syntax error, sorry! But unfortunately it doesn't solve my problem.

I don't get to actually applying the fix, because of the "Operation not permitted" error. Does that error make any sense to you?


Here is the fix in its totality:


chroot /Volumes/Macintosh\ HD  # "Macintosh HD" is the default

rm -rf /Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle

mv var var_back # var may not exist, but this is fine

ln -sh private/var var

chflags -h restricted /var

chflags -h hidden /var

xattr -sw com.apple.rootless "" /var

Sep 26, 2019 6:27 AM in response to prasado

I start up from a different HD with Mojave installed.

You are not 'root'. Did the original instructions have you starting from Recovery mode? You would have been 'root' in that situation.


Add the following command BEFORE you do the procedure:

sudo -s

The password asked for will be your user password, and I assume your user is an admin for that boot disk.


Also the "Macintosh HD" assumes you have not renamed your boot disk. "Macinntosh HD" is the default name macOS gives to a new system's boot disk, but it can be renamed, so if you did rename it you will need to use the actual name. You can verify the name using:

/bin/ls /Volumes



Terminal: chroot-command results in "no such file or directory", but the HD is there when using "cd"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.