20

I have a running Raspberry Pi image. Now I want to do the following:

  1. Access the files on my Mac when accessing the SD Card
  2. Be able to copy the SD Card to have a clone of the current system

In Disk Utility I see the partitions disk1s3 and disk1s6 but can't mount them from there:

enter image description here

1
  • If your Rpi is running and you can access it via ssh, then using any file transfer software (filezilla, ws ftp, cyberduck) makes it a lot easier. Just SSH to it and download the files. Nov 29, 2022 at 8:36

7 Answers 7

20

Found this article -> Mount a Raspberry Pi SD card on a Mac (read-only) with osxfuse and ext4fuse, It worked like a charm.

Here is the commands I ran om my mac:

brew cask install osxfuse
brew install ext4fuse
sudo mkdir /Volumes/rpi
sudo ext4fuse /dev/disk2s2 /Volumes/rpi -o allow_other
sudo cp /Volumes/rpi/home/pi/Pictures/* /Users/me/work/raspi/Pix/

I had some issue with permissions, but could copy with sudo.

cheers

4
  • If you run into issues and get could not copy extended attributes error while copying files, you can use rsync instead as mentioned here: sudo rsync -r /Volumes/rpi/path/to/src/dir path/to/dest/dir
    – OJ7
    Jul 28, 2019 at 17:57
  • Seamse it is brew install macfuse now and you have to disable the warning that FUSE is no longer open source by brew edit ex4fuse and comment out the on_macos do line with #disable... then you can continue with above.
    – novski
    Jan 15, 2022 at 15:45
  • On Catalina (maybe others): brew install ext4fuse gives me Error: ext4fuse has been disabled because it requires closed-source macFUSE! Jul 5, 2022 at 18:24
  • Solution here on SO: Installing ifuse with Homebrew results in ERROR message Jul 5, 2022 at 19:03
9

Read and write Linux SD card on MacBook M1 with USB-C.

  • Install UTM: brew install utm

  • Run ArchLinux ARM in UTM.

  • Plug SD card into USB-A adapter.

  • Plug USB-A adapter into USB-C adapter.

  • Plug USB-C adapter into your laptop.

  • Allow access to the USB device for UTM:

    • popups should appear automatically asking that or
    • use the button for that on UTM title bar's right side
  • Get the new device id: fdisk -l.

    • mine was: /dev/sda2 532480 249737215 249204736 118.8G 83 Linux
  • Mount the new device: mkdir /sdcard && mount /dev/sda2 /sdcard && ls /sdcard

  • Unmount when done and g2g: umount /sdcard

I'm very surprised myself but this works.

4
  • Spent like 3 hours trying other solutions between windows and mac and finally found this answer. Took like 5 minutes (including downloading and starting the arch image). You're awesome.
    – royka
    Jan 31, 2023 at 4:09
  • This is amazing, it was so quick and easy! You should convert this into a wiki or an article somewhere, so that it comes up quicker on search queries. Took me a while to find your solution, 5 minutes to implement it. Great! Apr 8, 2023 at 0:45
  • I think this is another option for M1/M2: github.com/gerard/ext4fuse/issues/66#issuecomment-819943409
    – Andy Smith
    Sep 17, 2023 at 19:33
  • Can confirm: this took minutes and worked beautifully. Feb 11 at 18:21
3

Download the "Apple Pi Baker App" and use this software to transfer an image to your SD card or backup an image to an image:

ApplePiBaker

3
  • I think the question was asking how to actually access the filesystem itself. Not the filesystem image. Nov 20, 2017 at 19:39
  • 1
    this did no answer the question. They already made a disk image, they want to mount it in osx. Aug 16, 2018 at 17:14
  • yet, some people might be trying to mount their Raspberry drive only to copy it later. and this tool, Apple PI Baker, is really great for that. Feb 17, 2021 at 4:30
3

AFAIK there's only one way to mount Extfs on a Mac and that's via Paragon Extfs for Mac

It's commercial software but they do have a 30-day trial. Works great for me.

2

As noted by Gotschi you can't mount an ext4 partition on the Mac, but you can backup the SD. The following is a script I use. This uses diskutil to find a disk with a Linux partition to automatically find the SD card. NOTE This takes quite a while to copy!

#!/bin/bash
# script to backup Pi SD card
#DSK='disk4'
export DSK=`diskutil list | grep "Linux" | cut -c 69-73`
if [ $DSK ]; then
    echo $DSK
else
    echo "Disk not found"
    exit
fi
diskutil unmountDisk /dev/$DSK
echo pleae wait!
sudo dd of=~/temp/Pi/Piback.img if=/dev/$DSK bs=2m
echo backup completed - now compressing
gzip -9 ~/temp/Pi/Piback.img
#rename to current date
mv ~/temp/Pi/Piback.img.gz "~/temp/Pi/Piback`date +%Y%m%d`.img.gz"
1
  • This method can then be used to open the SD image on a linux computer that doesn't have a functioning card reader
    – Kelly Bang
    Jan 27, 2020 at 23:18
0

Unfortunately, you can only mount the ext3 (disk1s3 & disk1s6) partitions with 3rd party programs (maybe some FUSE module)...

I tested mounting the SD card in a VM, but the SD card reader seems not to use a USB connection internally, instead it is directly connected to another BUS. (I only tried VMware Fusion, maybe parallells gives you better options)

you can either backup the whole SD card (results in a 16gb file):

sudo dd if=/dev/disk1 of=~/Desktop/SD.img bs=1m

or a certain partition:

sudo dd if=/dev/disk1sX of=~/Desktop/SD.img bs=1m

where X is your partition number if it gives you a Device busy error, be sure to "deactivate" all partitions on the SD card in the Disk Utility.

Edit

after backing up, you may save a LOT of space when you compress the .img

0
0

for e.g. editing the config.txt on a home assistant OS installation I use

mkdir /fat_mount
mount -t msdos /dev/diskXXX /fat_mount

as advised here to mount the FAT disk

http://apple.stackexchange.com/questions/260374/ddg#260380

thanks to @MatsK for pointing out

2
  • But its only the /boot that is FAT, the rest is EXT!
    – MatsK
    Feb 1, 2023 at 20:39
  • thanks, edited the answer
    – Dima
    Feb 2, 2023 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.