Hi, it sounds like you need to know how to mount a drive within your filesystem. You can find out how to do this by typing
However, what will be most helpful is learning how to use the /etc/fstab file to mount all of your filesystems automatically at boot time. You can get started by looking at
I assume you are more or less brand new to Linux, but relatively adept at Windows. Sorry if this is a bit pedantic.
In Windows, every physical device appears as a separate entity, as does each partition on devices that have more than one. (Drives A:-Z: ) In Unix-like operating systems, each disk partition is identified by a combination of drive name and partition number. Debain, like most GNU/Linux systems, uses the following scheme: (s,h)d(a-z)(1-9). Looks confusing, but it's pretty simple: Your primary hard drive will be called sda if it's a serial (ie, SATA) device or hda if it's an older IDE device. Devices like optical drives and USB disks are named similarly, but not exactly the same.
After the disk identifier, each volume name will be appended with the partition number in question. My own desktop machine has two drives, hda and sda. I have partitions hda1, hda2, hda5-hda9 and sda1, sda2 and sda5-sda7. The numbers should correspond to the native partition numbers as Debian sees them. Note that your partitions may not be numbered contiguously, depending on how your drives are partitioned. The Gnome Disks utility will give you a simple overview of each drive layout; KDE and other window managers have similar utilities. The program Gparted will give you a more detailed view, but be careful with it. On the other hand, it can be just as informative and easier to use the terminal:
will present you with a nice table of partitions very quickly. (Like Gparted, be very careful with the fdisk command; also use the sudo command whenever possible, rather than logging in as root -- the # prompt may appear to suggest you should actually log in as root, but it is commonly understood as shorthand for '$ sudo [command]'. See the manpages for sudo and sudoers for more information.)
Note that there is a different scheme called UUID, which uses long hexadecimal numbers to identify each volume. I don't believe Debian stable will use UUIDs out of the box, but recent Ubuntu versions can use either scheme. Just something to be aware of.
Based on the information you gave, I suspect your layout will look something like this: sda, which is probably subdivided into multiple partitions; and sdb, which might be one large partition, or might contain multiple partitions as well.
Now that you know how to identify your disk partitions, you need to understand how the filesystem sees them. Unlike the discrete volumes found in Windows, Unix-like OSes organize every volume into one big filesystem. For example, your sda1 partition probably holds your root (/) filesystem, sda2 might hold /var, sda3 might hold /usr and sdb1 might hold /home. When you look at the file hierarchy, the fact that different directories reside on different volumes is hidden from you. It may be a headache now, but it will become very convenient as you become familiar with it.
I'm going to assume you understand how to use the mount command with a basic level of expertise. mount assigns each partition on your disks to a directory in the filesystem, whereas the fstab file tells the kernel where to look for each filesystem automatically so you will only need to use the mount command rarely. Debian organizes all of its volumes as files under /dev, but you can't cd or cp directly into them -- they will appear as special files rather than directories. Your hard drive partitions will be known as /dev/sda1-/dev/sdax and /dev/sdb1-/dev/sdbx. All of the filesystems that are essential for system operation should already be defined in fstab. What you need to do now is a) create a diretory and an fstab entry for any partitions on sda that you want access to, then b) create directories and fstab entries for any partitions on sdb you want access to.
This magical file resides at /etc/fstab. You must edit it as root, so use the command
where you may replace 'edit' with your favorite text editor -- Gnome's GUI text editor is called gedit, while KDE features kedit. Most Linux systems will also feature some or all of the other popular terminal based editors. Conveniently, your Debian install probably has assigned one of the simpler, more intuitive editors to an environment variable that 'edit' stands in for. In other words, you can issue the 'edit' command with little regard for what program will actually be doing the work. Here is my laptop's fstab:
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda2 / ext3 errors=remount-ro 0 1
/dev/hda6 /home ext3 defaults 0 2
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
The first 2 columns of each line do exactly what mount does: assigns a device file (/dev/hda2) to a mount point in the filesystem (/). The third column defines the filesystem type. You will probably be using ext3 for all of your data filesystems, but remember that any swap partitions have their own filesystem type. Make sure you know what type of filesystem is used for each volume before you save your /etc/fstab. The options column can safely be set to 'defaults' for any data partitions. The fifth column defines how often each filesystem will be 'dumped'. I hate to encourage ignorance, but I have been using Linux for 3 years without knowing anything about filesystem dumping. Use a 0 here. The sixth column tells the init scripts in which order to check each filesystem for errors. The root filesystem should already be assigned a value of 1; any other partitions that should be checked will be labeled 2. Partitions that do not need to be checked should be labeled 0. In other words, any filesystems in your fstab should keep the default value already assigned. For filesystems you add to fstab yourself, you will need to decide whether they will need to be checked for errors on startup; assign a 2 if so, or a 0 if not.
As a practical matter, you will probably want to mount all of your data partitions under /home. If this is a single-user machine, create directories such as /home/username/music, /home/username/www and /home/username/video. If it is a multiple-user machine, create the directories you want directly under /home, then make sure each directory has the proper permissions for each authorized user to access it. Remember that you are assigning entire filesystems to each of these directories. It is possible to assign sub-sections of a filesystem to a given directory, but the syntax is a bit different.
Now that you have entered values for each of the filesystems you want to mount automatically, you will need to save /etc/fstab and then reload it. To relaod fstab, you can either reboot or use the following command:
which will run through /etc/fstab and mount or re-mount every filesystem defined there. That should be enough to get you started. Be prepared to have some headaches with file permissions either immediately or down the road -- the next thing you'll probbaly want to learn is how the permissions of the target directories can affect the level of access each user has to each filesystem.