Mount the partition manually

As we mentioned earlier, the file systems in Linux are all tree structures. All file systems are combined
to form a large directory tree. The "root" of this directory tree is the root directory "/". The root partition
is automatically mounted on the root directory at boot time. The file system we created must also be mounted on this directory
tree before it can be used by us. The mount point must be a directory, and this directory is the entry for accessing the file system
.
So we have to mount the partition we just formatted into the directory tree, we first mount
the first partition /dev/sdb1.
[root @localhost ~]# mkdir /Log #Our mount point
[root @localhost ~]# mount -t ext4 /dev/sdb1 /Log
# -t indicates the type of the mounted partition file system, /dev/sdb1 indicates Mounted partition name, /Log indicates the mount point
[root @localhost ~]# mount
/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sdb1 on /Log type ext4 (rw)
# Use the mount command without parameters to view the currently mounted device, mainly the device name, device mount point and
device# access attributes
[root @ localhost ~]# df
filesystem 1K-blocks used free used % mount point
/dev/sda2 18577148 3451884 14181600 20% /
tmpfs 1026952 88 1026864 1% /dev/shm
/dev/sdb1 103216920 192116 9778152 1%
umpo# device mount point
[root @localhost ~]# umount /dev/sdb1
[root@localhost ~]# df
file system 1K-block used free used % mount point
/dev/sda2 18577148 3451884 14181600 20% /
tmpfs 1026952 88 1026864 1% /dev/shm
# You can unmount a device with the umount command

Notice
 Try to mount the partition on an empty directory
 Do not mount the partition repeatedly
 
Order


[root@localhost ~]# mkdir /Project
[root@localhost ~]# mkdir /Project/pb
[root@localhost ~]# mkdir /Project/pa
[root@localhost ~]# mkdir /Backup
Usage: mount [option] partition/device name mount directory
mount file system
 -t: very similar to the option of mkfs, you can add the file system type to specify
the type to be mounted. Common Linux supported types are: ext2 , ext3, ext4, vfat,
reiserfs, iso9660 (CD format), nfs, cifs, smbfs (these three are network file system
types).
 -L : In addition to using the device name (eg /dev/hdc6), the
system can also use the label (Label) of the file system to mount.
 -l : Simply typing mount will display information about the current mount. Add -l to list
the labels of the currently mounted devices
 -a : According to the configuration file /etc/fstab, mount all the unmounted devices
 -o : You can add some additional mounts later parameters, such as read and write permissions, etc.:

Extra arguments followed by the -o option
significance
ro, rw Mount the filesystem as read-only (ro) or rewritable (rw)
async, sync Whether this file system uses the synchronous write (sync) or asynchronous
(async) memory mechanism, please refer to the file system operation
mode. Default is async.
auto, noauto Allow this partition to be mounted automatically by mount -a (auto)
dev, nodev Whether to allow device files to be created on this partition, dev is
allowable
suid, nosuid Are file formats with suid/sgid allowed for this partition
?
exec, noexec
Whether to allow this partition to have runnable binary executables
user, nouser Whether to allow ordinary users to mount this partition, generally, only
root can mount
this partition for ordinary users.
defaults Defaults are: rw, suid, dev, exec, auto, nouser,
and async
remount remount
 
Order

用法: df [选项]
显示所有文件系统 i 节点和磁盘块的使用情况。
 -a 显示所有挂载的文件系统的磁盘使用情况(包括虚拟的不占用硬
盘空间的文件系统,如/proc 文件系统)。
 -k 以 k 字节为单位显示。
 -i 显示 inode 信息,而不是块。
 -t 显示各指定类型的文件系统的磁盘空间使用情况。
 -x 列出不是某一指定类型文件系统的磁盘空间使用情况(与 t 选项
相反)。
 -T 显示文件系统类型
 
命令
用法: umount [选项] 分区/设备名|挂载目录
卸载文件系统
 -f 强制卸载

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325517076&siteId=291194637