Linux System Administration - X


Add to my manuals
368 Pages

advertisement

Linux System Administration - X | Manualzz

Chapter 7. mounting

Once you've put a file system on a partition, you can mount it. Mounting a file system makes it available for use, usually as a directory. We say mounting a file system instead of mounting a partition because we will see later that we can also mount file systems that do not exists on partitions.

On all Unix systems, every file and every directory is part of one big file tree. To access a file, you need to know the full path starting from the root directory. When adding a file

system to your computer, you need to make it available somewhere in the file tree. The directory where you make a file system available is called a mount point.

64

mounting

7.1. mounting local file systems

7.1.1. mkdir

This example shows how to create a new mount point with mkdir.

root@RHELv4u2:~# mkdir /home/project42

7.1.2. mount

When the mount point is created, and a file system is present on the partition, then mount can mount the file system on the mount point directory.

root@RHELv4u2:~# mount -t ext2 /dev/sdb1 /home/project42/

Once mounted, the new file system is accessible to users.

7.1.3. /etc/filesystems

Actually the explicit -t ext2 option to set the file system is not always necessary. The mount command is able to automatically detect a lot of file systems.

When mounting a file system without specifying explicitly the file system, then mount will first probe /etc/filesystems. Mount will skip lines with the nodev directive.

paul@RHELv4u4:~$ cat /etc/filesystems ext3 ext2 nodev proc nodev devpts iso9660 vfat hfs

7.1.4. /proc/filesystems

When /etc/filesystems does not exist, or ends with a single * on the last line, then mount will read /proc/filesystems.

[root@RHEL52 ~]# cat /proc/filesystems | grep -v ^nodev

ext2

iso9660

ext3

7.1.5. umount

You can unmount a mounted file system using the umount command.

root@pasha:~# umount /home/reet

65

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

advertisement

Table of contents