(15) Edit /etc/fstab USB Drive Partions

We do need to configure fstab. Before we edit it, make sure we really do know the correct names of the partitions.

The SD CARD is /dev/mmcblk0 , of which the Boot Partiton should be 63Mb in size, and file system FAT32

boot is not the first partition, that is NOOBS.

In this example, my USB Hardrive is /dev/sda


(chroot) raspberrypi / #   fdisk -l

 
Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

 
Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000729e0

Device         Boot    Start      End  Sectors  Size Id Type
/dev/mmcblk0p1          8192  2527343  2519152  1.2G  e W95 FAT16 (LBA)
/dev/mmcblk0p2       2527344 15523839 12996496  6.2G 85 Linux extended
/dev/mmcblk0p5       2531328  2596861    65534   32M 83 Linux
/dev/mmcblk0p6       2596864  2725887   129024   63M  c W95 FAT32 (LBA)
/dev/mmcblk0p7       2727936 14467069 11739134  5.6G 83 Linux
/dev/mmcblk0p8      14467072 15515647  1048576  512M  e W95 FAT16 (LBA)


Disk /dev/sda: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DDED6A43-BCDF-4AC3-8AAF-E47D16E190FE

Device       Start        End    Sectors   Size Type
/dev/sda1     2048    8390655    8388608     4G Linux swap
/dev/sda2  8390656 1953523711 1945133056 927.5G Linux filesystem


Arm'd with that knowledge, editing fstab is simple enough. Just take your time and double check everything. Do not get over paranoid, because if things go wrong you can always boot Raspbian and correct it. I often get the partitions right, but forget to edit the file systems.

IF you used different partitioning or file systems, you will have to edit the differences.

Take note that the /boot points to the SD Card, and that the root partition points to the USB Drive.

The other little extra is the the Floppy disk and CD-Rom are commented out.


(chroot) raspberrypi / #   nano /etc/fstab


# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

proc                    /proc           proc            defaults                0 0
/dev/mmcblk0p6          /boot           vfat            defaults,noatime        1 2
/dev/sda2               /               ext4            noatime                 0 1
/dev/sda1               none            swap            sw                      0 0

#/dev/cdrom             /mnt/cdrom      auto            noauto,ro               0 0
#/dev/fd0               /mnt/floppy     auto            noauto                  0 0


Make extra double, triple sure you get this right, or the system will not be able to correctly mount the partitions at boot... You will then have to boot Raspbian just to edit the corrections, which is annoying.

An alterantive stratergy is create a second additional /boot partition on the SD Card - exclusive to Gentoo. The advantage is it is then plausible to have a real dual boot menu and different config.txt settings. The disadvantage is its extra complexity and it steals space from Raspbian.

Next : Networking

PREVIOUS INDEX NEXT