Linux umount 命令 - 卸载挂在 Linux 目录中的文件系统

版权声明:世上没有白读的书,每一页都算数。 https://blog.csdn.net/chengyq116/article/details/83106423

Linux umount 命令 - 卸载挂在 Linux 目录中的文件系统

Linux umount 命令用于卸载文件系统,卸载挂在 Linux 目录中的文件系统。

strong@foreverstrong:~$ ssh [email protected]
[email protected]'s password: 
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.13.0-36-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

37 packages can be updated.
29 updates are security updates.

Last login: Tue Oct 16 09:30:50 2018 from 127.0.0.1
forever@forever-sys:~$ 
forever@forever-sys:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=8c9d1b74-84ba-4766-9a32-71e51e6433b0 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=b6fee3cb-7544-40ea-9009-e8450140c2fe none            swap    sw              0       0
forever@forever-sys:~$ 
forever@forever-sys:~$ df -h
文件系统        容量  已用  可用 已用% 挂载点
udev             32G     0   32G    0% /dev
tmpfs           6.3G   11M  6.3G    1% /run
/dev/sdb1       188G   12G  167G    7% /
tmpfs            32G  456K   32G    1% /dev/shm
tmpfs           5.0M  4.0K  5.0M    1% /run/lock
tmpfs            32G     0   32G    0% /sys/fs/cgroup
tmpfs           6.3G   48K  6.3G    1% /run/user/1001
tmpfs           6.3G   56K  6.3G    1% /run/user/1000
/dev/sda1       1.8T   68M  1.7T    1% /media/forever/2ccdbeae-26e9-4ccb-b718-28ae1a58d067
forever@forever-sys:~$ 
forever@forever-sys:~$ ll /media/forever/
总用量 12
drwxrwxrwx+ 3 root root 4096 Oct 17 09:08 ./
drwxr-xr-x  3 root root 4096 Oct 14 01:28 ../
drwxrwxrwx  3 root root 4096 Oct 15 20:23 2ccdbeae-26e9-4ccb-b718-28ae1a58d067/
forever@forever-sys:~$ 
forever@forever-sys:~$ cd /media/
forever@forever-sys:/media$ ll
总用量 12
drwxr-xr-x   3 root root 4096 Oct 14 01:28 ./
drwxr-xr-x  24 root root 4096 Oct 14 01:21 ../
drwxrwxrwx+  3 root root 4096 Oct 17 09:08 forever/
forever@forever-sys:/media$ 
forever@forever-sys:/media$ mkdir datafile
mkdir: 无法创建目录"datafile": 权限不够
forever@forever-sys:/media$ sudo mkdir datafile
[sudo] forever 的密码: 
forever@forever-sys:/media$ 
forever@forever-sys:/media$ ll
总用量 16
drwxr-xr-x   4 root root 4096 Oct 17 09:22 ./
drwxr-xr-x  24 root root 4096 Oct 14 01:21 ../
drwxr-xr-x   2 root root 4096 Oct 17 09:22 datafile/
drwxrwxrwx+  3 root root 4096 Oct 17 09:08 forever/
forever@forever-sys:/media$ sudo chmod -R 777 datafile/
forever@forever-sys:/media$ 
forever@forever-sys:/media$ ll
总用量 16
drwxr-xr-x   4 root root 4096 Oct 17 09:22 ./
drwxr-xr-x  24 root root 4096 Oct 14 01:21 ../
drwxrwxrwx   2 root root 4096 Oct 17 09:22 datafile/
drwxrwxrwx+  3 root root 4096 Oct 17 09:08 forever/
forever@forever-sys:/media$ cd ..
forever@forever-sys:/$ 
forever@forever-sys:/$ cd ~
forever@forever-sys:~$ 
forever@forever-sys:~$ sudo umount /media/forever/2ccdbeae-26e9-4ccb-b718-28ae1a58d067 
forever@forever-sys:~$ 
forever@forever-sys:~$ ll /media/forever/
总用量 8
drwxrwxrwx+ 2 root root 4096 Oct 17 09:24 ./
drwxr-xr-x  4 root root 4096 Oct 17 09:22 ../
forever@forever-sys:~$ 
forever@forever-sys:~$ sudo fdisk -l
Disk /dev/sdb: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x490d7c9c

设备       启动     Start    末尾    扇区   Size Id 类型
/dev/sdb1  *         2048 399708159 399706112 190.6G 83 Linux
/dev/sdb2       399710206 500117503 100407298  47.9G  5 扩展
/dev/sdb5       399710208 500117503 100407296  47.9G 82 Linux 交换 / Solaris
forever@forever-sys:~$ 
forever@forever-sys:~$ df -h
文件系统        容量  已用  可用 已用% 挂载点
udev             32G     0   32G    0% /dev
tmpfs           6.3G   11M  6.3G    1% /run
/dev/sdb1       188G   12G  167G    7% /
tmpfs            32G  456K   32G    1% /dev/shm
tmpfs           5.0M  4.0K  5.0M    1% /run/lock
tmpfs            32G     0   32G    0% /sys/fs/cgroup
tmpfs           6.3G   48K  6.3G    1% /run/user/1001
tmpfs           6.3G   56K  6.3G    1% /run/user/1000
forever@forever-sys:~$ 

猜你喜欢

转载自blog.csdn.net/chengyq116/article/details/83106423