Mounting an SD Card FFS Partition on Linux (Fedora)


The goal for my SD Card Setup was to end up with a card that looks like this:


The challenge I ran into was moving content onto the FFS partition.  The FPGA system recognized and formatted the partition as a large hard drive just fine. However, the FPGA has limitations on getting mass content onto the large hard drive.  Many do this using UAE, but attaching to a native FFS secondary partition on Windows via UAE was impossible.  Windows did not recognize the partition so UAE could not access it.  Some research revealed Linux could mount and access an FFS partition.  This means you don’t have to go through emulation to add files to the partition.


Mounting an FFS partition is one simple command, but you need to know the device name, offset, and partition size as well as having a mount point ready to go. The basic command is


sudo mount -t affs -o loop,offset=1032192,sizelimit=14854791168 /dev/sdg2 /run/media/Jerry/games


In order to get the information to finish up the command, follow the process below.

Create a Mount Point

I created it where the USB drives show up when inserted. Not sure if this is the best/standard place to manually create a mount point, but there it is. I also had to change the permissions on the mount point to allow write access so I just went all in (777)


cd /run/media/Jerry

mkdir games

sudo chmod 777 games


[Jerry@localhost Jerry]$ pwd


[Jerry@localhost Jerry]$ ls -l

total 16

drwxr-xr-x. 16 Jerry Jerry 16384 Dec 31  1969 AMIGA

drwxrwxrwx.  1 root  root      0 Jul 30 18:45 games

Figure out your SD card device name

To do this I used the findmnt command.  It lists all the mounted devices.  I know my primary SD card partition is a Fat partition called AMIGA.  In the findmnt command results I see the following line.  

─/run/media/Jerry/AMIGA            /dev/sdg1  vfat  


From this I can assume that my SD Card is device /dev/sdg and my FFS partition is /dev/sdg2.  Also, be aware that this device will likely change every time you remove and re-insert your SD card.


You can see the full results of the findmnt command in Appendix 1 below.


You can see /dev/sdg2 in the full device listing under /dev.  You can see a sample /dev listing in  Appendix 2 below.

View Partitions

By using the command parted a couple of times I can 1) verify my device is my SD Card and I can 2) get information on my FFS partition to complete the mount command.


On the first run below, you can see I am viewing all partitions on the /dev/sdg device.  I see my fat partition first, followed by my ffs partition.  For some reason, my system does not recognize the second partition as ffs at this time.  Other tutorials seem to show parted recognizing that ffs partition.




[Jerry@localhost Jerry]$ sudo parted /dev/sdg

[sudo] password for Jerry:

GNU Parted 3.2

Using /dev/sdg

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) u                                                                

Unit?  [compact]? b                                                      

(parted) p                                                                

Model: Generic STORAGE DEVICE (scsi)

Disk /dev/sdg: 15931539456B

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Disk Flags:


Number  Start        End           Size          Type     File system  Flags

 1      1048576B     1049624575B   1048576000B   primary  fat16        lba

 2      1049624576B  15929966591B  14880342016B  primary


I run parted again, once again changing units to bytes, on /dev/sdg2 to verify it is my FFS partition and get the offset and size information.  You will notice that it does recognize this partition as affs3, which is what we want to see.


[Jerry@localhost Jerry]$ sudo parted /dev/sdg2

GNU Parted 3.2

Using /dev/sdg2

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) u                                                                

Unit?  [compact]? b                                                      

(parted) p                                                                

Pralloc = 0, Reserved = 2, blocksize = 1, root block at 14508648

Model: Unknown (unknown)

Disk /dev/sdg2: 14880342016B

Sector size (logical/physical): 512B/512B

Partition Table: amiga

Disk Flags:


Number  Start     End           Size          File system  Name  Flags

 1      1032192B  14855823359B  14854791168B  affs3        DH1

The Final Command

Once I know my device name, the starting offset, and the partition size, I can create and run the command to mount the ffs partition.


sudo mount -t affs -o loop,offset=1032192,sizelimit=14854791168 /dev/sdg2 /run/media/Jerry/games


This following links were very valuable in guiding me to this solution.

The primary resource for guiding me on mounting an AFFS parition:

Info on the affs file system for Linux

Info on the findmnt command:

Info on setting up loopbacks (but eventually not needed):

Man page on the mount command:

forum article leading me to know I needed the sizelimit parameter

more info on mounting an .HDF file and using parted

Finding the VM Ware shared folders (for copying host files to the AFFS partition once mounted:

Appendix 1 – findmnt

Full findmnt command results below:


[Jerry@localhost Jerry]$ findmnt

TARGET                                SOURCE     FSTYPE        OPTIONS

/                                     /dev/mapper/fedora-root

│                                                ext4          rw,relatime,seclabel

├─/sys                                sysfs      sysfs         rw,nosuid,nodev,noexec,relatime,seclabel

│ ├─/sys/kernel/security              securityfs securityfs    rw,nosuid,nodev,noexec,relatime

│ ├─/sys/fs/cgroup                    tmpfs      tmpfs         ro,nosuid,nodev,noexec,seclabel,mode=755

│ │ ├─/sys/fs/cgroup/unified          cgroup2    cgroup2       rw,nosuid,nodev,noexec,relatime,seclabel,nsdelegate

│ │ ├─/sys/fs/cgroup/systemd          cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,xattr,name=systemd

│ │ ├─/sys/fs/cgroup/devices          cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,devices

│ │ ├─/sys/fs/cgroup/perf_event       cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,perf_event

│ │ ├─/sys/fs/cgroup/cpuset           cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,cpuset

│ │ ├─/sys/fs/cgroup/hugetlb          cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,hugetlb

│ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,net_cls,net_prio

│ │ ├─/sys/fs/cgroup/pids             cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,pids

│ │ ├─/sys/fs/cgroup/blkio            cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,blkio

│ │ ├─/sys/fs/cgroup/cpu,cpuacct      cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,cpu,cpuacct

│ │ ├─/sys/fs/cgroup/freezer          cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,freezer

│ │ └─/sys/fs/cgroup/memory           cgroup     cgroup        rw,nosuid,nodev,noexec,relatime,seclabel,memory

│ ├─/sys/fs/pstore                    pstore     pstore        rw,nosuid,nodev,noexec,relatime,seclabel

│ ├─/sys/fs/bpf                       bpf        bpf           rw,nosuid,nodev,noexec,relatime,mode=700

│ ├─/sys/fs/selinux                   selinuxfs  selinuxfs     rw,relatime

│ ├─/sys/kernel/debug                 debugfs    debugfs       rw,relatime,seclabel

│ ├─/sys/kernel/config                configfs   configfs      rw,relatime

│ └─/sys/fs/fuse/connections          fusectl    fusectl       rw,relatime

├─/proc                               proc       proc          rw,nosuid,nodev,noexec,relatime

│ └─/proc/sys/fs/binfmt_misc          systemd-1  autofs        rw,relatime,fd=44,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=1617

├─/dev                                devtmpfs   devtmpfs      rw,nosuid,seclabel,size=1508396k,nr_inodes=377099,mode=755

│ ├─/dev/shm                          tmpfs      tmpfs         rw,nosuid,nodev,seclabel

│ ├─/dev/pts                          devpts     devpts        rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000

│ ├─/dev/mqueue                       mqueue     mqueue        rw,relatime,seclabel

│ └─/dev/hugepages                    hugetlbfs  hugetlbfs     rw,relatime,seclabel,pagesize=2M

├─/run                                tmpfs      tmpfs         rw,nosuid,nodev,seclabel,mode=755

│ ├─/run/media/Jerry/AMIGA            /dev/sdg1  vfat          rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437

│ └─/run/user/1000                    tmpfs      tmpfs         rw,nosuid,nodev,relatime,seclabel,size=304600k,mode=700,uid=1000,gid=1000

│   └─/run/user/1000/gvfs             gvfsd-fuse fuse.gvfsd-fu rw,nosuid,nodev,relatime,user_id=1000,group_id=1000

├─/tmp                                tmpfs      tmpfs         rw,nosuid,nodev,seclabel

├─/boot                               /dev/sda1  ext4          rw,relatime,seclabel

├─/home                               /dev/mapper/fedora-home

│                                                ext4          rw,relatime,seclabel

└─/var/lib/nfs/rpc_pipefs             sunrpc     rpc_pipefs    rw,relatime


Appendix 2 – View devices


To see the devices, navigate to /dev and get a directory listing.  This will show you all the devices including the loopbacks and SD Card partitions.


[Jerry@localhost dev]$ pwd


[Jerry@localhost dev]$ ls -l

total 0


. . . Listing shorted to save trees . . .


drwxr-xr-x. 4 root  root         260 Jul 29 12:23 input

crw-r--r--. 1 root  root      1,  11 Jul 29 12:23 kmsg

lrwxrwxrwx. 1 root  root          28 Jul 29 12:23 log -> /run/systemd/journal/dev-log

brw-rw----. 1 root  disk      7,   0 Jul 30 18:16 loop0

brw-rw----. 1 root  disk      7,   1 Jul 30 17:49 loop1

brw-rw----. 1 root  disk      7,   2 Jul 30 17:41 loop2

brw-rw----. 1 root  disk      7,   3 Jul 30 17:40 loop3

crw-rw----. 1 root  disk     10, 237 Jul 29 21:00 loop-control

crw-rw----. 1 root  lp        6,   0 Jul 29 12:23 lp0

crw-rw----. 1 root  lp        6,   1 Jul 29 12:23 lp1

crw-rw----. 1 root  lp        6,   2 Jul 29 12:23 lp2

crw-rw----. 1 root  lp        6,   3 Jul 29 12:23 lp3

drwxr-xr-x. 2 root  root         120 Jul 29 12:23 mapper

crw-------. 1 root  root     10, 227 Jul 29 12:23 mcelog


. . . Listing shorted to save trees . . .


crw-------. 1 root  root    251,   0 Jul 29 12:23 rtc0

brw-rw----. 1 root  disk      8,   0 Jul 29 12:23 sda

brw-rw----. 1 root  disk      8,   1 Jul 29 12:23 sda1

brw-rw----. 1 root  disk      8,   2 Jul 29 12:23 sda2

brw-rw----. 1 root  disk      8,  16 Jul 30 17:38 sdb

brw-rw----. 1 root  disk      8,  32 Jul 30 17:38 sdc

brw-rw----. 1 root  disk      8,  96 Jul 30 18:13 sdg

brw-rw----. 1 root  disk      8,  97 Jul 30 18:14 sdg1

brw-rw----. 1 root  disk      8,  98 Jul 30 18:58 sdg2

brw-rw----. 1 root  disk      8, 112 Jul 30 17:38 sdh

brw-rw----. 1 root  disk      8, 128 Jul 30 17:38 sdi

crw-rw----+ 1 root  cdrom    21,   0 Jul 29 12:23 sg0


. . . Listing shorted to save trees . . .


[Jerry@localhost dev]$