unable to mount a partition.

Latest response

I'm using RHEL7(version 7.3) on KVM. I've created a partition of disk and now I want to mount it on a directory in root file but I get following error:-

"mount: wrong fs type, bad option. bad superblock on /dev/vda7, missing codepage or helper program, or other error. In some cases useful info is found in syslog -try dmesg | tail or so."

Here vda7 is the partition that I've created. The command for formatting the file system that I've entered is : "#mkfs.ext4 /dev/vda7". As I run "fdisk -l" command, the partition is included in the list.
Please guide me if somewhere I am wrong .

Responses

What is the partition type of /dev/vda7? Are you able to paste the /dev/vda7 as it appears in fdisk -l?

If you entered the command literally as "#mkfs.ext4 /dev/vda7", you should be aware that # is a comment character when typed on a shell command line: anything written after it will be ignored by the shell. So your command may have had no effect at all.

The # character is also the traditional root prompt character, so when you're copying commands from elsewhere, it just means "this command should be entered as root user, or with equivalent permissions". You should not actually type (or copy) it.

In other words: to format /dev/vda7 as ext4 filesystem, enter this command:

mkfs.ext4 /dev/vda7
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.