Book Image

Banana Pi Cookbook

By : Ryad El-Dajani
Book Image

Banana Pi Cookbook

By: Ryad El-Dajani

Overview of this book

Table of Contents (13 chapters)

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:

  1. Connect your devices accordingly.

  2. Power your Banana Pi and initiate the boot sequence.

  3. Open a shell.

  4. Determine the used filesystems by blkid on attached partitions:

    $ sudo blkid
    
  5. 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, and sda3 using NTFS):

  6. Create the necessary target directories to mount these partitions:

    $ sudo mkdir /mnt/ext4_partition
    $ sudo mkdir /mnt/fat_partition
    $...