Hard Drive Mounting

If I refer to something you don't understand, especially basic commands, refer to the basics article.

Being new to Linux can be difficult, even small tasks which became natural in Windows can seem complicated and daunting. In windows, when you pop in a disk, all you've got to do is click on its icon or type its letter at a DOS prompt and there it is. But in the file manager of a linux distro you are presented with nothing but a "/" at the very base of the directory structure, and no drive letters at all.

So what do we do? Where are your other three hard drives? Well, that's what the purpose of this article is. First, you'll want to look in the /dev directory. You will see a huge mass of numbers like hda12 and such. These are potential devices in your system. They are organized by the type of device (in our instance, hd) followed by a letter which represents which IDE channel it is attached to (a), and by a number which is just the order of the partitions on that drive (12). Of course, it's not probable that the machine you are working on has 12 partitions on one drive, or you wouldn't be reading this tutorial.

For this example, our system will have a 20 gig hard drive as master on the first IDE cable, with one large FAT32 (windows 95,98,ME and some Windows 2000 systems) partition. The second hard drive is master on the second IDE cable and has one 10 gig storage partition for Windows and a second 10 gig on which Linux is installed.

The first thing we need to figure out is what the device is called in the "/dev" directory. And because the partitions are numbered in the order they exist on the drive, we see that we want to mount hda1 and hdc1.

Primary Master:hda
Primary Slave:hdb
Secondary Master:hdc
Secondary Slave:hdd

When we actually mount the drive, we basically create a link to this device and tell Linux how to use it. Before we can mount it then, we must first make a place to link it to. The usual place for this is in the "/mnt" directory (short for mount of course). So we want to cd to the /mnt directory and mkdir your windows directories, in this case, I will use win1 and win2 for the first and second respectively. When making directories you'll have to re-use multiple times, do yourself a favor and make it all lower case because it's annoying as anything to try to do something and constantly be forgetting it was another case. Now, we will also have to tell it how to use the partition by telling the partition type. FAT32 is called "vfat." The final commands should be these:

mount -t vfat /dev/hda1 /mnt/win1
mount -t vfat /dev/hdc1 /mnt/win2

The -t can be replaced by other options, but for the sake of this tutorial, you just need to know that -t is what you use when you want to do a plain ol' mount. So now I've told Linux that hard drive hdal in the /dev directory should be mounted as vfat and shown in the directory /mnt/win. Note that just running the command without first creating the directory will not create that directory. So now we can simply cd to the directories we created and ls and like magic they are filled with the base directories of both our windows partitions.

Page not copyright (c) Sam
But how about not swiping it anyway?

All pages optimized for Opera and Netscape 4.X