I was under the impression that a block device is listed under /dev
, so for example /dev/xvdf
and that file systems live on a partition which is listed with a number behind the block device the partition is on, like /dev/xvdf1
and that all file systems must live on a partition.
I am running CentOS and as part of a course I have to create file systems, partitions and mount file systems. For this course, I have created a file system on device file /dev/xvdf
and I have mounted this file system. In addition to that, I have created a partition on /dev/xvdf
with the file name of /dev/xvdf1
and created a file system on this partition as well and mounted this file system. This confuses me and I have some questions:
- Am I correct that you do not have to create a partition on a block device, but that you can create a file system on a block device directly without a partition?
- If so, why would anyone want to do this?
- After creating the file system on
/dev/xvdf
, I created the/dev/xvdf1
partition using fdisk and I allocated the max blocks to this new partition. However, the file system on/dev/xvdf
was not removed and still had a file on it. How is this possible if all the blocks on/dev/xvdf
have been allocated to the/dev/xvdf1
partition?