Results 1 to 6 of 6

Thread: How did I end up with this partition table? Extending a partition VM

  1. #1
    Join Date
    Jun 2020
    Beans
    2

    How did I end up with this partition table? Extending a partition VM

    I just inherited this server (Ubuntu 18.04 LTS) and am confused as to how this happened and how to fix it. The server is in a VM using VMWare and the space was recently added 50GB. I thought it would be simpe enough to use parted to extend the partition but when printing the table this is what I see:

    Code:
    :~$ sudo parted /dev/sda
    GNU Parted 3.2
    Using /dev/sda
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) p
    Model: VMware Virtual disk (scsi)
    Disk /dev/sda: 53.7GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags:
    
    Number  Start   End     Size    Type      File system     Flags
     1      1049kB  12.9GB  12.9GB  primary   ext4            boot
     2      12.9GB  17.2GB  4314MB  extended
     5      12.9GB  17.2GB  4293MB  logical   linux-swap(v1)
    How could partition 2 and 5 have the same start and end? And how would I go about expanding the partition 1 to the extent?

    Regards.

  2. #2
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,613

    Re: How did I end up with this partition table? Extending a partition VM

    I don't use VMware, but you likely made the virtual disk larger (53.7 GB) without expanding a partition and file system, so total available remains at 17.2 GB. You need to find the commands to do that. Partition 2 is a extended partition in an MSDOS-partitioned disk and serves as a container for multiple logical partitions nested within it. You have one logical partition (5) taking up the entire range.
    Last edited by Dennis N; 1 Week Ago at 08:06 PM.

  3. #3
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,152
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: How did I end up with this partition table? Extending a partition VM

    sda2 is an extended primary partition. Only one is allowed per disk.
    sda5 is a logical partition that fits inside.

    Neither can be modified when mounted. To modify them, you must make them unactive.

    But none of that really matters, since sda5 is just swap and sda2 only holds the swap partition. The easy way to solve many issue like this is to hook up a "Try Ubuntu" iso to the VM and boot from that. Then use gparted to delete the sda5 and sda2 partitions, expand/resize the sda1 (though i would make it 25G and create 2 other primary partitions for /home and "swap"

    But you get to choose what is best.

  4. #4
    Join Date
    Jun 2020
    Beans
    2

    Re: How did I end up with this partition table? Extending a partition VM

    Thanks for the suggestions. I simply used cfdisk through a console and deleted the swap and extended partition then expanded the primary to 46G and recreated a swap partition of 4G. Then resized the partitions using resize2fs and now all good.

    Regards.

  5. #5
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: How did I end up with this partition table? Extending a partition VM

    Thread moved to Virtualisation.

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,152
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: How did I end up with this partition table? Extending a partition VM

    Quote Originally Posted by red1r View Post
    Thanks for the suggestions. I simply used cfdisk through a console and deleted the swap and extended partition then expanded the primary to 46G and recreated a swap partition of 4G. Then resized the partitions using resize2fs and now all good.

    Regards.
    Glad you found a solution. Please mark the thread as "SOLVED" in the thread tools button to help the community.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •