I have ubuntu 14.04 running on my laptop along side windows 10. I have been getting the error in ubuntu for insufficient memory space. So I am planning to merge one other partition that I created using windows disk management to ubuntu. The question has been answered in many other tags but I did not find any of them helpful for my case. Could you please let me know if I can merge the first parition that is dev/sda1 with the last partition which is unallocated which is of 268GB. Attached is the screenshot of the GParted tool.sda3 - windows 10 - C and sda4 windows 10 D folders
You can move allocated partitions to the end of the disk right-clicking them one by one and choosing Resize/Move, so you obtain your unallocated space adjacent /dev/sda1. Then you right-click on /dev/sda1 and choose Resize/Move to increase its dimension.
Pay attention: You must boot GParted from Live CD/USB in order to edit your disk.
First, there's no such thing as an "unallocated partition." A partition is, by definition, a section of disk that has been allocated in the partition table. What most people mean by "unallocated partition" is unallocated disk space -- sectors of the disk that have not been allocated, and that are therefore part of no partition.
Thus, "merging" unallocated space with another partition really just means expanding the partition you want to grow. There are several questions and answers on this site relating to this topic, such as:
- How to resize partitions?
- Why I'm seeing a lock besides the partition I'm trying to modify with gparted?
- How to extend my root (/) partition?
- Gparted - How to move partition to extend the size
In your case, your
/dev/sda1 is not next to the free space. Thus, expanding
/dev/sda1 will require moving every intervening partition. This can be done, but it will take some time (probably between one and several hours), and it poses a risk to every intervening partition's data. There are also Windows boot issues (see below). You should back up your data from every partition you touch before you try to make any changes to it.
Broadly speaking, there are other options, but they all have serious problems in your case:
- Copy the partition -- Given the relative sizes, copying
/dev/sda1to the free space might make sense. Unfortunately, you've got an MBR disk, which imposes a 4-primary-partition limit, and you've already used your four primary partitions, so this approach would require some significant gymnastics that are clearly well beyond your comfort zone, given the nature of your question. In practice, this approach would best be taken by backing up
/dev/sda1, deleting it, and then restoring the backup to a new partition. However it's done, you'd be left with unallocated space where
- Use LVM -- The Logical Volume Manager approach enables combining multiple partitions into one collection of storage space and then carving it up in whatever way is convenient. In principle, you could convert
/dev/sda1to LVM, add the free space as a new partition to the LVM setup, and then carve it up. This would run into the same MBR 4-partition limit just noted, though, and the initial conversion to an LVM setup would be non-trivial.
- Add another partition -- You could, in principle, create a new partition in the unallocated space and transfer data to it. This would be most workable if your personal files (in
/home) are growing in size; you could move them and then re-mount the new partition at
/home, as described in this question and answer. As with the preceding two points, though, you'd run into the 4-primary-partition limit, which would complicate this process.
It is possible to change partitions from primary to logical or vice-versa (thus overcoming the 4-primary-partition limit) using my FixParts program, which is installed by default in Ubuntu as part of the
gdisk package; however, your existing partition layout would make such conversions a bit awkward. The best approach to this is likely to be to convert
/dev/sda5 from logical to primary, then shrink
/dev/sda3 just enough to open a small gap between it and
/dev/sda4, then convert
/dev/sda4 from primary to logical. You'll then be able to resize the extended partition that will hold
/dev/sda4) and add new logical partition(s) in the extended partition, which will cover your currently-unallocated space.
Overall, the simplest approach is probably to move the intervening partitions -- but as I say, that's risky, so it's imperative that you back up before you do so. Also,
/dev/sda3 looks like a Windows boot partition, and GParted tends to render them unbootable if it moves them. Thus, you should move that partition using Windows tools. OTOH, Microsoft's standard tools tend to flake out badly on disks with extended and logical partitions, which yours has, so you should be extra careful when using them. Perhaps converting
/dev/sda5 from logical to primary before mucking with the disk with Windows tools would be beneficial; or maybe a third-party Windows partitioning program would be a better choice for moving