LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: dammmm

文件路径问题

[复制链接]
发表于 2008-10-29 09:23:03 | 显示全部楼层
This should give you enough clue.
[PHP]d00m3d@BlackMesa:~$ su -
Password:
root@BlackMesa:~# ls /mnt/test
root@BlackMesa:~# mount /dev/sdb7 /mnt/test
root@BlackMesa:~# ls /mnt/test
BkUP-hda1   dvd               fstab.sda6        menu.lst.sda2        root  var
bin         eagletec.img      home              mnt                  sbin
boot        etc               initrd            none                 sys
cdrom       floppy            lib               opt                  tmp
dev         fstab.sda2        lost+found        proc                 usr
root@BlackMesa:~# umount /mnt/test
root@BlackMesa:~# ls /mnt/test
root@BlackMesa:~# cp /boot/config-2.6.27.3 /mnt/test
root@BlackMesa:~# mkdir /mnt/test/TEST
root@BlackMesa:~# ls /mnt/test -l
total 68
drwxr-xr-x 2 root root  4096 Oct 29 10:58 TEST
-rw-r--r-- 1 root root 57463 Oct 29 10:58 config-2.6.27.3
root@BlackMesa:~#
root@BlackMesa:~# mount /dev/sdb7 /mnt/test
root@BlackMesa:~# ls /mnt/test
BkUP-hda1   dvd               fstab.sda6        menu.lst.sda2        root  var
bin         eagletec.img      home              mnt                  sbin
boot        etc               initrd            none                 sys
cdrom       floppy            lib               opt                  tmp
dev         fstab.sda2        lost+found        proc                 usr
root@BlackMesa:~# mount
/dev/sda6 on / type ext3 (rw,errors=remount-ro)
/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
usbfs on /proc/bus/usb type usbfs (rw,devmode=0666)
/dev/sda5 on /media/sda5 type ext3 (rw,nosuid)
devpts on /dev/pts type devpts (rw,gid=4,mode=620)
shm on /dev/shm type tmpfs (rw)
/dev/sdb7 on /mnt/test type ext3 (rw)
root@BlackMesa:~# umount /mnt/test
root@BlackMesa:~# ls /mnt/test -l
total 68
drwxr-xr-x 2 root root  4096 Oct 29 10:58 TEST
-rw-r--r-- 1 root root 57463 Oct 29 10:58 config-2.6.27.3
root@BlackMesa:~#[/PHP]
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-2 18:05:50 | 显示全部楼层
基本明白了
总结一下:
目录非空也可以mount
如果非空,mount 后 原目录中的内容被屏闭(暂时无法访问),该目录中显示的是mount指向的分区中的内容
如果想查看原来目录中的内容,umount后就行了

谢谢doom3d
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表