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

Thread: GParted-Partition Question--Want to merge partitions to increase space

  1. #1
    Join Date
    Aug 2010
    Beans
    15

    GParted-Partition Question--Want to merge partitions to increase space

    Background:

    I have a dual-boot with Windows XP/Ubuntu Lynx 12.04. Gparted shows that my 320 GB (?) hard drive is partitioned as follows and in this order from left to right:

    /dev/sda 1 97.5 GB (this contains windows XP and files) File system fat32
    /dev/sda 7 100.47 GB (empty) File system ext4
    /deve/sda 5 97.18 GB (this is where all my file and Ubuntu are located) File system ext4

    There is also a small 3.2 GB swap partition at the very end.

    Issue/problem:

    I would like to merge sda7 and sda5 as I am running out of space in sda 5.

    However, the Gparted Resize/Move option is not active when I rightclick on sda 5.

    I also cannot unmount sda 5, I get this message: Most likely other partitions are also mounted on these mount points. You are advised to unmount them manually. Not sure if that needs to be done, just letting you know. sda7 is umounted.

    I screwed around with Gparted a bit last night and woke up to find Grub> when I rebooted my computer. Miraculously I was able to access the Internet on my cell phone to fix that, and the computer now reboots to Ubuntu as previously and everything is working well.

    Although I have been using Ubuntu for more than 4 years, it should be obvious that I am pretty much a neophyte, so if you have any solutions pleases bear that in mind when explaining!

    Thanks in advance for any assistance.

  2. #2
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: GParted-Partition Question--Want to merge partitions to increase space

    Can you post a screenshot of gparted so we can see exactly how your partition are set up please.
    Cheesemill

  3. #3
    Join Date
    May 2013
    Beans
    19

    Re: GParted-Partition Question--Want to merge partitions to increase space

    If you will have more questions please provide output of following:
    Code:
    sudo fdisk -l /dev/sda
    sudo parted /dev/sda print
    1) Hmm... first of all... if you want to resize partitions all that partitons must be unmounted. Thus you need to do that from windows or (better option) from some linux live cd. Live cd will allow you to unmount every partition on your disk and resize option should be available. This is general rule for some serious operations on drives - serious operations usually needs unmounted partitions.

    2) Resizing partitions, if they contain data, can be very long. I remember that once it took one night and one day! Thus much better approach would be to borrow some empty disk, copy whole data and then clean partitions and resize/merge or better just perform new installation.

    3) In such situations, where merging partitions causes that one partition will be removed and other will be renumbered, can lead to problems in booting you linux. Then you will neet to start live cd and correct /etc/fstab and maybe update-initrams -u -k all. Looking at your /dev/sda list I guess that this case should not touch you.

    4) Resizing/merging partitions is serious operation and can be interrupted due to some errors. Thus state of partitons can be unknown which will propably need to reinstall your linux.

    5) If you want check 2) and 4) just plug some big ~8GB flash drive, make few partitions (primary/extended/logical), fill it with some random files... and play with gparted. And hdd operations takes much more time than on flash drive!

    6) The option resize/move is also not available as I guess that sda7 is a logical partition (within extended partition) and sda5 is primary partition. Thus you need to remove sda7 partition, then you need to resize/shrink extended partition that previously contained removed sda7. Then free space will appear to extend sda5 and resize/move option should be available. But to be sure look at "sudo parted /dev/sda print" output or at gparted. The trick is that to resize partition there must be empty space. So you need to shrink (resize down) some other partition or just delete them.

    Please backup your data. Despite gparted is super toy I usually had serious problems using it.
    Last edited by darekch; May 25th, 2013 at 09:54 AM.

  4. #4
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: GParted-Partition Question--Want to merge partitions to increase space

    Quote Originally Posted by darekch View Post
    if you want to resize partitions all that partitons must be unmounted. Thus you need to do that from windows or (better option) from some linux live cd.
    Live CD agreed. Windows - no. Windows itself cannot resize partitions formatted with Linux filesystems and although there are Windows-based partitioning tools (such as Acronis) which can cope with Linux filesystems, what the OP needs is better achieved with Gparted.

    Quote Originally Posted by darekch View Post
    I guess that sda7 is a logical partition (within extended partition) and sda5 is primary partition.
    They are both logical partitions - you can tell by the numbers. In the MBR partition table system primary partitions are numbered 1 to 4. An extended partition would also lie in the range 1-4 as this is simply a specialised type of primary partition. Logical partitions are numbered 5 and upwards. However, we need more information from the OP, which you have asked for - thanks - and I will ask for in my next post.

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  5. #5
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: GParted-Partition Question--Want to merge partitions to increase space

    Before getting to the real issue, an important point:

    Quote Originally Posted by Qualtrough View Post
    I have a dual-boot with Windows XP/Ubuntu Lynx 12.04.
    Ubuntu Lucid Lynx is 10.04, not 12.04, and is now end-of-life. Please confirm which you are running. Although running an unsupported version of Ubuntu will not affect how you go about re-partitioning, you need to think about upgrading or even re-installing.

    Quote Originally Posted by Qualtrough View Post
    However, the Gparted Resize/Move option is not active when I rightclick on sda 5.

    I also cannot unmount sda 5, I get this message: Most likely other partitions are also mounted on these mount points. You are advised to unmount them manually.
    Are you running Gparted from your permanent Ubuntu installation? You cannot resize the root partition of a system from the running system. You need to use Gparted from the live CD.

    Quote Originally Posted by Qualtrough View Post
    Gparted shows that my 320 GB (?) hard drive is partitioned as follows and in this order from left to right:

    /dev/sda 1 97.5 GB (this contains windows XP and files) File system fat32
    /dev/sda 7 100.47 GB (empty) File system ext4
    /deve/sda 5 97.18 GB (this is where all my file and Ubuntu are located) File system ext4

    There is also a small 3.2 GB swap partition at the very end.
    The information is incomplete. We need to see if sda7 and sda5 are really contiguous and where your extended partition begins and ends. Also, if sda7 and sda5 are out of numerical order, this looks as though you have done some repartitioning before this. Not that this makes much difference now, but we need more information. As others have already asked for, please post a screenshot of the Gparted window and the output of this terminal command:

    Code:
    sudo fdisk -lu
    A couple of last points. If sda7 and sda5 are contiguous, you would need to delete sda7 and then resize sda5 to the left into the freed space. This will take a long time and has the potential for going wrong with data loss. Backup important data before you do anything.

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  6. #6
    Join Date
    Aug 2010
    Beans
    15

    Re: GParted-Partition Question--Want to merge partitions to increase space

    Thanks everyone for trying to help, and sorry for the delay in getting back. While I digest that, I will paste the info requested below. I am just looking for the best (and simplest/easiest way is to add disk space available in Ubuntu which is in sda 5, however that can be accomplished.

    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=12.04
    DISTRIB_CODENAME=precise
    DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"


    sudo fdisk -l /dev/sda:


    Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x139eec58

    Device Boot Start End Blocks Id System
    /dev/sda1 * 63 204796619 102398278+ c W95 FAT32 (LBA)
    /dev/sda2 204796681 625141759 210172539+ f W95 Ext'd (LBA)
    /dev/sda5 415496192 619307007 101905408 83 Linux
    /dev/sda6 619309056 625141759 2916352 82 Linux swap / Solaris
    /dev/sda7 204800000 415494143 105347072 83 Linux

    Partition table entries are not in disk order

    sudo parted /dev/sda print:

    Model: ATA WDC WD3200AAJS-0 (scsi)
    Disk /dev/sda: 320GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number Start End Size Type File system Flags
    1 32.3kB 105GB 105GB primary fat32 boot, lba
    2 105GB 320GB 215GB extended lba
    7 105GB 213GB 108GB logical ext4
    5 213GB 317GB 104GB logical ext4
    6 317GB 320GB 2986MB logical linux-swap(v1)

    Last edited by Qualtrough; May 26th, 2013 at 05:14 PM.

  7. #7
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: GParted-Partition Question--Want to merge partitions to increase space

    An earlier poster mentioned possible booting problems after you “merge” sda7 and sda5. (You don't actually merge them, but we'll come to that.) This is unlikely to happen, because although the stanza booting Ubuntu in your grub.cfg file will have a line referring to sda5, it also uses UUIDs and in my experience a “wrong” partition number in the set root line makes no practical difference. And, besides, in your situation, the sda5 partition is unlikely to be renumbered. However, emphasis on “unlikely”. In case you do have problems after you have done the repartitioning, please post the information asked for below before you do any partition work in case we need this to pick up the pieces.

    • The contents of /boot/grub/grub.cfg. Either open this in a text editor and copy and paste it into your post, or run:

      Code:
      cat /boot/grub/grub.cfg
    • The contents of /etc/fstab. Either from a text editor as before or from:

      Code:
      cat /etc/fstab
    • The output of this terminal command:

      Code:
      sudo blkid


    Please post these outputs between [CODE] and [/CODE] tags to preserve formatting and for clarity. The simplest way of doing this is to highlight the output and then click on the button in the message toolbar.

    Now to the re-partitioning:

    Backup anything important before you start

    1. Do this from Gparted in the live CD session. You cannot do this from your permanent installation.
    2. Once in the live desktop, open Gparted, right-click on the sda6 swap partition and choose “swapoff”.
    3. Delete the empty sda7 partition. Make sure it really is empty first and there is no data that you need to backup. Remember to click the green “apply” button.
    4. Highlight the sda5 partition, and then from the Partition menu, choose move/resize. Either use the slider or the free space preceding field to enlarge it to the left. Click on the green apply button.
    5. Now you have to wait anything upward of several hours. This will be a lengthy process.
    6. Once it's finished – hopefully successfully – reboot into your permanent installation and let us know whether everything works.


    This following bears repeating. Resizing a partition requires that the fileystem is rebuilt. There is a real potential for something going wrong. If there is a power-out, for example, you could lose everything. Hence the need for backups.
    Last edited by coffeecat; May 26th, 2013 at 06:23 PM.

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  8. #8
    Join Date
    Aug 2010
    Beans
    15

    Re: GParted-Partition Question--Want to merge partitions to increase space

    A question: Would it speed the repartioning process if I were to backup and then delete my files before partitioning, and then restore them once partitioning is completed? I ask because I can usually back those up in something like an hour or so.

  9. #9
    Join Date
    May 2013
    Beans
    19

    Re: GParted-Partition Question--Want to merge partitions to increase space

    Quote Originally Posted by Qualtrough View Post
    A question: Would it speed the repartioning process if I were to backup and then delete my files before partitioning, and then restore them once partitioning is completed? I ask because I can usually back those up in something like an hour or so.
    Yes. If you're sure about your backup, meaning you are sure that it will contain all data that you want, then deleting all files and reformating partitions before merging/resizing will let you do that process in about 5-10 minutes. Beside backup is rather 'must' if you want to resize partition.

    Hmm... looking at your gparted's image I think that in your case resizing partiton without deleting files should also be fast (about 10 minutes), as you will expand one partion with empty space so no data should be moved. However I can't guarantee that.

    And one word more about backup... remember to check if your backup contain hidden files/directories from you $HOME. If you use thunderbird then remember to backup ~/.thunderbird. Firefox usually keep you profile in ~/.mozilla.

  10. #10
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: GParted-Partition Question--Want to merge partitions to increase space

    Quote Originally Posted by Qualtrough View Post
    A question: Would it speed the repartioning process if I were to backup and then delete my files before partitioning, and then restore them once partitioning is completed?
    You are not talking about simply backing up a few data files, you are talking about backing up a working operating system and then restoring it to a working state. That could be a whole different level of complexity. Is this what you want to do?

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

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
  •