歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> 學習Linux

linux mount 硬盤掛載和卸載,mount掛載

linux mount 硬盤掛載和卸載,mount掛載

linux mount 硬盤掛載和卸載,mount掛載


Linux 掛載

[root@whp6 ~]# mount /dev/sdb5 /mnt/
[root@whp6 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        16G  2.1G   13G  14% /
tmpfs           931M     0  931M   0% /dev/shm
/dev/sda1       194M   28M  157M  16% /boot
/dev/sdb5       2.0G   68M  1.9G   4% /mnt
[root@whp6 ~]# df -T
Filesystem     Type  1K-blocks    Used Available Use% Mounted on
/dev/sda3      ext4   16311208 2134352  13348288  14% /
tmpfs          tmpfs    953276       0    953276   0% /dev/shm
/dev/sda1      ext4     198337   28320    159777  16% /boot
/dev/sdb5      ext4    2071384   68632   1897528   4% /mnt
[root@whp6 ~]#

備注:如果掛載到有文件的目錄下 會遮擋原先文件 必須卸載掛載的硬盤 才能顯示

[root@whp6 ~]# ls /home/
1.txt  2  22  wanghaipeng  whp
[root@whp6 ~]# mount /dev/sdb1 /home/
[root@whp6 ~]# ls /home
lost+found
[root@whp6 ~]# umount /home
[root@whp6 ~]# ls /home
1.txt  2  22  wanghaipeng  whp
[root@whp6 ~]#

Linux umount  卸載

[root@whp6 /]# mount LABEL=wanghaipeng /home/whp/
[root@whp6 /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        16G  2.1G   13G  14% /
tmpfs           931M     0  931M   0% /dev/shm
/dev/sda1       194M   28M  157M  16% /boot
/dev/sdb5       2.0G   68M  1.9G   4% /mnt
/dev/sdb1       2.0G   74M  1.9G   4% /home/whp
[root@whp6 /]# umount -l /home/whp/
[root@whp6 /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        16G  2.1G   13G  14% /
tmpfs           931M     0  931M   0% /dev/shm
/dev/sda1       194M   28M  157M  16% /boot
/dev/sdb5       2.0G   68M  1.9G   4% /mnt
[root@whp6 /]#

 

http://xxxxxx/Linuxjc/1170160.html TechArticle

Copyright © Linux教程網 All Rights Reserved