Problem scenario
Your Linux server was installed over an old Windows server. You want to repurpose sections of the hard disk (e.g., sda1 and sda3). Linux has been installed, but some sections of the disk are not usable by Linux. What do you do?
Solution
Warning: This could permanently delete data. If you make a mistake you may need to reformat your Linux server. Proceed only if you know what you are doing or can delete everything on the server.
- Run this:
sudo cfdisk
- Find the device you want to recycle. Highlight it. Choose "Delete".
- Choose "Write". You will get an option to change the size. If you want to repurpose all the capacity, just press the Enter key.
- The device "/dev/sdax" should now be free space. It should be highlighted too. Choose "New".
- The device "/dev/sdax" should have reappeared (or the next sda followed by an integer) should have appeared. The "Type" should be "Linux."
- Choose "Write" to exit this program. You will be prompted "Are you sure you want to write the partition table to disk?" Type "yes" with no quotes and press the Enter key.
- Go to "Quit". You will be prompted to enter a size of the partition. You normally would just press the Enter key.
- Reboot the server
- Start with step #5 of these directions (but replace sdc with the device's name):
https://www.continualintegration.com/miscellaneous-articles/how-to-add-a-disk-to-a-rhelcentosfedora-server/