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.
Related articles
Q.How do I store musician and other information about...
Q.Why can't my browser find the website address I typed...
Q.All updates have been downloaded, so why won't Windows...
Grahics Interchange Format. A type of image file often used on the web, but now largely superseded by...
|
|
|
|
|
Nikon Coolpix S570 BlackPrice: £66.99 |
Computeractive Ultimate Guide - Storage, Sharing & BackupPrice: £5.99 |
Back Issue CD-Rom 13 (2010)Price: £9.99 |
Hallmark Card Studio DeluxePrice: £15.31 |
Marine AquariumPrice: £15.41 |