Is there any benefit to partioning hdd data-only disk?

One ext4 partition will suffice. You can assign folders within it with differing rights in case you have multiple users.


No Partition or 1 Partition?

It is possible to format the whole disk without any partition and without any partition table.

However, it is recommended that You have at least one partition covering the whole disk. See answers to How do I add an additional hard drive? in this site for other examples of creating a single partition covering the whole drive.

I suppose you want to know the advantage of having more than one partition in this data disk. Here are some advantages:

Multiple Users

Let us suppose my wife is a telenovela fan and wants to setup a way to download 6 episodes every week. My son is a gamer and wants to save his steam game data in the extra drive.

If I have only one partition in a few weeks the partition will be full of TV episodes and my son won't be able to save his game or vice versa.

One solution is to create two partitions. Even if the Telenovela partition is full the game-data partition will have space and the other way around.

There are other ways of assigning disk quota to users: Using 'quota' for disk limits that does not require creating multiple partitions.

Second Drive as a File Server

This use-case is similar to above, but instead of having multiple local users, you have other users who use the data drive as a network drive and dump their data in this drive. Even though there are ways to manage network data storage quota in a file server, you may want different partitions for different network users.

Partitions v Quota

Using user and or group quotas for local or remote users' data needs is the "proper" way to go about it. However, setting it up may be daunting to new users especially those who are not familiar with the command line. One advantage of this approach is one can change the quotas without messing with the partitions.

On the other hand, setting up the new disk with two or more partition seems easier especially with a GUI application like Gparted. You don't have to learn and remember new commands. On the negative side, if you need a different quota assignment, you have to resize the partitions which always involves a risk of data loss resulting from mistakes or power failure etc.

Single User

It is harder to think of a situation where a single user may need two data partition, but it is not impossible.

One possibility is you are working on two different data intensive projects and one of them may generate huge amount of data filling up the whole disk. If that happens the code for that project will stop working at the same time the second project will also fail if the data from two projects are not in separate partitions.

Hope this helps


Seeing that the original author describes the disk as "newly formatted" and only to be used for data, not as a system disk, the question might also be interpreted as whether to create a partition table on the drive containing a single partition, as opposed to just creating the filesystem directly on the raw block device (e.g. /dev/sda).

If that is the case, I would definitely recommend creating a partition table containing a single large partition, for the following reasons:

  • If the drive gets connected to a machine running Windows, it won't recognize that the disk contains a filesystem, but rather see the drive as completely empty ("uninitialized") and offer the user to initialize it, i.e. create a partition table on it, thus overwriting the Ext4 superblock and corrupting the filesystem. On the other hand, if the drive contains a GPT/MBR partition table with a Linux partition, Windows would see the disk as being in use, just containing an unknown, inaccessible data partition.
  • If you unplug the disk, put it in a drawer and return to it in a few years time - or if somebody else might need to access the disk on your behalf - it will not be immediately apparent that the disk actually contains a filesystem rather than just being empty. Especially if it's connected to a non-Linux system. In that case, whomever accessing the disk might not realize that it contains data before it's too late, unless they take a look at its contents in binary form and identify it as Ext4 metadata.

Also, if you do decide to create the filesystem directly on the device without a partition table, make sure that the partition table is completely gone if it's a GPT partition table.

Unlike legacy MBR partition tables which only reside at the beginning of the drive, GPT keeps an additional copy of the partition table at the end, for recovery purposes in case the primary instance of the partition table gets corrupted.

If the initial partition table is missing due to it now being occupied by the filesystem superblock, partitioning tools might see the partition table as corrupted, and therefore try to repair it by overwriting the beginning of the drive with the backup kept at the end of the drive, thus corrupting the filesystem. No partitioning tool would hopefully ever do this without asking, but you never know.

A solution for the last issue would be to wipe both instances of the GPT partition table completely. This can be done using the "zap" feature of gdisk (GPT fdisk), accessible by entering the "experts mode" by pressing X in the initial menu, then Z for "zap". (Needless to say, make sure that you have selected the correct block device!)

The only apparent benefit for skipping the partition table on a physical disk, would be if every byte counts, and you have a specific purpose for the additional 2048 sectors (1 MiB) of storage at the beginning of the disk.

Another reason could be if you're using full disk encryption on the device with the LUKS header located elsewhere, so that it becomes more difficult to identify the contents as an encrypted filesystem rather than just random data. (Some people might call this security through obscurity.)

If legacy compatibility is a concern, an MBR partition table could be used rather than GPT. However, accessing a GPT disk would only cause issue on very old systems. If that is the case, it might even be worth considering using Ext3 or XFS rather than Ext4.

For virtualization purposes where disks may be moved around and resized at will, using disks containing filesystems without a partition table makes better sense, because it allows for more flexibility. For instance, the filesystem can be resized without modifying the partition table, and the data is easier accessible outside of the virtual machines, e.g. when mounting the partition on the VM hypervisor host.

Tags:

Partitioning