1

question: should it be /dev/sdb that is mounted or /dev/sdb1 that is mounted when dealing with disks other than your operating system disk?

My issue is that with the Utilities - Disks from the Application menu in RHEL/CentOS 7 (which i think is gdisk?) that for a new disk it will let you from that gui format and mount the disk however I am concerned there is a mistake. Using the gui entireley I end up with dev/sdb that is mounted. In order to get dev/sdb1 as the mount I have to first do

parted /dev/sdb mklabel GPT

then if I use the disk gui I can EXT4 or XFS format my disk and see it as /dev/sdb1

Do I need to worry about the number after the /dev/sdx ? What exactly is happening?

I plan on always mounting everything by-uuid, and my scenario is a second disk /dev/sdb that I want as GPT with one primary partition either XFS or EXT4 the entire disk, mounted as /data.

0

tldr: You want /dev/sdb1.

/dev/sdb represents the entire disk; /dev/sdb1 represents a single partition on the disk. Partitions aren't really special in any fundamental way; it's just the operating system decided to treat one disk as effectively several disks. That's done by writing some specially-formatted data to the beginning (and sometimes end) of the disk, called a partition table.

You can put a filesystem on either then entire disk (and have no partition table) or on a single partition covering all of the disk (except the space used by the partition table). Both will work fine. There are some advantages and disadvantages to each. The main advantage to full disk on physical disks is you get an extra few KB of disk space. That's, err, obviously pretty insignificant. The main advantage to a partition is its what everyone expects. It also makes clear what space is reserved to, e.g., install a bootloader for pre-EFI (BIOS) systems. Or type of filesystem is on the disk with GPT.

And really, everyone expecting a partition is a pretty strong reason to go ahead and create one. Otherwise, any future admin (including possibly yourself) will be confused. And so too will be random programs. Absent a good reason to use the full disk (and with physical disks, there really isn't one) you should create a partition.

PS: I bet the GUI app has some way to create a new partition table (or maybe "label" instead) instead of having to use the CLI parted. If it's the one I think you're referring to, there ought to be a "Format Disk..." option in the menu. (Sorry, not personally running RHEL/CentOS).

PPS: On virtual disks with Logical Volume Manager it can make sense to use full disk. It can make resizing the disk easier, but of course you can't resize non-virtual disks. So this very likely doesn't apply to your case at all.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.