Simple clear advice in plain English

Hands on: Disks and file systems

Find out how different the Unix way of disk handling is from the Windows approach

If you are not used to the Unix way of accessing disk drives, things may seem a little complicated at first, especially if you are coming from a Windows background. With the Microsoft operating system, partitions on a disk are assigned an arbitrary letter, starting with ‘C:’ for the system disk. Each partition across however many disks or CDs (or even network ‘drives’) are available is accessed in this way. However, with Linux, and all Unix derivatives, storage devices are mounted onto a single virtual filesystem, known as the root filesystem, instead.

The best way to illustrate the difference is to imagine a typical disk that has been set up for dual-booting between Windows and Linux. You can see a graphical representation of this disk, as shown in the Ubuntu 8.10 live installer.

The disk has two primary partitions and two logical ones. The first primary partition is an NTFS-formatted Windows XP installation. The second primary partition is formatted with Linux’s ext3, and contains a copy of Ubuntu.

The first logical partition is for various data files to be accessed both from Windows and Linux, and is formatted with NTFS; the final logical partition is swap space for the Linux installation. The table (attached as a PDF at the top of this page) shows how Windows and Linux may refer to each partition on this disk.

While Windows assigns a letter to filesystems it can understand (such as NTFS and the File Allocation Table, or Fat), it ignores any others completely.

Linux on the other hand uses device names based on the hardware layout itself. The first disk drive (typically the boot drive) is given the name sda, and each partition is assigned a fixed ascending number. The root partition (the second primary partition, in this example) is mounted as the top-level directory, and any other drives are mounted below it.

As a result, all files that you can access under Linux, whether they’re on an internal disk or a remote server, are manipulated under one filesystem. In the example above, entering the directory /media/data would take you from the Linux partition to the Windows data drive on /dev/sda5.

This approach offers some flexibility. If you decided to add a drive to the system to replace the data partition, it would be a simple task to switch /media/data to point to the new storage space. Similarly, adding extra drives or network shares will not change the layout, so sda5 will remain sda5. Drives can be added at any time without disrupting the structure of the filesystem; you could add a new drive on /media/video, without it affecting anything else.

However, issues over device names can still occur, especially with plug-in storage. For example, if your PC has a single internal hard disk, and you plug in an external USB drive, then the USB drive will be named ‘sdb’. If you then plug an iPod into another USB port, it will be assigned ‘sdc’. But what happens if you plug them in the other way round? The device names will be reversed, as Linux assigns device names according to the order in which it finds them.

So while the system works well for fixed internal drives, it is less predictable when storage availability becomes variable. Fortunately, access to plug-in devices is handled very well and transparently by Linux desktops, and is rarely noticed by users.

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Fix-virtualbox-problems-in-ubuntu

Get VirtualBox working in Ubuntu Linux

Virtualbox is great if you need to get Windows apps working in Ubuntu but it may need help to get working

Clearing error message in Windows startup

Solving your PC startup problems

Whether your Windows PC is slow to start, gives error messages or won't start up at all, we offer solutions to 10 of the most common problems

f-336-b2b-lead

Change the way your files are stored on a computer's hard disk

What are Fat 32 and NTFS and how do they help you find documents faster?

Question & Answer

Q.How do I store musician and other information about...

> Read the answer

Q.Why can't my browser find the website address I typed...

> Read the answer

Q.All updates have been downloaded, so why won't Windows...

> Read the answer

Best deals on the web

img

THREE E585 Mi-Fi Take it Away Mobile Broadband - 5GB allowance

£44.97- Buy it now

img

T-MOBILE 3G Pay As You Go iPad Micro SIM

£0.10- Buy it now

img

THREE Huawei E353u Take It Away Mobile Broadband - One Month Rolling Contract

£4.99- Buy it now

Great benefits for subscribers!

Poll

Which is your preferred web browser

Jargon Buster

Computing terms explained in plain English

GIF

Grahics Interchange Format. A type of image file often used on the web, but now largely superseded by...

Great shopping deals from Computeractive