To mount other partitions at startup modify the "/etc/fstab" file. Each line in the file refers to a different filesystem. Fields are separated by whitespace. The primary filesystems must be mounted first, so they must be in correct order. Your native partition for the system you are running should be listed first. The fields are as follows:
- The name of the device such as "/dev/hda1"
- The mount point. Use "/" for root. Other typical mount points are "/dos" for DOS, "swap" or "none" for the swap partition, and "/mnt/floppy" for "/dev/fd0" (the floppy drive).
- The type of filesystem. They are: mini, ext, ext2(linux native), xiafs, msdos, hpfs, ntfs, fat32, iso9660(CD-ROM), nfs, swap (for swap space).
- The mount options for use with the filesystem. Each filesystem type has different mount options. Read the mount man page to see possible options. ro= read only, user- allows normal users to mount the device.
- The frequency the filesystem needs to be dumped (backed up) by the dump command. For ext2, normally make it 1, for others make it 0. 0 or nothing means it is not dumped. If 1, it is backed up during a system backup.
- A number telling the order in which the filesystems should be checked at reboot time by the fsck program. Your root should be 1, others are in ascending order or 0 to not be checked.
To determine your hard drive's partitions and see what each partition holds which operating system, you may use the fdisk program. Just make sure you don't change your disk information. You can use the 'p' command to see a list of current partitions, then you can add them to your fstab file. Note: In order for the mount to succeed, you must have created the mount point subdirectory (except for root).
I like to install multiple copies of Linux on one computer for three reasons.
- The second copy can serve as a backup to the first. If I totally screw up one copy of Linux, by changing kernels, etc, I can still get to the filesystem from the other system and straighten out my problems.
- I can learn about other linux packages.
- If a compile of a package fails on one system such as Redhat, I can try it on another system such as Slackware and it will probably work.
The fstab file
A typical /etc/fstab file:
/dev/hda2 | / | ext2 | defaults | 1 1 |
/dev/hdb1 | /data | auto | defaults | 0 0 |
/dev/hda1 | /dos | vfat | defaults | 0 0 |
/dev/hda3 | /slackw | ext2 | defaults | 0 0 |
/dev/hda4 | swap | swap | defaults | 0 0 |
/dev/cdrom | /mnt/cdrom | iso9660 | noauto,owner,ro | 0 0 |
/dev/fd0 | /mnt/floppy | ext2 | noauto,owner | 0 0 |
none | /proc | proc | defaults | 0 0 |
none | /dev/pts | devpts | gid=5,mode=620 | 0 0 |
These are the options:
- defaults - Use the default options of rw, suid, dev,exec,auto, nouser, and async.
- auto - Auto detect the type of filesystem.
- noauto - The -a option will not mount the filesystem.
- owner
- ro - Read only
- rw - Read and write allowed
- user - Users have permission to mount this filesystem
- users - Allows a user to mount and another user to unmount the filesystem
The /proc directory is required for tracking processes in memory (RAM). The directories /data, /dos, and /slackw in this example must exist or their mounts will fail. The entries for the floppy and cdrom allow them to be automatically dismounted if they are mounted during shutdown. The option, "noauto" in their entries, keeps these devices from being mounted at startup.
Note:
If you install an OS that wipes LILO, you can use the fdisk utility to toggle the bootable flag (change the boot partition). This can help, if the OS that wiped LILO can toggle this partition to a Linux filesystem.
0 comments:
Post a Comment