1

I have dual booted with Windows, I have allocated Windows for 180GB and For Ubuntu 46GB. Recently I wanted to increase Linux root partition hard drive space and I shrink from windows and unallocated space created.

enter image description here

Now I cannot shrink it to boot partition of Linux, Whenever I tried to click resize/move on /dev/nvme0n1p4 it simply says there is no unallocated space to add.

enter image description here

I tried Gparted live boot also, I get the same response. Now I want to merge all the unallocated to space to my Linux root partition(/dev/nvme0n1p4) how to do it?

And Why am I having 3 separate unallocated space? Can I not merge them to single?

root@tom-linux:/home/tom# resize2fs /dev/nvme0n1p4
resize2fs 1.43.4 (31-Jan-2017)
The filesystem is already 12207104 (4k) blocks long.  Nothing to do!
Thamaraiselvam
  • 133
  • 2
  • 10
  • 2
    First, the reason it's not letting you extend your Linux partition is because there is no unallocated space immediately after your Linux partition. (You can only extend a partition if there is free space right after it, unless you're using LVM). Second, no, you cannot merge all the unallocated space together unless you're using LVM. – You'reAGitForNotUsingGit May 07 '17 at 21:24
  • 2
    @Alban - Moving partitions is bad idea to begin with, and it's an extremely bad idea on an SSD, as moving partitions will use up tons of write cycles. Not to mention it may also cause the drive to overheat, given that the OP is using a tiny NVME drive. Finally, (and this is true even with a HDD), moving partitions is a very risky operation that may result in data loss. TL;DR: do not move partitions, especially on an SSD! – You'reAGitForNotUsingGit May 07 '17 at 21:26
  • @AndroidDev So Should I install LVM now? – Thamaraiselvam May 07 '17 at 21:29
  • 2
    @Thamaraiselvam You can't simply just run a command to "install" LVM. If you want to use LVM, you will need to format the entire drive and reinstall everything from scratch. Not to mention, Windows doesn't even support being installed on LVM. So no, you probably don't want to use LVM... – You'reAGitForNotUsingGit May 07 '17 at 21:31
  • resize2fs shows some error is that normal ? please check my bottom of my question – Thamaraiselvam May 07 '17 at 21:31
  • Thanks, @AndroidDev got you. So now can I not change resize the root partition now? – Thamaraiselvam May 07 '17 at 21:32
  • 2
    @Thamaraiselvam You could delete your swap partition, and extend the root volume into the unallocated space, leaving just enough unallocated to recreate the swap partition at the end. – You'reAGitForNotUsingGit May 07 '17 at 21:36
  • Awesome. @AndroidDev thanks, dude. It worked. When I delete swap then unallocated space created after my root partition. – Thamaraiselvam May 07 '17 at 21:41
  • @AndroidDev: May I ask why moving partitions is a bad idea to begin with? Also, write cycles in that order of magnitude shouldn't be an issue with modern flash cells and controllers. You should be able to overwrite the whole drive a few million times at least before the reserve cells are used up. – David Foerster May 07 '17 at 21:41
  • @Thamaraiselvam - Shall I write an answer then? – You'reAGitForNotUsingGit May 07 '17 at 21:54
  • Yep go head dude. – Thamaraiselvam May 07 '17 at 21:55
  • @AndroidDev Please write answer, I will mark it . You saved my time and clearly explained – Thamaraiselvam May 08 '17 at 05:51
  • @Thamaraiselvam - I will, I just haven't gotten around to it yet :D – You'reAGitForNotUsingGit May 09 '17 at 01:11

1 Answers1

3

It appears that your goal is to provide more space on your / mounted partition. AndroidDev has done a fine job explaining why a number of options aren't a good fit for you in the numerous comments.

I can offer you a viable alternative solution however:

Any large directory in your / mounted partition can be copied to a new partition created in your unallocated space.

You can find an appropriate candidate by using Disk Usage Analyzer AKA Baobab. Compare the space used by the files there with the size of your unallocated space. If the unallocated space is larger, You can simply create a new partition in the unallocated space, move the content of the large directory there, freeing up space on your / parition and then mount the newly created partition at the source directory.

If anything about this answer is unclear or you need assistance in it's application, feel free to drop me a comment and I'll do my best to clarify/assist.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
  • Thanks, @Elder Geek, I have already fixed it with Android Dev's help. Just created unallocated space near that drive then it worked. Also Live booted GParted so I could unmount primary partition and resized it – Thamaraiselvam May 09 '17 at 08:02
  • 1
    @Thamaraiselvam I'm glad you got it sorted! :-) – Elder Geek May 09 '17 at 13:08