Archive for May, 2007

Free web hosting with ftp - 164 Part II . Running the Show This

Tuesday, May 8th, 2007

164 Part II . Running the Show This shows the basic format of the mount command you would use to mount a floppy disk. You can change msdos to any other supported file system type (described earlier in this chapter) to mount a floppy of that type. Instead of using floppy drive A: (/dev/fd0), you could use drive B: (/dev/fd1) or any other accessible drive. Instead of mounting on /mnt/floppy, you could create any other directory and mount the floppy there. Here are some other useful options you could add to the mount command: . -t auto If you aren t sure exactly what type of file system is contained on the floppy disk (or other medium you are mounting), use this option to indicate the file system type. The mount command will query the disk to try to ascertain what type of file system it contains. . -r If you don t want to make changes to the mounted file system (or can t because it is a read-only medium), use this option to mount it read-only. . -w This mounts the file system with read/write permission. Mounting a Disk Image in Loopback Another valuable way to use the mount command has to do with disk images. If you download a CD or floppy disk image from the Internet and you want to see what it contains, you can do so without burning it to CD or floppy. With the image on your hard disk, create a mount point and use the -o loop option to mount it locally. Here s an example: # mkdir /mnt/mycdimage # mount -o loop whatever-i386-disc1.iso /mnt/mycdimage In this example, the /mnt/mycdimage directory is created, and then the disk image file (whatever-i386-disc1.iso) residing in the current directory is mounted on it. I can now cd to that directory, view the contents of it, and copy or use any of its contents. This is useful for downloaded CD images from which you want to install software without having to burn the image to CD. When you are done, just type umount /mnt/cdimage to unmount it. Other options to mount are available only for specific file system types. See the mount manual page for those and other useful options. Using the umount Command When you are done using a temporary file system, or you want to unmount a permanent file system temporarily, use the umount command. This command detaches the file system from its mount point in your Linux file system. To use umount, you can give it either a directory name or a device name. For example: # umount /mnt/floppy
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision mysql5 web hosting services

Fedora web server - Chapter 4 . Learning Basic Administration 163 Mounting

Tuesday, May 8th, 2007

Chapter 4 . Learning Basic Administration 163 Mounting Removable Media If you want to mount a file system manually, the /etc/fstab file helps make it simple to mount a floppy disk or a CD. In some cases, you can use the mount command with a single option to indicate what you want to mount, and information is taken from the /etc/fstab file to fill in the other options. There are probably already entries in your /etc/fstab file to let you do these quick mounts in the following two cases: . CD If you are mounting a CD that is in the standard ISO 9960 format (as most software CD-ROMs are), you can mount that CD by placing it in your CD-ROM drive and typing one of the following: # mount /media/cd* # mount /mnt/cdrom By default, a CD is usually mounted on the /mnt/cdrom directory (Linux 2.4 kernels) or a subdirectory of /media (Linux 2.6 kernels). (The file system type, device name, and other options are filled in automatically.) To see the contents, type cd /mnt/cdrom or cd /media/cd*, and then type ls. Files from the CD s root directory will be displayed. . Floppy disk If you want to mount a floppy in the Linux ext3 file system format (ext3), or in some cases a format that can be autodetected, mount that floppy disk by inserting it in your floppy drive and typing one of the following: # mount /media/floppy* # mount /mnt/floppy The file system type (ext3), device (/dev/fd0), and mount options are filled in from the /etc/fstab file. You should be able to change to the floppy disk directory (cd /mnt/floppy or cd /media/floppy*) and list the contents of the floppy s top directory (ls). In both of the these cases, you could give the device name (which is something like /dev/hdc, /dev/cdrom or /dev/fd0) instead of the mount point directory to get the same results. Of course, it is possible that you may get floppy disks you want to use that are in all formats. Someone may give you a floppy containing files from an older Microsoft operating system (in MS-DOS format). Or you may get a file from another UNIX system. In those cases, you can fill in your own options instead of relying on options from the /etc/fstab file. In some cases, Linux autodetects that the floppy disk contains an MS-DOS (or Windows vfat) file system and mounts it properly without additional arguments. If it doesn t, here s an example of how to mount a floppy containing MS-DOS files: # mount -t msdos /dev/fd0 /mnt/floppy Note
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services

162 Part II . Running (Christian web host) the Show .

Monday, May 7th, 2007

162 Part II . Running the Show . Field 5 The number in this field indicates whether the indicated file system needs to be dumped (that is, have its data backed up). A 1 means that the file system needs to be dumped, and a 2 means that it doesn t. (I don t think this field is useful anymore because many Linux systems no longer include the dump command. Most often, a 0 is used.) . Field 6 The number in this field indicates whether the indicated file system needs to be checked with fsck: 1 means it needs to be checked, and 2 means it doesn t. If you want to add an additional local disk or partition, you can create an entry for it in the /etc/fstab file. See Chapter 27 for information on mounting Samba, NFS, and other remount file systems from /etc/fstab. Using the mount Command to Mount File Systems Linux systems automatically run mount -a (mount all file systems) each time you boot. For that reason, you generally use the mount command only for special situations. In particular, the average user or administrator uses mount in two ways: . To display the disks, partitions, and remote file systems currently mounted. . To temporarily mount a file system. Any user can type mount (with no options) to see what file systems are currently mounted on the local Linux system. The following is an example of the mount command. It shows a single hard disk partition (/dev/hda1) containing the root (/) file system, and proc and devpts file system types mounted on /proc and /dev, respectively. The last entry shows a floppy disk, formatted with a standard Linux file system (ext3) mounted on the /mnt/floppy directory. $ mount /dev/hda3 on / type ext3 (rw) /dev/hda2 on /boot type ext3 (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/hdc on /media/cdrecorder type iso9660 (ro,nosuid,nodev) /dev/fd0 on /mnt/floppy type ext3 (rw) Traditionally, the most common devices to mount by hand are your floppy disk and your CD drive. However, depending on the type of desktop you are using, CDs and floppy disks may be mounted for you automatically when you insert them. (In some cases, the autorun program may also run automatically. For example, autorun may start a CD music player or software package installer to handle the data on the medium.)
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services

Anonymous web server - Chapter 4 . Learning Basic Administration 161 drives

Monday, May 7th, 2007

Chapter 4 . Learning Basic Administration 161 drives are not mounted at boot time. Definitions are put in the fstab file for floppy and CD drives so that they can be mounted in the future (as described later). I also added one line for /dev/hda1, which enables me to mount the Windows (vfat) partition on my computer so I don t have to always boot Windows to get at the files on my Windows partition. To access my Windows partition, I must first create the mount point (by typing mkdir /mnt/win). Then I can mount it when I choose by typing (as root) mount /mnt/win. Different Linux distributions will set up their fstab file differently. Some don t use labels and many others don t use a separate /boot partition by default. They will just have a swap partition and have all user data under the root partition (/). Here is what s in each field of the fstab file: . Field 1 The name of the device representing the file system. This field can include the LABEL option, with which you can indicate a universally unique identifier (UUID) or volume label instead of a device name. The advantage to this approach is that because the partition is identified by volume name, you can move a volume to a different device name and not have to change the fstab file. . Field 2 The mount point in the file system. The file system contains all data from the mount point down the directory tree structure unless another file system is mounted at some point beneath it. . Field 3 The file system type. Valid file system types are described in the Supported File Systems section earlier in this chapter. . Field 4 Options to the mount command. In the preceding example, the noauto option prevents the indicated file system from being mounted at boot time, and ro says to mount the file system read-only (which is reasonable for a CD drive). Commas must separate options. See the mount command manual page (under the -o option) for information on other supported options. Normally, only the root user is allowed to mount a file system using the mount command. However, to allow any user to mount a file system (such as a file system on a floppy disk), you could add the user option to Field 4 of /etc/fstab. In SUSE, read/write permissions are given to specific devices (such as disk or audio devices) by specific groups (such as the disk or audio group) so that users assigned to those groups can mount or otherwise access those devices. In the YaST Control Center, choose the Security and Users.User Management.Expert Options.Defaults for New Users. The Secondary Groups box indicates which of these additional groups each user is assigned to. Tip Note
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

Web hosts - 160 Part II . Running the Show Table

Sunday, May 6th, 2007

160 Part II . Running the Show Table 4-4 (continued) Type Description swap Used for swap partitions. Swap areas are used to hold data temporarily when RAM is currently used up. Data is swapped to the swap area and then returned to RAM when it is needed again. nfs Network File System (NFS) type of file system. NFS is used to mount file systems on other Linux or UNIX computers. hpfs File system is used to do read-only mounts of an OS/2 HPFS file system. ncpfs This relates to Novell NetWare file systems. NetWare file systems can be mounted over a network. ntfs Windows NT file system. It is supported as a read-only file system (so that you can mount and copy files from it). Read-write support is available but considered unreliable (some say dangerous). affs File system is used with Amiga computers. ufs File system popular on Sun Microsystems operating systems (that is, Solaris and SunOS). Using the fstab File to Define Mountable File Systems The hard disk partitions on your local computer and the remote file systems you use every day are probably set up to automatically mount when you boot Linux. The /etc/fstab file contains definitions for each partition, along with options describing how the partition is mounted. Here s an example of an /etc/fstab file: LABEL=/ / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 /dev/devpts /dev/pts devpts gid=5,mode=620 0 0 /dev/shm /dev/shm tmpfs defaults 0 0 /dev/proc /proc proc defaults 0 0 /dev/sys /sys sysfs defaults 0 0 /dev/hda5 swap swap defaults 0 0 /dev/hdc /media/cdrecorder udf,iso9660 exec,noauto,managed 0 0 /dev/hda1 /mnt/win vfat noauto 0 0 /dev/fd0 /mnt/floppy auto noauto,owner 0 0 All partitions listed in this file are mounted at boot time, except for those set to noauto in the fourth field. In this example, the root (/) and boot (/boot) hard disk partitions are mounted at boot time, along with the /dev/pts, /dev/shm, /dev/sys, /dev/shm, and /proc file systems (which are not associated with particular storage devices). The CD drive (/dev/hdc) and floppy disk (/dev/fd0)
Note: If you are looking for cheap and reliable webhost to host and run your web application check Vision coldfusion web hosting services

Chapter 4 . Learning Basic Administration (Web server type) 159 Table

Sunday, May 6th, 2007

Chapter 4 . Learning Basic Administration 159 Table 4-4 Supported File System Types Type Description adfs Acorn disk file system, which is the standard file system used on RiscOS operating systems. befs File system used by the BeOS operating system. cifs Common Internet File System (CIFS), the virtual file system used to access servers that comply with the SNIA CIFS specification. CIFS is an attempt to refine and standardize the SMB protocol used by Samba and Windows file sharing. ext3 Ext file systems are the most common in Red Hat and many other Linux systems. The ext3 file system, also called the Third Extended file system, includes journaling features that, compared to ext2, improve a file system s capability to recover from crashes. ext2 The default file system type for earlier Linux systems. Features are the same as ext3, except that ext2 doesn t include journaling features. ext This is the first version of ext3. It is not used very often anymore. iso9660 Evolved from the High Sierra file system (the original standard for CD-ROMs). Extensions to the High Sierra standard (called Rock Ridge extensions) allow iso9660 file systems to support long filenames and UNIX-style information (such as file permissions, ownership, and links). Data CD-ROMs typically use this file system type. kafs AFS client file system. Used in distributed computing environments to share files with Linux, Windows, and Macintosh clients. minix Minix file system type, used originally with the Minix version of UNIX. It supports filenames of up to only 30 characters. msdos An MS-DOS file system. You can use this type to mount floppy disks that come from Microsoft operating systems. vfat Microsoft extended FAT (VFAT) file system. umsdos An MS-DOS file system with extensions to allow features that are similar to UNIX (including long filenames). proc Not a real file system, but rather a file system interface to the Linux kernel. You probably won t do anything special to set up a proc file system. However, the /proc mount point should be a proc file system. Many utilities rely on /proc to gain access to Linux kernel information. reiserfs ReiserFS journaled file system. ReiserFS and ext3 are the most common file system types used with Linux today. Continued
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision virtual web hosting services

158 Part II . Running the Show stored. (Web and email hosting)

Sunday, May 6th, 2007

158 Part II . Running the Show 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. Mounting File Systems Most of your hard disks are mounted automatically for you. When you install Fedora, SUSE, and other Linux systems, you are asked to create partitions and indicate the mount points for those partitions. (Other Linux installation procedures will expect you to know that you have to partition before beginning.) When you boot Linux, all Linux partitions residing on hard disk that are listed in your /etc/fstab file are typically mounted. For that reason, this section focuses mostly on how to mount other types of devices so that they become part of your Linux file system. The mount command is used not only to mount devices but also to mount other kinds of file systems on your Linux system. This means that you can store files from other operating systems or use file systems that are appropriate for certain kinds of activities (such as writing large block sizes). The most common use of this feature for the average Linux user, however, is to enable that user to obtain and work with files from floppy disks, CD-ROMs, or other removable media. With the addition of automatic mounting features and changes in how removable media are identified with the Linux 2.6 kernel (see descriptions of Udev and HAL earlier in this chapter), you no longer need to manually mount removable media for many Linux desktop systems. Understanding how to manually mount and unmount file systems on a Linux server, however, can be a very useful skill. Supported File Systems To see file system types that are currently available to be used on your system, type cat /proc/filesystems. Table 4-4 shows the file system types that are supported in Linux, although they may not be in use at the moment or they may not be built into your current kernel (so they may need to be loaded as modules). Note
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision mysql hosting services

Chapter 4 . Learning Basic Administration (Best web hosting) 157 For

Saturday, May 5th, 2007

Chapter 4 . Learning Basic Administration 157 For 2.6 kernels, look in the /media directory; for 2.4 kernels the /mnt 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 later in this chapter.) 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. . 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 enable you to continue working and just fix the one disk that fails. 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. What happens if a remote file system is unmounted from your computer, and you go to save a file in that 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 Tip
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision mysql hosting services

156 Part II . Running the Show This (Web hosting ratings)

Saturday, May 5th, 2007

156 Part II . Running the Show This chapter focuses on partitions that are used for the Linux file system. To see what partitions are currently set up on your hard disk, use the fdisk command: # /sbin/fdisk l Disk /dev/hda: 40.0 GB, 40020664320 bytes 255 heads, 63 sectors/track, 4825 cylinders Units = cylinders of 16065 * 512 bytes = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104 b Win95 FAT32 /dev/hda2 84 89 48195 83 Linux /dev/hda3 90 522 3478072+ 83 Linux /dev/hda4 523 554 257040 5 Extended /dev/hda5 523 554 257008+ 82 Linux swap This output shows the disk partitioning for a computer capable of running both Linux and Microsoft Windows. You can see that the Linux partition on /dev/hda3 has most of the space available for data. There is a Windows partition (/dev/hda1) and a Linux swap partition (/dev/hda5). There is also a small /boot partition (46MB) on /dev/hda2. In this case, the root partition for Linux has 3.3GB of disk space and resides on /dev/hda3. Next use the mount command (with no options) to see what partitions are actually being used for your Linux system (which available disk partitions are actually mounted and where they are mounted): # mount /dev/hda3 on / type ext3 (rw) /dev/hda2 on /boot type ext3 (rw) /dev/hda1 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/hdc 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/hda2, which provides space for the /boot directory (contains data for booting Linux), and /dev/hda3, 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.
Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp web hosting services

Chapter 4 . Learning Basic Administration (Web hosting servers) 155 The

Friday, May 4th, 2007

Chapter 4 . Learning Basic Administration 155 The modprobe command loads modules temporarily they disappear at the next reboot. To permanently add the module to your system, add the modprobe command line to one of the startup scripts run at boot time. An alternative to modprobe is the insmod command. The advantage of using modprobe, however, is that insmod loads only the module you request, whereas modprobe tries to load other modules that the one you requested is dependent on. Removing Modules Use the rmmod command to remove a module from a running kernel. For example, to remove the module parport_pc from the current kernel, type the following: # rmmod parport_pc If it is not currently busy, the parport_pc module is removed from the running kernel. If it is busy, try killing any process that might be using the device. Then run rmmod again. Managing File Systems and Disk Space File systems in Linux are organized in a hierarchy, beginning from root (/) and continuing downward in a structure of directories and subdirectories. As an administrator of a Linux system, it s your duty to make sure that all the disk drives that represent your file system are available to the users of the computer. It is also your job to make sure there is enough disk space in the right places in the file system for users to store what they need. File systems are organized differently in Linux than they are in Microsoft Windows operating systems. Instead of drive letters (for example, A:, B:, C:) for each local disk, network file system, CD-ROM, or other type of storage medium, everything fits neatly into the directory structure. It is up to an administrator to create a mount point in the file system and then connect the disk to that point. The organization of your file system begins when you install Linux. Part of the installation process is to divide your hard disk (or disks) into partitions. Those partitions can then be assigned to: . A part of the Linux file system . Swap space for Linux, or . Other file system types (perhaps containing other bootable operating systems) . Free space (you can leave space unassigned so you can format it later as you need it). Note
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision php5 hosting services