显示现已挂载的文件系统,挂装和卸载文件系统

[root@FQDN ~]# df –h    //显示已挂载的文件系统:df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   17G  3.8G   14G  23% /
devtmpfs                 473M     0  473M   0% /dev
tmpfs                    489M     0  489M   0% /dev/shm
tmpfs                    489M  7.3M  481M   2% /run
tmpfs                    489M     0  489M   0% /sys/fs/cgroup
/dev/sda1               1014M  199M  816M  20% /boot
tmpfs                     98M  4.0K   98M   1% /run/user/42
tmpfs                     98M   20K   98M   1% /run/user/1000
/dev/sr0                 4.3G  4.3G     0 100% /run/media/heshuilong/CentOS 7 x86_64
tmpfs                     98M     0   98M   0% /run/user/0
[root@FQDN ~]# mkdir /he 
[root@FQDN ~]# mount -t ext4 /dev/sdb5  /he
mount: wrong fs type, bad option, bad superblock on /dev/sdb5,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail or so.
[root@FQDN ~]# mkfs.ext4 /dev/sdb5  //创建ext4的文件系统:mkdir +<文件>
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux	
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 
[root@FQDN ~]# mount -t ext4 /dev/sdb5  /he  //挂载文件系统:mount –t+<文件系统>+<设备名>+ <挂载点>
[root@FQDN ~]# df -h /he
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb5       4.8G   20M  4.6G   1% /he
[root@FQDN ~]# du /he  //显示指定文件的文件系统du (-h)+<文件名>
16	/he/lost+found
20	/he
[root@FQDN ~]# du -h /he
16K	/he/lost+found
20K	/he
[root@FQDN ~]# umount /he //卸载文件系统:umount+<文件名>
[root@FQDN ~]# du -h /he
0	/he

你可能感兴趣的:(Linux学习)