I try to create a new file system for my sftp server, but when I run the command it prompts something about a block special device
that I don't understand.
I tried to mount using following command :
mkfs.ext4 /MYPJsftpfs
to create the new file system.
[root@mykulsftp01 ~]# mkfs.ext4 /MYPJsftpfs
mke2fs 1.42.9 (28-Dec-2013)
/MYPJsftpfs is not a block special device.
Proceed anyway? (y,n)
What actually is a block special device
? Why on other server did I not get this prompt when creating a new file system?
i tried to mount using below command :
mkfs.ext4 /MYPJsftpfs
Note, please, this command is not for mount !
With it you try to build ext4 file system on some block device.
from man mkfs
:
mkfs
is used to build a Linux file system on a device, usually a hard disk partition.
You wrote:
What is actually special block device?
A block device is a kind of file which represents a device of some kind, with data that can be read or written to it in blocks. Block devices often represent a mass-storage unit of some kind (for example, a partition on a hard disk or on a USB pen drive).
Typically they are created in catalog /dev
https://www.quora.com/What-is-a-Linux-block-device
Thus, you should:
1) make sure you created some Linux partition for sftp, for example it will have block device /dev/sdb10
.
2) build ext4 file system there:
mkfs.ext4 /dev/sdb10
3) mount your partiton (if required):
sudo mount -v /dev/sdb10 /path/to/MYPJsftpfs
4) Check created partition with command df -h
or lsblk
.