Mount

/dev/sda3 on / type ext3 (rw) /dev/sda2 on /boot type ext3 (rw) /dev/sda1 on /mnt/win type vfat (rw) /dev/proc on /proc type proc (rw) /dev/sys on /sys type sysfs (rw)

/dev/devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/shm on /dev/shm type tmpfs (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) /dev/cdrom on /media/cdrecorder type iso9660 (ro,nosuid,nodev)

Although some of the file systems shown as mounted are for special purposes (/sys, /proc, and others), our concern here is with disk partition (/dev/hd*, /dev/sd*, and so on). The mounted Linux partitions in this case are /dev/sda2, which provides space for the /boot directory (contains data for booting Linux), and /dev/sda3, which provides space for the rest of the Linux file system beginning from the root directory (/).

This particular system also contains a Windows partition that was mounted in the /mnt/win directory and a CD that was mounted in /media/cdrecorder. (With most GUI interfaces, the CD is typically mounted automatically when you insert it. For 2.6 kernels, look in the /media directory; for 2.4 kernels the /mint directory is often used.)

After the word type, you can see the type of file system contained on the device. (See the description of different file system types in Table 10-5 in the following section.) Particularly on larger Linux systems, you may have multiple partitions for several reasons:

■ Multiple hard disks — You may have several hard disks available to your users. In that case you would have to mount each disk (and possibly several partitions from each disk) in different locations in your file system.

■ Protecting different parts of the file system — If the users on a system consume all of the file system space, the entire system can fail. For example, there may be no place for temporary files to be copied (so the programs writing to temporary files fail), and incoming mail may fail to be written to mail boxes. With multiple mounted partitions, if one partition runs out of space, the others can continue to work.

■ Multiple operating systems — You can configure your disk to contain multiple partitions that can each be used to hold a different operating system type. For example, if you started with a computer that had Windows on the hard disk, you could put Linux on a separate partition, and then set up the computer to boot either operating system.

■ Backups — Some fast ways exist to back up data from your computer that involve copying the entire image of a disk or partition. If you want to restore that partition later, you can simply copy it back (bit by bit) to a hard disk. With smaller partitions, this approach can be done fairly efficiently.

■ Protecting from disk failure — If one disk (or part of one disk) fails, having multiple partitions mounted on your file system may let you continue working and just fix the one disk that fails. Ghost for Linux (http://freshmeat.net/projects/g4l) is an example of a tool for backing up a hard disk partition in Linux.

When a disk partition is mounted on the Linux file system, all directories and subdirectories below that mount point are stored on that partition. So, for example, if you were to mount one partition on / and one on /usr, everything below the /usr mount point would be stored on the second partition, while everything else would be stored on the first partition. If you then mounted another partition on / usr/local , everything below that mount point would be on the third partition, while everything else below / usr would be on the second partition.

'T I V^V^'B happens 'f a remote file system is unmounted from your computer, and you go to

•CRSfctyyiySMSBi save a fj|e ¡n (hgt mount point directory? You will write the file to that directory, and it will be stored on your local hard disk. When the remote file system is remounted, however, the file you saved will seem to disappear. To get the file back, you'll have to unmount the remote file system (causing the file to reappear), move the file to another location, remount the file system, and copy the file back there.

Mount points often mentioned as being candidates for separate partitions include /, /boot, /home, /usr, and /var. The root file system (/) is the catchall for directories that aren't in other mount points. The root file system's mount point (/) is the only one that is required. The /boot directory holds the images needed to boot the operating system. The / home file system is where all the user accounts are typically stored. Applications and documentation are stored in /usr. Below the /var mount point is where log files, temporary files, server files (Web, FTP, and so on), and lock files are stored (that is, items that need disk space for your computer's applications to keep running).

The fact that multiple partitions are mounted on your file system is invisible to people using your Linux system. It is an issue only when a partition runs out of space or if users need to save or use information from a particular device (such as a floppy disk or remote file system) that isn't mounted. Of course, any user can check this by typing the mount command.

Was this article helpful?

0 0
Digital Cameras For Beginners

Digital Cameras For Beginners

Although we usually tend to think of the digital camera as the best thing since sliced bread, there are both pros and cons with its use. Nothing is available on the market that does not have both a good and a bad side, but the key is to weigh the good against the bad in order to come up with the best of both worlds.

Get My Free Ebook


Post a comment