Linux umount 命令 - 解除安裝掛在 Linux 目錄中的檔案系統
阿新 • • 發佈:2018-11-09
Linux umount 命令 - 解除安裝掛在 Linux 目錄中的檔案系統
Linux umount 命令用於解除安裝檔案系統,解除安裝掛在 Linux 目錄中的檔案系統。
[email protected]:~$ 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
[email protected]:~$
[email protected]:~$ 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
[email protected]:~$
[email protected]:~$ 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
[email protected]:~$
[email protected]:~$ 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/
[email protected]:~$
[email protected]:~$ cd /media/
[email protected]:/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/
[email protected]:/media$
[email protected]:/media$ mkdir datafile
mkdir: 無法建立目錄"datafile": 許可權不夠
[email protected]:/media$ sudo mkdir datafile
[sudo] forever 的密碼:
[email protected]:/media$
[email protected]:/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/
[email protected]:/media$ sudo chmod -R 777 datafile/
[email protected]:/media$
[email protected]:/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/
[email protected]:/media$ cd ..
[email protected]:/$
[email protected]:/$ cd ~
[email protected]:~$
[email protected]:~$ sudo umount /media/forever/2ccdbeae-26e9-4ccb-b718-28ae1a58d067
[email protected]:~$
[email protected]:~$ ll /media/forever/
總用量 8
drwxrwxrwx+ 2 root root 4096 Oct 17 09:24 ./
drwxr-xr-x 4 root root 4096 Oct 17 09:22 ../
[email protected]:~$
[email protected]:~$ 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
[email protected]:~$
[email protected]:~$ 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
[email protected]:~$