【问题标题】:How to install mke2fs on centos?如何在centos上安装mke2fs?
【发布时间】:2017-08-12 12:14:58
【问题描述】:
我已经尝试过 virtual box 和 docker 来安装 centos,最新版本,都没有“mke2fs”命令。然后我尝试使用 root 并输入:
yum install mke2fs*
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
……
没有可用的软件包 mke2fs*。
这是为什么?它是否在 mke2fs 以外的另一个包名中?
【问题讨论】:
标签:
centos
installation
yum
【解决方案1】:
您可以使用yum provides。
Provides=查找提供给定值的包
$ yum provides mke2fs
e2fsprogs-1.42.9-9.el7.x86_64 : Utilities for managing ext2, ext3, and ext4 filesystems
Repo : base
Matched from:
Filename : /usr/sbin/mke2fs
所以我安装了 e2fsprogs(我是在 docker 中完成的):
FROM centos:7
RUN yum -y update && \
yum -y install e2fsprogs
构建它并启动我的容器:
$ docker run -it my-centos bash
[root@1ef2a7d930cf /]# mke2fs
Usage: mke2fs [-c|-l filename] [-b block-size] [-C cluster-size]
[-i bytes-per-inode] [-I inode-size] [-J journal-options]
[-G flex-group-size] [-N number-of-inodes]
[-m reserved-blocks-percentage] [-o creator-os]
[-g blocks-per-group] [-L volume-label] [-M last-mounted-directory]
[-O feature[,...]] [-r fs-revision] [-E extended-option[,...]]
[-t fs-type] [-T usage-type ] [-U UUID] [-jnqvDFKSV] device [blocks-count]