Maximum PC

Navigate the Linux Filesystem

Don’t be shocked by the way Linux handles files—it’s actually quite logical

-

THE LINUX FILESYSTEM (ext2, ext3, and ext4) is radically different to Windows. The key change is how it references drives and partitions—not as separate, distinct drive letters, but as files within the main filesystem itself. It is logical, though, and it won’t take you long to adapt.

Open the Dash, and type “disks” to open the Disks utility, to help you visualize how things work. Select a drive in the left-hand menu, and look in the Disks menu bar. You’ll see your drive is referenced something like /dev/sda. This refers to the “dev” (devices) folder, inside which each physical disk is assigned a unique file, which begins “sd” (for “storage device”), followed by a unique letter from “a” through “z.”

This follows a logical pattern: /dev/sda is assigned to the drive Ubuntu is installed on, with drives then allocated “sdb,” “sdc,” and so on, following the order of internal drives first, then external media (both flash and hard drives) second. The logic extends to partitioni­ng, so instead of assigning partitions (or “volumes”) separate drive letters, Linux identifies each with individual files named “sda1,” “sda2,” and so on. Partitions are represente­d in the bar chart for each drive in Disks. Numbering isn’t always logical—if your drive is formatted using the MBR (Master Boot Record) partitioni­ng scheme, for example, you may notice any additional partition you’ve set up is allocated “sda5” and not “sda2.” Don’t worry, though—it’s all working as it should.

Accessing Drives Drives aren’t just incorporat­ed into the main filing system as individual files, they’re also “mounted” to specific folders within the filesystem, which is where their contents can be found. Your main system partition (typically /dev/sda1) is mounted to the root directory (/) of the filesystem. Other internal and external volumes aren’t mounted by default ( although external drives mount automatica­lly if you plug them in after logging on to Ubuntu), while the swap file isn’t mounted, period.

The simplest way to access your files and folders is via a file manager—Ubuntu’s default Files program is based on a tool called Nautilus, and is similar to File Explorer in Windows. Open it by clicking the filing cabinet icon in the Dash, and you’ll see a list of available volumes appear in the left-hand navigation pane. Click one to mount it—an eject button appears next to it, indicating the drive has been successful­ly mounted.

These shortcuts are convenient, but where are these drives physically mounted within the Linux filesystem? Click “Computer” in the Navigation pane to navigate to the root directory, then browse to “/media/< yourname>” to find folders pointing to each drive that you have physically mounted.

It’s also possible to mount key folders on separate volumes, too—for example, many Linux installati­ons set up a dedicated partition for the /home folder during the installati­on process, where all your user settings and data, including such folders as Documents, Downloads, and Pictures, are stored. (Ubuntu is one of the few that doesn’t do this.)

Mount on Startup If you’d like Ubuntu to automatica­lly mount specific volumes at startup, saving you the bother of having to click them manually, open the Disks utility, select your drive on the left, then highlight the volume by clicking it on the bar chart. Now click the “Settings” button beneath it, and choose “Edit Mount Options.” Flick the “Automatic Mount Options” switch to “On,” and make sure the first two options are selected, then change the “Mount Point” field to “media/user/label,” substituti­ng “user” with your username, and “label” with the volume label. Click “OK,” then reboot to verify the drive mounts automatica­lly.

Another key aspect of the Linux filesystem is file permission­s, which we discuss on the next page.

 ??  ?? Use the Disks utility to configure volumes to mount automatica­lly when you start Ubuntu.
Use the Disks utility to configure volumes to mount automatica­lly when you start Ubuntu.

Newspapers in English

Newspapers from United States