4

I want to extend my Ubuntu partition. Since Ubuntu partition and the partition from where I will take the space are separated by Ubuntu swap, someone told me that it would be difficult because the partitions are not adjacent. Here is the position of the partitions:

enter image description here

I want to take some space from sda5/D drive. My plan was going to Windows and shrink the D drive. And then, go back to Ubuntu using Gparted to enlarge my Ubuntu partition. But, some said that it is not that easy because sda 6/Ubuntu partition and sda 5 are not adjacent, there is sda7/swap in between.

Can somebody give me appropriate steps to do the safe partition?

UPDATE

I've resized my partition. In the beginning, there was booting issue. The computer failed to boot, but by using boot repair, it can be solved.

However, there is another problem. My swap cannot be activated. I have tried to activate it by using this way (which is not working, or perhaps I made a mistake in making the formulation):

enter image description here

enter image description here

enter image description here One more thing, if I start my computer, this message comes up:

The disk drive for UUID=4517f43c-2509-4d76-bf3f-a802956e0c2f is not ready yet or not present.

If you see the picture above, there is no this kind of UUID in my drive.

So, can somebody help me with these two issues?

4
  • I have edited the update. I hope that's what you meant with /etc/fstab. I posted also the picture of the new partition. Just in case if it is needed. Mar 20, 2015 at 23:20
  • In future it would be better to post file and program output listings as text instead of images, because they're smaller in size and easier to copy and search for. Format those listings as code with the <$> button in the editor toolbar. You can select and copy terminal output, just as you would with other text, or you can redirect it to a file (command &>output.log or command |& tee output.log) or copy it to the clipboard (command |& xclip -selection clipboard). Skip the &, if you don't want to capture the standard error output. Mar 20, 2015 at 23:36
  • Your 2 issues are just 1. The content of /etc/fstab is telling the system that your swap is on a device with UUID=4517...0c2f. It's the last line showing in your screenshot of gedit. Since your swap now has UUID=b42c...58a5, you need to change it in /etc/fstab, save it and reboot. Your command sudo gedit /etc/fstab UUIC... tries to put what you want to edit into the file as a list of files to gedit. Just use sudi gedit /etc/fstab, change the UUID in last line, save, exit and reboot.
    – StarNamer
    Mar 21, 2015 at 0:24
  • You're right. After changing it, no more message. Mar 21, 2015 at 0:30

2 Answers 2

3

This can be solved mostly with GParted from a LiveCD:

  1. You can temporarily disable the swap partition, which GParted should allow you to do through the partition context menu. Otherwise use sudo swapoff /dev/sda7.

  2. Now you can delete the swap partition. This is safe, because (disabled) swap partitions hold no useful data.

  3. Re-arrange and grow your partition(s) as you like, but leave some space for a new swap partition.

  4. Create a new partition in the remaining unallocated space and format it as swap. Commit your changes.

  5. Now you need to edit /etc/fstab to point to the newly created swap partition as described under https://askubuntu.com/a/166110/175814.

    According to your current configuration, you need to change the UUID in the first column of the last line to what you get from blkid for /dev/sda6 (I don't want to transcribe the whole UUID from that image):

    UUID=b42c...  none  swap  sw  0  0
    

    It would be sensible to delete the second to last line (# swap was on…), because the statement in the comment is irrelevant now.

8
  • If I want to take all the sda5 (406.25 GB), should I make unallocated space first (in Windows)? Or I just do it right away? Mar 18, 2015 at 23:08
  • If there's nothing of value (without a backup) on sda5, you can just delete it with GParted. Mar 18, 2015 at 23:48
  • So, after deleting it, sda5 will turn to be unallocated or empty partition (I don't know whether this is a correct term)? Some people told me that better to do resizing or alteration on our partition by doing it first on Windows, and then continuing it on Ubuntu? So, with your explanation, it seems to me, I don't need to do things in my Windows, just do it right away on Ubuntu. Am I right? (By the way, sorry for my English if it's hard to understand. English is my second language). Mar 19, 2015 at 0:45
  • Yes, that's what I'm telling you. The recommendation to use Windows to manipulate partitions pertains to Microsoft's proprietary file system NTFS. If you don't care about the content of a partition, this doesn't matter. If you delete it, it'll vanish and become unallocated disk space no matter the file system. Don't worry about your language skills; though I'm no native speaker myself, I have no difficulties to understand you. Mar 19, 2015 at 0:47
  • 1
    Use the Live CD! While it's possible to grow a mounted ext file system, you'll have a much harder time doing that (at least without knowing well enough what you're doing). Mar 19, 2015 at 2:20
1

It shouldn't be a problem;

Start by shrinking D: from Windows, with disk checks & backups.. Then in gparted, move sda5 to the end (it probably won't be after the shrinking, then shift swap along to meet it, and enlarge sda6 to fill the gap. The partition numbers are however out of order; are you sure that's the order they're actually in? There will be an option to renumber them.

2
  • Unfortunately I can't attach the picture. But, if you want to see it in order to get the detail of the partition, you can get it from here dropbox.com/s/f0xshl6b5lh9xk4/Partition.png?dl=0. Mar 18, 2015 at 6:24
  • Yup, I can see it.. You might be better off deleting sda7 (swap), & re-creating it after the smaller sda5 then moving that up so it goes 6-5-7, but it isn't important. If it bothers you then fdisk has a 'fix partition order' command that can renumber them. I wouldn't if I were you - at least not yet. Mar 18, 2015 at 7:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .