Listing the available drives

In the console, you can use the fdisk command to get a list of drives, and partitions as shown in the following command line:

sudo fdisk –l

The fdisk command will show you the names of the disks used in Linux, their full sizes, and partitions. The drive under /dev/mmcblk is the internal SD card, and you do not want to do anything with this device. Instead, you should always look for drives marked /dev/sdxn, where x is usually an letter representing a physical drive and n is a number representing the partitions of the device in ascending order.

Unfortunately, device names are not assigned in any particular order, and there is no guarantee that the same name will be used for the same drive. This can become a problem when ...

Get Raspberry Pi 2 Server Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.