# [NOT YET SOLVED]: Acessing the Mac OSX from Gentoo

## ONEEYEMAN

Hi,

I need to mount Mac partition on my Gentoo laptop to perform some operations.

Googling found this, but I don't know if its up to date.

Is there any relatively recent guide to how to mount OSX partition in Gentoo?

Kernel options, additional packages, troubleshooting, etc? Or the one I referenced is good?

Thank you.Last edited by ONEEYEMAN on Thu May 24, 2018 3:31 pm; edited 2 times in total

----------

## Jaglover

I've tried this once. The filesystem module loaded, I still could not access the files. It wasn't important for me and I didn't try hard, but something made me think the filesystem was encrypted. Maybe macOS encrypts without even asking the user. Just my 2¢.

----------

## fedeliallalinea

But what file system hfs or apfs?

For hfs there is support in kernel

```
# grep HFS /usr/src/linux/.config

CONFIG_HFS_FS=m

CONFIG_HFSPLUS_FS=m

CONFIG_HFSPLUS_FS_POSIX_ACL=y
```

For apfs not idea never tried but I find a project for fuse

----------

## ONEEYEMAN

Hi,

 *fedeliallalinea wrote:*   

> 
> 
> But what file system hfs or apfs?
> 
> For hfs there is support in kernel
> ...

 

Do I have to install anything for it to work?

----------

## ONEEYEMAN

I also tried this:

```

igor@IgorReinCloud ~/dbhandler $ ssh igorkorot@192.168.1.3:/dbhandler/dbhandler < git pull

bash: git: No such file or directory

igor@IgorReinCloud ~/dbhandler $ git pull

remote: Counting objects: 4, done.

remote: Compressing objects: 100% (1/1), done.

remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0

Unpacking objects: 100% (4/4), done.

From https://github.com/oneeyeman1/dbhandler

   667ca95..4a93607  master     -> origin/master

Updating 667ca95..4a93607

Fast-forward

 libdbwindow/databasecanvas.cpp | 1 +

 1 file changed, 1 insertion(+)

```

which should execute the git command from the Gentoo machine remotely on the Mac, but that attempt failed.

Maybe there is a better way?

Thank you.

----------

## krinn

 *ONEEYEMAN wrote:*   

> Maybe there is a better way.

 

Never put my hands on OSX, but i'm pretty it have nfsd no?

----------

## fedeliallalinea

 *ONEEYEMAN wrote:*   

> Do I have to install anything for it to work?

 

Maybe sys-fs/hfsutils, but I have to check on my system at work

----------

## khayyam

 *ONEEYEMAN wrote:*   

> 
> 
> ```
> igor@IgorReinCloud ~/dbhandler $ ssh igorkorot@192.168.1.3:/dbhandler/dbhandler < git pull
> 
> ...

 

ONEEYEMAN ... you're redirecting stdin from a (non-existant) file ("git") on localhost, so the command to be exectuted on 192.168.1.3 is taken as input. You're also providing path for some unknown reason, in short your syntax is wrong ...

```
% ssh igorkorot@192.168.1.3 "cd /dbhandler/dbhandler ; git pull"
```

That said, this is altogether different from "mount[ing] mac partition" as "partition" is not "filesystem", the former is a section of disk, and the later is the path on which the disk is mounted (in comon parlance the "mount point"). So, if you access the machine remotely then any "mounting" (and so the ability to read/write to that filesystem) is provided by macOS.

So, what is it you need to do, mount the (HFS, HFS+, APFS) filesystem from linux, or access that filesystem from a remote host?

HTH & best ... khay

----------

## fedeliallalinea

Other thing I think you can not write on hfs+ if the journaling is active

----------

## khayyam

 *fedeliallalinea wrote:*   

> Other thing I think you can not write on hfs+ if the journaling is active

 

fedeliallalinea ... yes, but you can disable the journal via "Disk Utility" (gui) or "diskutil" (cli) ... still, this wouldn't matter at all if ONEEYEMAN is accessing the filesystem remotely, which at the moment isn't clear.

best ... khay

----------

## ONEEYEMAN

Hi,

 *khayyam wrote:*   

> 
> 
>  *ONEEYEMAN wrote:*   
> 
> ```
> ...

 

The command above will connect to the machine, switch to the directory and will execute "git pull" from the remote machine.

The trouble is I am running OSX 10.8 which have an outdated version of Git/OpenSSL. And so when I try to run git from Mac it fails with the authentication issue, since GitHub switched from 1.0 to 1.2 certs.

So, since I can successfully run "git" on Gentoo, I thought to do this:

1. Connect (or mount to) OSX machine (192.168.1.3).

2. Switch directory on the remote to ~/dbhandler/dbhandler.

3. Execute "git pull" from the Gentoo machine to update remote repository that is located on Mac.

This is my end goal - perform step #3.

Thank you.

----------

## khayyam

 *ONEEYEMAN wrote:*   

> So, since I can successfully run "git" on Gentoo, I thought to do this:
> 
> 1. Connect (or mount to) OSX machine (192.168.1.3).
> 
> 2. Switch directory on the remote to ~/dbhandler/dbhandler.
> ...

 

ONEEYEMAN ... as macOS provides ssh it should be as simple as enabling CONFIG_FUSE_FS and using net-fs/sshfs to "sshfs mount" the remote filesystem to the gentoo machines filesystem ... and then do whatever operations are required ('git pull', etc).

```
% mkdir dbhandler-local

% sshfs igorkorot@192.168.1.3:/dbhandler/dbhandler dbhandler-local

% cd dbhandler-local

% git pull

% fusermount -u dbhandler-local
```

HTH & best ... khay

----------

## Zucca

Be careful with HFS. If you move files out of HFS to a linux partition you'll lose the resource forks of the files. This includes HFS+ too and maybe even APFS.

I did backups from my old Macintosh to my linux machine back in the days... It didn't turn out well when I needed to accees the files later...

----------

## Hu

Wouldn't it be easier to update Git/OpenSSL on the Mac so that it works directly with modern servers?  There are probably other advantages to this, likely including security fixes.

----------

## ONEEYEMAN

Hi

 *khayyam wrote:*   

> 
> 
>  *ONEEYEMAN wrote:*   
> 
> So, since I can successfully run "git" on Gentoo, I thought to do this:
> ...

 

Almost there:

```

IgorReinCloud mac # git pull

remote: Counting objects: 4, done.

remote: Compressing objects: 100% (1/1), done.

remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0

Unpacking objects: 100% (4/4), done.

From https://github.com/oneeyeman1/dbhandler

   45bef9b..082bbf4  master     -> origin/master

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"

  git config --global user.name "Your Name"

to set your account's default identity.

Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@IgorReinCloud.(none)')

```

I didn't have to do that when I was able to run git from my Mac directly.

And when I am updating my repo on Gentoo I am providing the id/password pair.

Why it didn't ask me for credentials? And what should I do to fix that error?

P.S.: I tried to run those command on my Mac machine locally, but it didn't help.

Thank you.

----------

## khayyam

 *Hu wrote:*   

> Wouldn't it be easier to update Git/OpenSSL on the Mac so that it works directly with modern servers?  There are probably other advantages to this, likely including security fixes.

 

Hu ... there are package managers for macOS (like homebrew) that would allow you to do this, but I'd have to question the reason for using macOS at all when there is a linux machine on hand :)

 *ONEEYEMAN wrote:*   

> 
> 
> ```
> fatal: unable to auto-detect email address (got 'root@IgorReinCloud.(none)')
> ```
> ...

 

ONEEYEMAN ... what is the FQDN of IgorReinCloud? Please provide the output of 'hostname --fqdn' and 'grep "^127" /etc/hosts'.

best ... khay

----------

## ONEEYEMAN

 *khayyam wrote:*   

> 
> 
>  *Hu wrote:*   
> 
> Wouldn't it be easier to update Git/OpenSSL on the Mac so that it works directly with modern servers?  There are probably other advantages to this, likely including security fixes.
> ...

 

Well, I have OSX 10.8 and it looks like Apple won't supply latest version of OpenSSL for this version.

I can do it manually, but it is more pain to operate with 2 versions of the same software.

 *khayyam wrote:*   

> 
> 
>  *ONEEYEMAN wrote:*   
> 
> ```
> ...

 

Here is the output:

```

IgorReinCloud mac # hostname -fqdn

hostname: invalid option -- 'q'

Usage: hostname [-v] {hostname|-F file}      set hostname (from file)

       domainname [-v] {nisdomain|-F file}   set NIS domainname (from file)

       hostname [-v] [-d|-f|-s|-a|-i|-y|-n]  display formatted name

       hostname [-v]                         display hostname

       hostname -V|--version|-h|--help       print info and exit

    dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y

    -s, --short           short host name

    -a, --alias           alias names

    -i, --ip-address      addresses for the hostname

    -f, --fqdn, --long    long host name (FQDN)

    -d, --domain          DNS domain name

    -y, --yp, --nis       NIS/YP domainname

    -F, --file            read hostname or NIS domainname from given file

   This command can read or set the hostname or the NIS domainname. You can

   also read the DNS domain or the FQDN (fully qualified domain name).

   Unless you are using bind or NIS for host lookups you can change the

   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is

   part of the FQDN) in the /etc/hosts file.

```

It looks like those options are exclusive.

```

IgorReinCloud mac # grep "127" /etc/hosts

127.0.0.1   IgorReinCloud   IgorReinCloud   localhost

```

Thank you.

----------

## khayyam

 *ONEEYEMAN wrote:*   

> 
> 
> ```
> IgorReinCloud mac # hostname -fqdn
> 
> ...

 

ONEEYEMAN ... '--fqdn', not '-fqdn' ... 

 *ONEEYEMAN wrote:*   

> 
> 
> ```
> IgorReinCloud mac # grep "127" /etc/hosts
> 
> ...

 

OK, so your canonical name is not a FQDN ...

```
127.0.0.1   IgorReinCloud.local   IgorReinCloud   localhost
```

EDIT ... wait a minute, why does the above prompt say "IgorReinCloud mac"? This should be the machine from which the sshfs is run, not the "mac".

HTH & best ... khay

----------

## ONEEYEMAN

Hi,

 *khayyam wrote:*   

> 
> 
>  *ONEEYEMAN wrote:*   
> 
> ```
> ...

 

```

IgorReinCloud mac # hostname --fqdn

IgorReinCloud

```

 *khayyam wrote:*   

> 
> 
>  *ONEEYEMAN wrote:*   
> 
> ```
> ...

 

Because the mountpoint is "/mnt/mac".

Or you are asking wjy it is displaying "IgorReinCloud"? I thought it is how sshfs works...

Thank you.

----------

## khayyam

 *ONEEYEMAN wrote:*   

> Because the mountpoint is "/mnt/mac".

 

ONEEYEMAN ... due to your PS1 its path is trunctated, and without any seperator it's not clear what part of the prompt is what ...

```
[root@aporia: ~]# mkdir /mnt/mac ; cd /mnt/mac

[root@aporia: /mnt/mac]# 
```

 *ONEEYEMAN wrote:*   

> Or you are asking wjy it is displaying "IgorReinCloud"? I thought it is how sshfs works...

 

No, I was asking why I saw 'IgorReinCloud mac', I was thinking it may have been the macOS machine as macOS isn't strict about spaces, and I couldn't see why 'mac' would be there ... anyhow, did you adjust /etc/hosts to what I provided above? ... the following suggest you haven't:

 *ONEEYEMAN wrote:*   

> 
> 
> ```
> IgorReinCloud mac # hostname --fqdn
> 
> ...

 

That should be a FQDN ("fully qualified domain name") and it isn't.

best ... khay

----------

## ONEEYEMAN

khay,

I modified /etc/hosts and "git pull" finished successfully.

Thank you.

----------

## khayyam

ONEEYEMAN ...

you're welcome ... please mark the thread '[SOLVED]'.

best ... khay

----------

## ONEEYEMAN

 *khayyam wrote:*   

> 
> 
>  *ONEEYEMAN wrote:*   
> 
> ```
> ...

 

OK, so I modified the /etc/hosts file by changing "IgorReinCloud" to "IgorReinCloud.local" and everything was good, until I needed a reboot.

After the reboot I lost an internet connection - ping was not working anymore.

Removing ".local" restored it, but unfortunately this is not the solution I'm looking for.

What am I missing? Why the network access was lost after that change?

Thank you.

----------

## khayyam

 *ONEEYEMAN wrote:*   

> OK, so I modified the /etc/hosts file by changing "IgorReinCloud" to "IgorReinCloud.local" and everything was good, until I needed a reboot. After the reboot I lost an internet connection - ping was not working anymore.

 

ONEEYEMAN ... please provide output of the failed ping, etc, saying the network isn't working tells us nothing. Also, the output of the following (with the supposedly "not working" configuration).

```
# egrep '^127' /etc/hosts

# cat /etc/resolv.conf

# ip route

# ip addr show

# ping -c 1 1.1.1.1
```

best ... khay

----------

## ONEEYEMAN

Hi,

I tried to reproduce it again and failed.

Right now I booted inside the modified /etc/hosts and I do have a network access/Internet with the IP address.

I will try to monitor this and hopefully will hit it at some point.

Thank you and sorry for the noise.

Thank you.

----------

## khayyam

 *ONEEYEMAN wrote:*   

> I tried to reproduce it again and failed. Right now I booted inside the modified /etc/hosts and I do have a network access/Internet with the IP address. I will try to monitor this and hopefully will hit it at some point.

 

ONEEYEMAN ... it's very unlikely the issue had anything to do with the addition of a FQDN to /etc/hosts ... that is how it should be configured (see: gentoo wiki: the hosts file). Sure, keep an eye on it, but I expect it was a dhcp timeout, or (if wireless) ASSOC failing, or something of that nature. 

 *ONEEYEMAN wrote:*   

> Thank you and sorry for the noise.

 

You're welcome & no problem ... khay

----------

## ONEEYEMAN

Hi,

It is a laptop and I have a wireless connection on it.

So yes - it probably was an association failure. But if it was - that was surprising considering it was first time on this laptop.

But like I said - I will keep an eye for that in case it will happen again.

Thank you.

----------

