Recover RPi from boot error

In my case, the following line in the file /etc/fstab:

tmpfs    /var/run    tmpfs    defaults,noatime,nosuid,mode=0755,size=2m    0 0

Make a backup of your SD card

$ diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         500.3 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:          Apple_CoreStorage Untitled                499.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS macosHD                +498.8 GB   disk1
                                 Logical Volume on disk0s2
                                 E241ECAD-894C-4CAE-ABAC-F69C5BF96776
                                 Unlocked Encrypted

/dev/disk2 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        +198.2 MB   disk2
   1:        Apple_partition_map                         32.3 KB    disk2s1
   2:                  Apple_HFS Google Chrome Canary    198.2 MB   disk2s2

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *32.0 GB    disk3
   1:             Windows_FAT_32 boot                    43.8 MB    disk3s1
   2:                      Linux                         32.0 GB    disk3s2

Clone the card, output will be stored in backups directory:

sudo dd if=/dev/disk3 of=/Users/<you>/Development/RPI/BACKUPS/openberry/openberry.dmg

This can take some time, you will see no progress indication other than a message once the job is done. You could get some progress information issuing a command like /usr/bin/pkill -INFO -x dd.

NOTE: If you want to recover from a backup you should do the following

sudo dd if=/Users/<you>/Development/RPI/BACKUPS/openberry/openberry.dmg of=/dev/disk3

More information and how to do the process in other platforms here

Download Ubuntu to modify

$ VBoxManage internalcommands createrawvmdk -filename ~/RPI/BACKUPS/openberry/openberry.vmdk -rawdisk /dev/disk2

https://mirror.pnl.gov/releases/16.04.5/