Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Resize Existing Partition with Unallocated Space

  1. #1
    Join Date
    May 2010
    Beans
    95

    Resize Existing Partition with Unallocated Space

    Its a dual boot PC with Windows 10 and ubuntu 16.04. To upgrade, the Ubuntu, I started upgrade process, but I stucked due to low space on / mount point. So, I went to windows and shrunk the Windows partition (Disk Management) and a new partition of 20 GB created. Here is my fdisk output :
    Code:
    girish@girish-OptiPlex-3050:~$ sudo fdisk -l
    Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: E1D206C6-CD80-4796-8691-87310D959375
    
    Device          Start        End    Sectors   Size Type
    /dev/sda1        2048    1333247    1331200   650M EFI System
    /dev/sda2     1333248    1595391     262144   128M Microsoft reserved
    /dev/sda3     1595392 1888557055 1886961664 899.8G Microsoft basic data
    /dev/sda4  1930500096 1936500735    6000640   2.9G Linux swap
    /dev/sda5  1936500736 1951471615   14970880   7.1G Linux filesystem
    /dev/sda6  1951471616 1953499135    2027520   990M Windows recovery environment
    Gparted is showing me 20 GB as unallocated. Now, I want to merge this unallocated space to /dev/sda5. I followed this link : https://askubuntu.com/questions/1163...u-is-installed because neither I have live CD nor Live USB. In that link I tried to follow the post of Sergey, but I am not understanding the meaning of this line :

    use a to toggle the bootable flag on the new /dev/sda1 because there is no a option in the option list of /dev/sda command,

    nor I am able to understand this text too :

    "Make sure its start cylinder is exactly the same as the old /dev/sda1 used to have. For the end cylinder agree with the default choice, which is to make the partition to span the whole disk." How do I get the start cylinder number.

    Kindly help me to merge the unallocated 20 GB space to / mount point.

    Thank you.

  2. #2
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    4,784
    Distro
    Xubuntu 19.04 Disco Dingo

    Re: Resize Existing Partition with Unallocated Space

    That guide uses a dirty hack. I wouldn't do that on a production machine without knowing exactly what's going on. Just create a live usb. And I think that hack will only work when expanding a partition to the right, but you want to expand it to the left.

    Furthermore, before you can expand the Ubuntu partition into the unallocated space, you have to deal with the swap partition, which is inbetween. So move that first, or delete it, or whatever you want. If you delete the swap partition (and create a new one, if you wish so), make sure you change your /etc/fstab to make sure the new swap partition is properly loaded and the system doesn't complain about not being able to find the old swap partition.

    Or, given the very small size of your Ubuntu system, I assume you've got hardly any files there. Deleting both the swap partition and the root partition, followed by a fresh install, may be the best solution.

  3. #3
    Join Date
    May 2010
    Beans
    95

    Re: Resize Existing Partition with Unallocated Space

    Quote Originally Posted by Impavidus View Post
    That guide uses a dirty hack. I wouldn't do that on a production machine without knowing exactly what's going on. Just create a live usb. And I think that hack will only work when expanding a partition to the right, but you want to expand it to the left.

    Furthermore, before you can expand the Ubuntu partition into the unallocated space, you have to deal with the swap partition, which is inbetween. So move that first, or delete it, or whatever you want. If you delete the swap partition (and create a new one, if you wish so), make sure you change your /etc/fstab to make sure the new swap partition is properly loaded and the system doesn't complain about not being able to find the old swap partition.

    Or, given the very small size of your Ubuntu system, I assume you've got hardly any files there. Deleting both the swap partition and the root partition, followed by a fresh install, may be the best solution.
    Thanks for your reply. Ok, as you suggested to go on live USB path, I will download ISO. For this I have https://www.linuxliveusb.com/en/supported-linuxes link, hovering mouse on U Tab and thinking to download ubuntu-10.04.1-desktop-i386.iso file because its seems me smallest in size 686 MB. Am I downloading the correct ISO for this purpose or you will suggest me some other Small ISO because I lives in a area which have very poor internet connectivity.

  4. #4
    Join Date
    Jun 2007
    Location
    K-o-T,
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Resize Existing Partition with Unallocated Space

    If you just need Gparted then you should search for "Gparted Live" and download and create a Live USB or CD. Much smaller than a Live ISO

    Good Luck
    Hypertension = Take with a pinch of salt
    | Psychocats | Ubuntu Documentation | Howto [Solved] | BBcode list | Brother Website |

  5. #5
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    4,784
    Distro
    Xubuntu 19.04 Disco Dingo

    Re: Resize Existing Partition with Unallocated Space

    If you only need gparted, you can use the gparted live disk. That should be smaller. A complete live disk that you can also use to install or fix Ubuntu is a good thing to have. I think the smallest one I could recommend is the Lubuntu 18.04 live disk, at 1GB.

    Do you want a small one because your internet connection is expensive, slow or unreliable? There are ways to download the iso files such that it can resume the download after the connection failed, without restarting from the beginning.

  6. #6
    Join Date
    May 2010
    Beans
    95

    Re: Resize Existing Partition with Unallocated Space

    Quote Originally Posted by plucky View Post
    If you just need Gparted then you should search for "Gparted Live" and download and create a Live USB or CD. Much smaller than a Live ISO

    Good Luck
    Is it possible to merge/resize unallocated space to the Ubuntu partition without Gparted i.e. by commands on terminal please even I have downloaded Gparted Live USB, booted it from that USB but I am not able to use the Gparted i.e. which step I should take first and second. Examples on internet shows with extended entries but in mine case there is no extended partition. So, I am very much confused how do achieve the goal on terminal. I learned that it is not possible while partition is mounted, but if it is available with Gparted's terminal windows or any other way.

  7. #7
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    4,784
    Distro
    Xubuntu 19.04 Disco Dingo

    Re: Resize Existing Partition with Unallocated Space

    OK, so you've got the gparted live usb running. And you're correct that you don't have an extended partition. They are old-fashioned.

    Gparted is easy to use, but you have the slight complication that your swap partition is inbetween the unallocated space and the partition that you want to expand.

    First make sure the swap partition is off. That is sda4. If not, right-click on the swap partition, set swap off. Now you can move the swap partition to the left. Move it all the way until it sits against the Windows partition (sda3). Don't change its size. It's just right the way it is.

    Now the unallocated space is inbetween sda4 and sda5. You can switch swap on, as that may speed things up a bit. Then make sure sda5, the Ubuntu root partition, is unmounted. If not, right click and unmount. Then you can change sda5. I don't know if you can directly expand it to the left, or maybe you have to move it to the left first, then expand to the right.

    (Yes, there are command line tools to modify partitions, but that would be harder than gparted.)

  8. #8
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Resize Existing Partition with Unallocated Space

    Quote Originally Posted by Impavidus View Post
    (Yes, there are command line tools to modify partitions, but that would be harder than gparted.)
    +1.

    Much harder. but if you want, feel free to try with fdisk or parted. I don't know anyone who would attempt the type of thing you need using those if gparted was available.

    BTW, I would just delete the swap partition, do the slide to the left, then re-add a swap of 4.1G at the end, then mount the partition that has /etc/ inside it and manually fix the swap UUID line inside the fstab.

    If we change anything (location or size) about any partition, expect to manually need to fix the fstab file. It isn't hard, once you understand what each field in each line means, but to someone who has never seen it before, it can be next to impossible to do. Regardless, make a backup of the fstab file.
    Code:
    sudo cp fstab fstab-2019.11
    This is so you can see what it needs to look like later. Google "ubuntu fstab" for a how-to guide and keep that gparted boot flash drive handy. You'll need it, most likely.
    Last edited by TheFu; 3 Weeks Ago at 01:39 PM. Reason: s/is/it/ - typing is hard.

  9. #9
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    9,732

    Re: Resize Existing Partition with Unallocated Space

    I hope you made a backup of everything, since playing with partitions is a good way to ruin your day...

  10. #10
    Join Date
    May 2010
    Beans
    95

    Re: Resize Existing Partition with Unallocated Space

    Quote Originally Posted by HermanAB View Post
    I hope you made a backup of everything, since playing with partitions is a good way to ruin your day...
    Yes, as everyone is strictly suggest to take backup before partition operation, now I am stuck how do take complete backup of hard disk (in mine case, I have only one HDD) with Ubuntu and Windows 10 data and metadata. Which tool I should use to take backup and in any case if anything wrong happens, how do I will get the current state of the system.

Page 1 of 2 12 LastLast

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
  •