2

I am trying to create Logical Volume on CentOS 7 on EC2 instance. After attaching the volume I am creating partition using fdisk, then I am starting the Logical Volume creation:

pvcreate /dev/xvda1
vgcreate vgname /dev/xvda1
lvcreate -L 68G vgname -n lvname

After this implementation I am trying to format the Logical Volume as ext4 but when I run mkfs -t ext4 /dev/mapper/vgname-lvname I am receiving the following error:

mkfs.ext4: No such file or directory

Do you have any ideas what is going on?

  • Does which mke2fs return anything? If so, you're probably missing a symlink to mkfs.ext4. – muru Jan 27 '15 at 15:08
  • @muru The more weird thing is that mke2fs is even not available on the system. – ibedelovski Jan 27 '15 at 15:13
  • 1
    Apparently you're missing the e2fsprogs package? – wurtel Jan 27 '15 at 15:31
2

You probably need to install e4fsprogs CentOS package before you want to create an ext4 filesystem.

In general, mkfs is just a front-end for a series of mkfs.* binaries.

See the following example:

root@locutus:/home/asd# strace -f -e trace=execve mkfs -t asdasd /dev/whatever
execve("/sbin/mkfs", ["mkfs", "-t", "asdasd", "/dev/whatever"], [/* 18 vars */]) = 0
execve("/sbin/mkfs.asdasd", ["mkfs.asdasd", "/dev/whatever"], [/* 18 vars */]) = -1 ENOENT (No such file or directory)
execve("/sbin/fs.d/mkfs.asdasd", ["mkfs.asdasd", "/dev/whatever"], [/* 18 vars */]) = -1 ENOENT (No such file or directory)
execve("/sbin/fs/mkfs.asdasd", ["mkfs.asdasd", "/dev/whatever"], [/* 18 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/local/sbin/mkfs.asdasd", ["mkfs.asdasd", "/dev/whatever"], [/* 18 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/local/bin/mkfs.asdasd", ["mkfs.asdasd", "/dev/whatever"], [/* 18 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/sbin/mkfs.asdasd", ["mkfs.asdasd", "/dev/whatever"], [/* 18 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/bin/mkfs.asdasd", ["mkfs.asdasd", "/dev/whatever"], [/* 18 vars */]) = -1 ENOENT (No such file or directory)
execve("/sbin/mkfs.asdasd", ["mkfs.asdasd", "/dev/whatever"], [/* 18 vars */]) = -1 ENOENT (No such file or directory)
execve("/bin\n/mkfs.asdasd", ["mkfs.asdasd", "/dev/whatever"], [/* 18 vars */]) = -1 ENOENT (No such file or directory)
mkfs.asdasd: No such file or directory
root@locutus:/home/asd# 
0

Probably your RHEL version doesnt support ext4 but you can remedy this by installing e4fsprogs with yum install or by downloading the package and then use ftp to move it to your server then install with rpm -ivh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.