- 论坛徽章:
- 0
|
199上一道题,帮忙分析一下
Mounting a file system over an existing file system
If a file system is mounted over a directory (called a mount point) held in another
file system, beneath the mount point hierarchy in the mounted-over file system,
the original file system data is hidden by the newly mounted file system. The
originally mounted file system’s data will be unavailable for use.
An example of where you would over mount is in a development environment
where you are working with different levels of the same code and do not wish to
change your make files. In the next example, there are two logical volumes,
lvol01 and lvol02. The file system on lvol01 is mounted on /filesys01, and the file
system on lvol02 is not yet mounted:
# mount
node mounted mounted over vfs date options
-------- --------------- --------------- ------ ------------ ------------
/dev/hd4 / jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd2 /usr jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd9var /var jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd3 /tmp jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd1 /home jfs Jun 11 16:42 rw,log=/dev/hd8
/dev/lv00 /usr/welcome_arcade jfs Jun 11 16:42
rw,log=/dev/hd8
/dev/lv01 /usr/welcome jfs Jun 11 16:42 rw,log=/dev/hd8
/dev/lvol01 /filsys01 jfs Jun 14 13:31
rw,log=/dev/loglv00
If a listing of the mounted file system filsys01 is done, the directory containing
data fs1dir is displayed:
# ls -l filsys01
total 16
drwxr-sr-x 20 root sys 2560 Jun 14 13:32 fs1dir
drwxrwx--- 2 root system 512 Jun 14 13:28 lost+found
Chapter 5. Disks and file systems 113
If the file system on logical volume lvol02 is now mounted over the same mount
point as that of lvol01:
# mount /dev/lvol02 /filsys01
When checked it can be noted that both file systems are still shown as being
mounted:
# mount
node mounted mounted over vfs date options
-------- --------------- --------------- ------ ------------ ------------
/dev/hd4 / jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd2 /usr jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd9var /var jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd3 /tmp jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd1 /home jfs Jun 11 16:42 rw,log=/dev/hd8
/dev/lv00 /usr/welcome_arcade jfs Jun 11 16:42
rw,log=/dev/hd8
/dev/lv01 /usr/welcome jfs Jun 11 16:42 rw,log=/dev/hd8
/dev/lvol01 /filsys01 jfs Jun 14 13:31
rw,log=/dev/loglv00
/dev/lvol02 /filsys01 jfs Jun 14 13:44
rw,log=/dev/loglv01
If a listing of the mounted file system filsys01 is done, the directory containing
data fs2dir is displayed:
# ls -l /filsys01
total 32
drwxr-sr-x 5 root sys 9728 Jun 14 13:37 fs2dir
drwxrwx--- 2 root system 512 Jun 14 13:28 lost+found
The way to fix this is to unmount the logical volume lvol02 and then mount it on a
new mount point:
# umount /dev/lvol02
Once unmounted, the data on lvol01 will be available again, as it was not
overwritten:
# mount
node mounted mounted over vfs date options
-------- --------------- --------------- ------ ------------ ------------
/dev/hd4 / jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd2 /usr jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd9var /var jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd3 /tmp jfs Jun 11 16:41 rw,log=/dev/hd8
/dev/hd1 /home jfs Jun 11 16:42 rw,log=/dev/hd8
/dev/lv00 /usr/welcome_arcade jfs Jun 11 16:42
rw,log=/dev/hd8
/dev/lv01 /usr/welcome jfs Jun 11 16:42 rw,log=/dev/hd8
/dev/lvol01 /filsys01 jfs Jun 14 13:31
rw,log=/dev/loglv00
# ls -l /filsys01
total 16
drwxr-sr-x 20 root sys 2560 Jun 14 13:32 fs1dir
drwxrwx--- 2 root system 512 Jun 14 13:28 lost+found
ok?understand? |
|