Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount switch partition when switch is mounted with memloader #60

Open
Patrick5897 opened this issue May 8, 2020 · 27 comments
Open

Mount switch partition when switch is mounted with memloader #60

Patrick5897 opened this issue May 8, 2020 · 27 comments

Comments

@Patrick5897
Copy link

I am trying to mount the USER partition of my switch. Therefore, I have mounted the switch with memloader as disk2. Now I want to access the user partition with ninfs but I can't find any information about it in the web. Is it possible at all? I am a Mac user and since TegraRCMGui doesn't work in a VM, I need an alternative.

@ihaveamac
Copy link
Owner

On Mac you can run mount_nandhac from Terminal with sudo. I suggest installing from the 2.0 branch, and not master or the latest release for now. For example:

sudo mount_nandhac /dev/disk2 ./switchnand -o allow_other

The allow_other is so your non-root user can access the mountpoint switchnand.

After this you can see USER.img inside which can be mounted by double-clicking or with hdiutil.

If you want to prevent writing, use -r for mount_nandhac.

@Patrick5897
Copy link
Author

Patrick5897 commented May 8, 2020

On Mac you can run mount_nandhac from Terminal with sudo. I suggest installing from the 2.0 branch, and not master or the latest release for now. For example:

sudo mount_nandhac /dev/disk2 ./switchnand -o allow_other

The allow_other is so your non-root user can access the mountpoint switchnand.

After this you can see USER.img inside which can be mounted by double-clicking or with hdiutil.

If you want to prevent writing, use -r for mount_nandhac.
Do I need python for this? I have downloaded the latest release of the app.

@ihaveamac
Copy link
Owner

Latest release should work fine unless the device is read-only, since it currently always tries to open in read-write mode, even if you don't enable writing. If this turns out to be a problem then you will need to install Python and the latest commit of the 2.0 branch.

@Patrick5897
Copy link
Author

sudo mount_nandhac Password: sudo: unable to execute /Library/Frameworks/Python.framework/Versions/3.8/bin/mount_nandhac: No such file or directory
That's the message I get.

@Patrick5897
Copy link
Author

Latest release should work fine unless the device is read-only, since it currently always tries to open in read-write mode, even if you don't enable writing. If this turns out to be a problem then you will need to install Python and the latest commit of the 2.0 branch.

After the installation of python I get the following error:
`sudo mount_nandhac /dev/disk2 ./switchnand -o allow_other
ninfs v1.7b2 - https://github.com/ihaveamac/ninfs

  • Note: This should not be run as root.
  • The mount will not be normally accessible by other users.
  • This should be run from a non-root terminal.
  • If you want root to be able to access the mount,
  • you can add -o allow_root to the arguments.
    [HAC] Found and using openssl lib.
    Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.8/bin/mount_nandhac", line 11, in
    load_entry_point('ninfs==1.7b2', 'console_scripts', 'mount_nandhac')()
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ninfs/main.py", line 124, in main
    exit(mount(basename(argv[0])[6:].lower()))
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ninfs/main.py", line 80, in mount
    return module.main(prog=prog)
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ninfs/mount/nandhac.py", line 234, in main
    with open(a.keys, 'r', encoding='utf-8') as k:
    FileNotFoundError: [Errno 2] No such file or directory: '/Users/patrick/.switch/prod.keys'
    `

@ihaveamac
Copy link
Owner

Use --keys with your keys text file (Lockpick_RCM and biskeydump formats work). Or put it at ~/.switch/prod.keys.

@Patrick5897
Copy link
Author

Use --keys with your keys text file (Lockpick_RCM and biskeydump formats work). Or put it at ~/.switch/prod.keys.

Is it also possible to mount it with GUI from the app?

@ihaveamac
Copy link
Owner

Yes it lets you choose where the BIS Keys are.
image

@Patrick5897
Copy link
Author

Yes it lets you choose where the BIS Keys are.
image

I have mounted it in the Terminal but it won't let me unmount it.

Patricks-MacBook-Pro:~ patrick$ unmount /dev/disk2 -bash: unmount: command not found Patricks-MacBook-Pro:~ patrick$ diskutil unmount /dev/disk2 disk2 was already unmounted or it has a partitioning scheme so use "diskutil unmountDisk" instead Patricks-MacBook-Pro:~ patrick$ diskutil unmountDisk /dev/disk2 Unmount of disk2 failed: at least one volume could not be unmounted

@ihaveamac
Copy link
Owner

You're supposed to call diskutil unmount on the mountpoint, not the original file or device.

@Patrick5897
Copy link
Author

You're supposed to call diskutil unmount on the mountpoint, not the original file or device.

The mount point is switchnand or .switch?

@ihaveamac
Copy link
Owner

In this case it would be switchnand. You see the files like USER.img there, right?

@Patrick5897
Copy link
Author

Patrick5897 commented May 8, 2020

In this case it would be switchnand. You see the files like USER.img there, right?

Yes, there is the User.img. Still get this message:

Patricks-MacBook-Pro:~ patrick$ diskutil unmount ~/.switch/switchnand/ disk2 was already unmounted or it has a partitioning scheme so use "diskutil unmountDisk" instead Patricks-MacBook-Pro:~ patrick$ diskutil unmountDisk ~/.switch/switchnand/ Unmount of disk2 failed: at least one volume could not be unmounted Patricks-MacBook-Pro:~ patrick$

@ihaveamac
Copy link
Owner

Just right-click the disk in Finder and unmount there if you can't figure out how to do it from terminal.

@Patrick5897
Copy link
Author

Just right-click the disk in Finder and unmount there if you can't figure out how to do it from terminal.

My finder doesn't show it.

@ihaveamac
Copy link
Owner

What do you mean it doesn't show it? It's the disk that has the files like SYSTEM, USER, etc.

If you really can't find it then tell me what the output of this is: mount | grep switchnand

@Patrick5897
Copy link
Author

mount | grep switchnand

It's not in the sidebar of the Finder. The result of the command:

mount | grep switchnand /dev/disk2 on /Users/patrick/.switch/switchnand (osxfuse_HACFS, synchronous)

@ihaveamac
Copy link
Owner

It's not set up to be in the sidebar. Try this instead: open ~/.switch and right-click the disk there, since apparently the mountpoint is inside .switch

@Patrick5897
Copy link
Author

It's not set up to be in the sidebar. Try this instead: open ~/.switch and right-click the disk there, since apparently the mountpoint is inside .switch

There is the disk but when I right click and eject, nothing happens.

@ihaveamac
Copy link
Owner

Do a reboot to clean up I guess. I don't know why unmounting is failing right now.

@Patrick5897
Copy link
Author

Do a reboot to clean up I guess. I don't know why unmounting is failing right now.

Which "File" should I choose in the GUI in the "Mount Settings"?

@Patrick5897
Copy link
Author

Got it now. The only problem which remains is the unmounting. I try to unmount "switchnand" with:
Patricks-MacBook-Pro:~ patrick$ sudo diskutil unmountDisk ./switchnand Password: Unmount of all volumes on disk2 was successful
But it still appears in the finder:
Bildschirmfoto 2020-05-08 um 13 19 01

@mbirth
Copy link

mbirth commented Aug 17, 2020

Trying on OSX 10.15.6, I get the Switch to mount and I see the USER.img (0 Bytes). However, double-clicking it in Finder gives an "Image not recognised" error instead of mounting that.

mount_nandhac --keys keyfile.keys --partition USER -o allow_other /dev/disk2s11 ./fuse

ninfs is d1b8d30 (2.0 branch). Python is 3.8.5.

@ihaveamac
Copy link
Owner

Since you're using it on a full NAND you shouldn't be using --partition which is meant for mounting files that are a single partition themselves.

@mbirth
Copy link

mbirth commented Aug 18, 2020

But I'm using it on partition 11 (disk2s11) which is the USER partition. The same mount-commandline works fine in Ubuntu Linux.

Without --partition USER I should use /dev/disk2, shouldn't I?

@ihaveamac
Copy link
Owner

Oh I somehow missed that you were using disk2s11, sorry. Try disk2 without --partition

@mbirth
Copy link

mbirth commented Aug 22, 2020

Okay, that worked. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants