Mounting via fstab
In this recipe, we are going to automount our drives using the fstab
(located at /etc/fstab
) system file.
Getting ready
The following components are required to mount drives conveniently using the fstab
file:
- A working Linux system on the Banana Pi
- A USB flash drive and/or a SATA drive
- In case of a SATA drive, a working connection to your Banana Pi and a suitable power supply
- Access to the Banana Pi's shell
How to do it…
Perform the following to configure a drive in your fstab
:
- Connect your devices accordingly.
- Power your Banana Pi and initiate the boot sequence.
- Open a shell.
- Determine the used filesystems by
blkid
on attached partitions:$ sudo blkid
- You will get information about all the available partitions. In the following screenshot, you see that the drive
/dev/sda
has three partitions (sda1
using ext4,sda2
using FAT32, andsda3
using NTFS): - Create the necessary target directories to mount these partitions:
$ sudo mkdir /mnt/ext4_partition $ sudo mkdir /mnt/fat_partition...