mounting and using a device with no partitions?
It has always been my understanding that to use a disk or other storage device, it needs to have a partition which can then be mounted and used. Is this wrong? I inserted an nvme device in the machine and using the 'disks' gui utility chose ext4 and successfully mounted it to /mnt/nvme. My current situation:
lsblk
returns
nvme0n1 259:0 0 465,8G 0 disk /mnt/nvme
with no tree under it with 'nvme01n/nvme01n1' or such like I see for say sda/sda1,
and
sudo fdisk -l | grep "nvm"
returns
Disk /dev/nvme0n1: 465,78 GiB, 500107862016 bytes, 976773168 sectors
.
In /mnt/nvme I can touch test
, then ls
returns lost+found test
and df test
returns /dev/nvme0n1 479670976 73756 455161508 1% /mnt/nvme
.
So it appears that there are no partitions on device nvme0n1, yet I can read and write files to it. What's going on? Don't we actually need partitions for anything??
Solution 1:
One can create a filesystem on any block device; as you've shown, that could be the "whole disk" device. Usually it's a partition, once a label is written to the disk to define the partitions. One of the other uses of the label is to hold the master boot record, so an unpartitioned/unlabeled disk could never be booted from. So it's customary, but not required, to always partition/label big disks. It's interesting that if one tells ZFS to put file system on a whole-disk device, ZFS goes ahead and writes a label (with one big partition) anyway.