简体   繁体   English

如何通过 /etc/fstab 为 Centos 7 设置 static 安装

[英]How do I setup static mount via /etc/fstab for Centos 7

I am mounting a storj node on my centos 7 server.我在我的 centos 7 服务器上安装了一个 storj 节点。 In one of the steps it asks me that you must static mount via / etc / fstab.在其中一个步骤中,它要求我必须通过 /etc/fstab 安装 static。 Listening to the documentation.听文档。

First, run the following command and find the name of the hard drive you wish to use (for example sda2)首先,运行以下命令并找到您要使用的硬盘驱动器的名称(例如 sda2)

lsblk
NAME MAJ: MIN RM SIZE RO TYPE MOUNTPOINT
sda 8: 0 0 1,8T 0 disk
sda1 8: 1 0 9.8G 0 part /
sda2 8: 2 0 511M 0 part [SWAP]
sda3 8: 3 0 1,8T 0 part / home

Once you find it, we will now get the Unique ID (UUID) of the hard drive一旦你找到它,我们现在将获得硬盘的唯一 ID (UUID)

lsblk -d -fs / dev / <location (example: sda2)>

Copy the UUID, as well as the FSTYPE.复制 UUID 以及 FSTYPE。 We'll need that later.我们稍后会需要它。

Here I do not know how to continue I do not know how to use that command with the data obtained in the first这里我不知道怎么继续我不知道怎么用那个命令和第一次得到的数据一起使用

You only need to add following data to /etc/fstab:您只需将以下数据添加到/etc/fstab:

UUID="xxx"  "my_mount_directory" "fstype" defaults 0 0

after creating the directory "my_mount_directory".创建目录“my_mount_directory”后。

For example for a ext4 file system that needs to be available in /mnt/myfs例如对于需要在 /mnt/myfs 中可用的 ext4 文件系统

$ mkdir /mnt/myfs

Add in /etc/fstab:在 /etc/fstab 中添加:

 UUID="3b9668a3-17df-4e1e-99c2-5dcb0fd46778"    /mnt/myfs ext4 defaults 0 0

And run:并运行:

$ mount /mnt/myfs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM