Windows and macOS X do not support the ext4 format, so when you read the SD card, only the File Allocation Table (FAT) partitions will be accessible. In addition, Windows only supports the first partition on an SD card, so if you've installed NOOBS, only the RECOVERY partition will be visible. If you've written your card manually, you will be able to access the BOOT partition.
The data partition (if you installed one via NOOBS) and the root partition are in ext4 format and won't usually be visible on non-Linux systems.
If you do need to read files from the SD card using Windows, a freeware program,
Linux Reader (available at
www.diskinternals.com/linux-reader) can provide read-only access to all of the partitions on the SD card.
Access the partitions from Raspberry Pi. To view the currently mounted partitions, use df, as shown in the following screenshot:
The result of the df command
To access the BOOT partition from within Raspbian, use the following command:
cd /boot/
To access the RECOVERY or data partition, we have to mount it by performing the
following steps:
- Determine the name of the partition as the system refers to it by listing all the partitions, even the unmounted ones. The sudo fdisk -l command lists the partitions, as shown in the following screenshot:
NOOBS installation and data partition
The following table shows the names of partitions and their meanings
Partition name
|
Meaning
|
mmcblk0p1
|
(VFAT) RECOVERY
|
mmcblk0p2
|
(Extended partition) contains (root, data, BOOT)
|
mmcblk0p5
|
(ext4) root
|
mmcblk0p6
|
(VFAT) BOOT
|
mmcblk0p7
|
(ext4) SETTINGS
|
Â
If you have installed additional operating systems on the same card, the partition identifiers shown in the preceding table will be different.
- Create a folder and set it as the mount point for the partition; for the RECOVERY partition, use the following command:
mkdir ~/recovery
sudo mount -t vfat /dev/mmcblk0p1 ~/recovery
To ensure that they are mounted each time the system is started, perform the following steps:
- Add the sudo mount commands to /etc/rc.local before exit 0. If you have a different username, you will need to change pi to match:
sudo nano /etc/rc.local
sudo mount -t vfat /dev/mmcblk0p1 /home/pi/recovery
- Save and exit by pressing Ctrl + X, Y, and Enter.
Commands added to /etc/rc.local will be run for any user who logs on to Raspberry Pi. If you only want the drive to be mounted for the current user, the commands can be added to .bash_profile instead.
If you have to install additional operating systems on the same card, the partition identifiers shown here will be different.