AlexSSD7 / linsk

📂 Access Linux-native file systems (including LVM and LUKS) on Windows and macOS with help of a lightweight Alpine Linux VM. x86/ARM supported.
GNU General Public License v3.0
297 stars 13 forks source link

Issue with git clone on macOS - Could not write config file Resource busy #28

Open bachirelkhoury opened 3 weeks ago

bachirelkhoury commented 3 weeks ago

I'm on Apple M2 macOS Sonoma, after successfully mounting an encrypted LUKS drive, I am able to copy things to and from it with no issues.

However, I am having issues while cloning a git repo onto the drive on macOS. I can clone ok using Linux. Issue only seems to occur on mac.

❯ cd /Volumes/luks-drive
❯ git clone https://github.com/AlexSSD7/linsk.git
Cloning into 'links'...
error: could not write config file /Volumes/luks-drive/linsk/.git/config: Resource busy
fatal: could not set 'core.filemode' to 'true'

This is what the directory looks like after the failed clone:

❯ tree -fpa linsk
[drwxrwxr-x]  linsk
└── [drwxrwxr-x]  linsk/.git
    └── [-rw-rw-r--]  linsk/.git/config

And this is the content of the git config file:

 ❯ cat linsk/.git/config 
[core]
    repositoryformatversion = 0

Update

I did another test, on macOS, created a new directory and try to git init..

❯ cd /Volumes/luks-drive
❯ mkdir foo
❯ cd foo/
❯  git init .
error: could not write config file /Volumes/linsk/foo/.git/config: Resource busy
fatal: could not set 'core.repositoryformatversion' to '0'
bachirelkhoury commented 3 weeks ago

There is a similar got issue here that seems to be related to extended attributes that the mac is setting.

I tried to delete the directory to try and reclone, and then I got this:

❯ rm -rf linsk 
rm: linsk/.git/config: Resource busy
rm: linsk/.git: Directory not empty
rm: linsk: Directory not empty

No git processes running and I checked nothing is using that file nor repository. So perhaps it's the VM?

AlexSSD7 commented 3 weeks ago

That's weird. It doesn't appear to be a Linsk issue, rather something with git. To confirm for sure, you can try removing the directory after shutting down Linsk. If it still doesn't work, then it's something else.