mount 設(shè)備目錄 掛載點 掛載文件系統(tǒng)
Linux系統(tǒng)下,所有設(shè)備必須掛載后才能使用;
掛載相當(dāng)于給一個孤立存在的設(shè)備設(shè)置一個接入口linux常用命令,所有用戶都需要通過該接口訪問該設(shè)備
這個接口稱之為掛載點
[root@aspen ~]# ls /dev/cdrom/
ls: cannot access /dev/cdrom/: Not a directory
[root@aspen ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
[root@aspen ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 18G 1.9G 16G 11% /
devtmpfs 476M 0 476M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 7.6M 479M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/sda1 1014M 127M 888M 13% /boot
tmpfs 98M 0 98M 0% /run/user/0
/dev/sr0 4.3G 4.3G 0 100% /mnt
[root@aspen ~]# ls /mnt/
CentOS_BuildTag EULA images LiveOS repodata RPM-GPG-KEY-CentOS-Testing-7
EFI GPL isolinux Packages RPM-GPG-KEY-CentOS-7 TRANS.TBL
umount 卸載已掛載的文件系統(tǒng)
[root@aspen ~]# umount /mnt/
[root@aspen ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 18G 1.9G 16G 11% /
devtmpfs 476M 0 476M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 7.6M 479M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/sda1 1014M 127M 888M 13% /boot
tmpfs 98M 0 98M 0% /run/user/0
fdisk 磁盤名 MBR分區(qū)表磁盤分區(qū)命令(僅支持2TB以下的磁盤分區(qū))
操作選項
p 顯示磁盤分區(qū)信息
n 創(chuàng)建磁盤分區(qū)
d 刪除磁盤分區(qū)
w 保存分區(qū)并退出命令
m 查看所有操作選項
parted 磁盤名 GPT分區(qū)表磁盤分區(qū)命令(常用于2TB以上的磁盤分區(qū))
[root@aspen ~]# fdisk -l
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 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
Disk label type: dos
Disk identifier: 0x000c45ea
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 411647 204800 83 Linux
/dev/sda2 411648 2508799 1048576 82 Linux swap / Solaris
/dev/sda3 2508800 209715199 103603200 83 Linux
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 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
[root@aspen ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x28e66d85.
Command (m for help): p
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 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
Disk label type: dos
Disk identifier: 0x28e66d85
上一個教程:linux中怎么用命令打開文本文件?
下一個教程:Linux命令速查手冊PDF高清非掃描中文完整版