I use Ubuntu Linux to develop applications, but usually have a Linux admin setup the final environment. I have a Linux box (via VMWare) that houses our application and Docker containers. That works and is great.

We need to now expand the main drive / volume to be over 10 TB. Originally, for some reason they made the original drive only 1 TB. Now we have to make it larger.

The server team (via VMware) added for disk space to the VM (500gb) and I was able via some tutorials able to get that 500gb added to the drive via fdisk.

Great!, now they added 10 TB of space to the server. I can see the space but when I use fdisk i get that it can't partition space larger than 2 TB.

I read online that I can use gdisk or something like that. My questions are:

1) How can I get this 10 TB of space added to the server? and

2) If I set up this partition using something other than fdisk, can i later expand my main drive with this space since it wasn't setup in fdisk?

  • Cedric, do you have Ubuntu Server, or Ubuntu Desktop? Which version number? If it's Desktop, there's a GUI tool gparted which may be helpful; if server, try gdisk manpages.ubuntu.com/manpages/trusty/man8/gdisk.8.html . Please click edit and add that useful info into the original question. Please don't just click [Add Comment], for comments can pile up and scroll off the screen. – K7AAY May 2 at 16:08

The 2TB limit you're seeing comes from the (ancient, circa 1983) DOS MBR partition table format. You are limited to 2³² sectors, which with 512-byte sectors is where 2TiB comes from. fdisk often supports only DOS MBR.

The solution to this is to use a newer partition table format, GPT. gdisk is one of several tools that handle GPT tables, and it will attempt to convert on start up. The conversion is done in memory only until you hit w. This would often fail if you hadn't just expanded the disk, but you have so it should work (GPT requires some sectors at the end of the disk as well as beginning; DOS MBR did not need the end).

When you fire up gdisk, you should see something like this:

Found invalid GPT and valid MBR; converting MBR to GPT format
typing 'q' if you don't want to convert your MBR partitions
to GPT format!

and you can use the normal commands you should be familiar with from fdisk to manipulate the GPT partition table.

Obviously, you should have backups in place, at very minimum your server team should snapshot your VM.

Long-term, you ought to consider using non-partitioned devices where possible, maybe through LVM. Then extending them is much easier and generally an online operation (for example, if you gave an unpartitioned device to LVM, it'd be a simple pvresize /dev/whatever, which takes a fraction of a second and is done online).

  • Thanks for the information. This does make since to me. Between this and K7AAY answers, this gives me enough info to at least now go and research what I need to do. – Cedric Gaines May 2 at 17:50
  • Question: How would I know if my drive is LVM? I see that I have under my i guess /dev/sda that /dev/sda5 is LVM. I still have the 10tb of space unassigned waiting, but how can i easily extend it with LVM or am I just confusing what you said? – Cedric Gaines May 3 at 16:12
  • @CedricGaines If lvs or pvs list logical/physical volumes, then you're probably using LVM. If they list nothing, then you're probably not. – derobert May 7 at 18:00
  • Great the LVS and PVS worked. Is there a good tutorial I can use that outlines how to create and expand the 10tb of unused space I have in /sda/dev to be utilized. I know this newbish so please forgive me. Also, i have backups, but if I have to use this 10tb of space, will that destory / format the data that already here? – Cedric Gaines May 7 at 18:38
  • @CedricGaines The 10TB of new space presumably is unused/empty/junk (so what happens to data on that new 10TB doesn't matter, but if there were data there, it'll probably be lost). The existing date in the VM should survive. Since you're on Ubuntu, wiki.ubuntu.com/Lvm is a good place to start (but make sure not to pvcreate a partition when you have data). Plopping "LVM" into Google found me a lot of introductions as well. Some of them are a bit newer than the Ubuntu wiki. Arch as normal has a bunch of stuff too wiki.archlinux.org/index.php/LVM but less beginner. – derobert May 7 at 19:05

1) How can I get this 10 TB of space added to the server?

gdisk is an Ubuntu tool which gives you the ability to expand your partition.

2) If I set up this partition using something other than fdisk, can I later expand my main drive with this space since it wasn't setup in fdisk?

As the Man said, Yes, You Can. The tool originally used does not restrict you from using other tools. You might consider use of LVM because it's easier to adjust your partitions as things change.

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.