How can I check and change the partition table type?

892

What is a partition table? How is it related to Windows 8?

In addition to general partitioning, it should be noted that information about partitions are stored in a partition table on the hard disk.

The whole topic didn't receive much attention because DOS/Windows computers – where one would install Linux onto – just had one choice for almost three decades. (MBR was introduced in 1983.) Until Windows 8 finally replaced the long overdue and outdated BIOS/MBR subsystem combination with UEFI/GPT. (Comparison of GPT and MBR on the Arch Wiki.)

While GPT is the name for the new format, there is some confusion about how to name the old one as MBR previously described the bootloader code that is stored along the partition information in the partition table.

How do I check and change the partition table?

Read these instructions carefully before you start!

Also note that you can convert partition tables: How can I change/convert a Ubuntu MBR drive to a GPT, and make Ubuntu boot from EFI?

  1. GUI-method - Using GParted

    To find out what partition table type the selected drive has select View > Device Information from the menu.

    GParted showing /dev/sdb selected and 'Device Information' menu entry

    Select the disk of which you want to change the partition, then select Device > Create Partition Table from the menu.

    GParted showing 'Create Partition Table' menu entry

    If you get a warning that the device contains active partitions, unmount these. Note that you cannot unmount partitions of your currently running operating system. You will then see the window below, where you can choose the partition table type. msdos is what GParted calls the old format, gpt the newer one. All the others for other operating systems or architectures.

    Please also note the warning message. Creating a new partition table will discard all information about existing partitions on the disk. It will not overwrite data on the partitions, but you still don't want to have to dig through and restore data afterwards. Therefore consider the old partitions gone and all data lost after you created the new partition table and backup your data before doing so.

    GParted asking to create a partition table on /dev/sdb

  2. CLI-method - Using parted

    To display partition table information run:

    sudo parted --list
    

    To create a new partition table run:

    # This is a destructive action that will destroy all data on the partitions of the device
    sudo parted device mklabel label-type
    

    device should be replaced with the device name (e.g. /dev/sdb) and label-type with msdos or gpt.

    You can also run parted interactively by just running sudo parted. More details in the manpage.

Share:
892

Related videos on Youtube

Csabi Vidó
Author by

Csabi Vidó

This is my AskUbuntu profile and most of my stuff here on StackExchange is tech-oriented. However I do have other hobbies and interests, you may find more about these in my other profiles on the network. I'm lwbt on Reddit and Telegram. I started with Ubuntu and Linux somewhere between 2006 and 2007. With the release of 08.04 I completely migrated away from Windows to Ubuntu and while this has been a few years ago I still consider myself fairly new to this topic and I know I can still discover something new and exciting everyday. The following listing is not to brag about hardware, I'm rather trying to reproduce issues and share experience. Custom built desktop computers with Intel HD graphics (dualscreen setup), Lenovo T530 & T560 (touch) without discrete graphics (also run Windows 10), Chromebooks Lenovo N22 & ASUS Flip C302 (with GalliumOS) Behringer FCA610 USB (PulseAudio multichannel configuration), JDS Labs C5D & The Element, Bluetooth dongles and BT audio speakers and headphones Wacom Intuos 4 PTK-540WL HP 3005pr Port Replicator (works with proprietary DisplayLink driver) Aten CS1794 HDMI KVMP Switch Logitech TK820 and some unifying receiver mice …and some APC UPS

Updated on September 18, 2022

Comments

  • Csabi Vidó
    Csabi Vidó over 1 year

    I have an universal React application using Redux, React-routerV4, MySQL and Sequelize. I am trying to protect some routes, and I'm using Passport for that, like in this tutorial: https://hptechblogs.com/using-json-web-token-react/

    Usually with JWT storing on web browser is recommended, because you don't have to make request to the DB everytime you load a route. But in the case of an Application with SSR this is not useful, because the components loaded by the server can't access LocalStorage or SessionStorage.

    I am thinking if storing the token in a cookie is better in the case of universal applications… Any idea?

    Thanks!

  • Alaa Ali
    Alaa Ali over 9 years
    Great into, but 1) you can still expand on the What is a partition table part, 2) it's not clear (at least to new/non-techy/not-into-harddisks people) if doing these steps will completely wipe out the hard disk, or just change to GPT and not harm partitions, 3) I think it's always best practice to put "please backup all your data" in answers involving partitions, and 4) why don't you just post your answer to How can I change/convert a Ubuntu MBR drive to a GPT, and make Ubuntu boot from EFI? instead? Your question might be considered a duplicate.
  • Csabi Vidó
    Csabi Vidó over 9 years
    @AlaaAli I want to keep this as brief as possible. The first sentence could be phrased better, but I don't want to go down to engineering level (I don't think there is much more to say about partition tables than engineering). 2 & 3) Information added. 4) The site seems to have a problem with overly long, monolithic and redundant answers while users are not able to find the information they are looking for. Would you find it there? The question about conversion should at best only be about conversion for the readers sake and not mix with (data) destructive answers. I appreciate your input. :)
  • Fabby
    Fabby almost 5 years
    and +1 here too! ;-) Drop by in chat sometime so I don't have to leave comments here...
  • Admin
    Admin almost 2 years
    isn't it aplicable for an existing installation without data lose ?