Operation Manual

Before these external devices are accessible, however, the operating system needs to know about them. In Linux, this process is
known as mounting. If youre running a version of Linux with a desktop environment loadedlike the recommended Debian
distributions LXDE, loaded from the console with the startx command—this process is automatic. Simply connect the device
to a free USB port on the Pi or a USB hub, and the device and its contents will be immediately accessible (see Figure 2-2).
Figure 2-2: LXDE automatically mounting a USB mass storage device
From the console, things are only slightly more difficult. To make a device accessible to Linux when the desktop environment
isnt loaded, follow these steps:
1. Connect the USB storage device to the Pi, either directly or through a connected USB hub.
2. Type sudo fdisk -l to get a list of drives connected to the Pi, and find the USB storage device by size. Note the device
name: /dev/sdXN, where X is the drive letter and N is the partition number. If it is the only device connected to the Pi, this
will be /dev/sda1.
3. Before the USB storage device is accessible, Linux needs a mount point for it. Create this by typing sudo mkdir
/media/externaldrive.
4. Currently, the device is only accessible to the root user. To make it accessible to all users, type the following as a single
line:
sudo chgrp -R users /media/externaldrive &&
sudo chmod -R g+w /media/externaldrive
5. Mount the USB storage device with sudo mount /dev/sdXN /media/externaldrive -o=rw to gain access to the
device and its contents.
Creating a New User Account
Unlike Windows and OS X, which are largely designed for use by a single individual, Linux is at heart a social operating system
designed to accommodate numerous users. By default, Debian is configured with two user accounts: pi, which is the normal user
account, and root, which is a superuser account with additional permissions.
Dont be tempted to log in as root all the time. Using a nonprivileged user account, you’re protected against accidentally wrecking your operating
system and from the ravages of viruses and other malware downloaded from the Internet.
While its certainly possible for you to use the pi account, its better if you create your own dedicated user account. Further
accounts can also be created, for any friends or family members who might want to use the Pi.
Creating a new account on the Pi is straightforward, and the same on all distributions, except for the username and password