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

techraf
  • 4,319
  • 10
  • 31
  • 42
Besi
  • 874
  • 4
  • 11
  • 24
  • 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. – akwasiijunior Nov 29 '22 at 08:36

7 Answers7

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

Frank
  • 316
  • 2
  • 5
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.

Ivan Rybalko
  • 191
  • 1
  • 2
  • 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 '23 at 04: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! – Matt Zabojnik Apr 08 '23 at 00:45
  • I think this is another option for M1/M2: https://github.com/gerard/ext4fuse/issues/66#issuecomment-819943409 – Andy Smith Sep 17 '23 at 19:33
  • Can confirm: this took minutes and worked beautifully. – Mike 'Pomax' Kamermans Feb 11 '24 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

Besi
  • 874
  • 4
  • 11
  • 24
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.

EDP
  • 1,691
  • 1
  • 14
  • 24
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"
Milliways
  • 59,890
  • 31
  • 101
  • 209
  • 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 '20 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

Gotschi
  • 608
  • 2
  • 7
  • 16
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

Dima
  • 1
  • 1