Linux磁盘如何挂载

linux下mnt目录的作用:
mount  英文解释: 登上; 爬上; 攀登; 骑上; 乘上; 跨上  可直接理解为“挂载”
挂接光驱、USB设备的目录,加载后,会在mnt里多出相应设备的目录。mnt是mount的缩写。

[root@lxglinux ~]# fdisk -l /dev/sdb


Disk /dev/sdb: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x6003c314


   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1         262     2104483+  83  Linux

/dev/sdb2             263         916     5253255    5  Extended

/dev/sdb5             263         524     2104483+  83  Linux


[root@lxglinux ~]# mount /dev/sdb5 /mnt/  mount命令:挂载分区到指定挂载点/mnt/是挂载点

[root@lxglinux ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda3        18G  2.5G   15G  15% /

tmpfs           504M     0  504M   0% /dev/shm

/dev/sda1        97M   26M   67M  29% /boot

/dev/sdb5       2.0G   68M  1.9G   4% /mnt

[root@lxglinux ~]#


[root@lxglinux ~]# df -T   可以查看文件类型

Filesystem     Type  1K-blocks    Used Available Use% Mounted on

/dev/sda3      ext4   18475900 2600320  14937036  15% /

tmpfs          tmpfs    515228       0    515228   0% /dev/shm

/dev/sda1      ext4      99150   26438     67592  29% /boot

/dev/sdb5      ext4    2071384   68632   1897528   4% /mnt

[root@lxglinux ~]# mount /dev/sdb1 /home/ 将sdb1挂载到/home/下

[root@lxglinux ~]# ls /home/

lost+found

[root@lxglinux ~]# df -h 查看硬盘占用情况等信息

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda3        18G  2.5G   15G  15% /

tmpfs           504M     0  504M   0% /dev/shm

/dev/sda1        97M   26M   67M  29% /boot

/dev/sdb5       2.0G   68M  1.9G   4% /mnt

/dev/sdb1       2.0G   74M  1.9G   4% /home可以看到挂在上了

[root@lxglinux ~]# unmount /home/卸载

-bash: unmount: command not found

[root@lxglinux ~]# umount /home/

[root@lxglinux ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda3        18G  2.5G   15G  15% /

tmpfs           504M     0  504M   0% /dev/shm

/dev/sda1        97M   26M   67M  29% /boot

/dev/sdb5       2.0G   68M  1.9G   4% /mnt卸载掉了

====================================================================

[root@lxglinux ~]# mount LABLE=lxg /home/lxg/123/用LABLE方式挂载

mount: you must specify the filesystem type

[root@lxglinux ~]# mount LABEL=lxg /home/lxg/123/

[root@lxglinux ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda3        18G  2.5G   15G  15% /

tmpfs           504M     0  504M   0% /dev/shm

/dev/sda1        97M   26M   67M  29% /boot

/dev/sdb5       2.0G   68M  1.9G   4% /mnt

/dev/sdb1       2.0G   74M  1.9G   4% /home/lxg/123

[root@lxglinux ~]#

[root@lxglinux ~]# cd /mnt/

[root@lxglinux mnt]# ls

lost+found

[root@lxglinux mnt]# touch 123在/mnt/下创建123

[root@lxglinux mnt]# umount /mnt/卸载/mnt/

umount: /mnt: device is busy.显示繁忙无法卸载

        (In some cases useful info about processes that use

         the device is found by lsof(8) or fuser(1))

[root@lxglinux mnt]# umount -l /dev/sdb1         -l 选项懒惰卸载

[root@lxglinux mnt]# df h

df: "h": 没有那个文件或目录

df: 未处理文件系统

[root@lxglinux mnt]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda3        18G  2.5G   15G  15% /

tmpfs           504M     0  504M   0% /dev/shm

/dev/sda1        97M   26M   67M  29% /boot

/dev/sdb5       2.0G   68M  1.9G   4% /mnt

[root@lxglinux mnt]# umount /dev/sdb5卸载sdb5

umount: /mnt: device is busy.

        (In some cases useful info about processes that use

         the device is found by lsof(8) or fuser(1))

[root@lxglinux mnt]# umount -l  /dev/sdb5卸载sdb5

[root@lxglinux mnt]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda3        18G  2.5G   15G  15% /

tmpfs           504M     0  504M   0% /dev/shm

/dev/sda1        97M   26M   67M  29% /boot

[root@lxglinux mnt]#


你可能感兴趣的:(linux,centos,挂载)