0

UPDATE : I have made it to my desired partition layout and can now resize as needed, many thanks to PonJar for getting me there,

This may not be a very specific question and maybe not relevant to others, but I'll try to keep it reasonable.

I have got myself into a bit of a partitioning trap, my current partitioning scheme of my win10-ubuntu dual-boot laptop (as displayed by the disks app in ubuntu 19.04) is as follows (sorry about the bad attempt at a table).

name:      size:  format:  mount point:  type:                         notes:
/dev/sda1  273mb  fat32    /boot/efi     efi system                    pretty sure this is from the OEM
/dev/sda2  17mb   unknown  not mounted   microsoft reserved            from the OEM
/dev/sda3  315gb  ntfs     not mounted   basic data                    win10 C:
/dev/sda4  250mb  fat32    not mounted   efi system                    I think I made this one while installing ubuntu, I'm not sure why it's not mounted
/dev/sda6  6gb    swap     mounted,none  linux swap
/dev/sda7  177gb  ext4     /             linux filesystem              contains a 75gb /home
/dev/sda5  889mb  ntfs     not mounted   windows recovery environment  from the OEM, not sure why its at the end but numbered sda5

My end goal is to have C:,a separate /home partition and root all next to each other(so I can easily reallocate space in the future), and I want to get there in the safest way possible.

It is my current understanding that to do this I should :

  1. make space at the end of C: in windows
  2. make a /home partition with the new space and migrate /home to the new partition using this method
  3. move root to just after the new /home using Gparted on a ubuntu live usb
  4. shrink root because it no longer has /home
  5. allocate the new free space to C:, /home, and root as I want using Gparted on a ubuntu live usb
  6. repair GRUB if it breaks using this method

I want to make sure I've got the right because it's a large undertaking and I've heard that some of this, especially moving a partitions, can be dangerous and may cause data loss/corruption.

Thanks for reading and considering.

  • 1
    I think you will find sda4 and sda6 are a problem because to my knowledge GParted cannot move a partition past an existing partition to the other side of it but I could be wrong. I’ve certainly never done it. I don’t understand why you have two EFI partitions so perhaps you can get rid of sda4 but that may take some work depending on whether it’s actually doing anything. You can get rid of sda6 by switching to a swap file which will reside in your root partition. Always take backups and use Windows tools on NTFS partitions – PonJar Nov 10 '19 at 23:30
  • 1
    To be ready to repair grub I’d recommend the Boot Repair Disk. It’s very easy to use. Search for it on Google, it will throw up a sourceforge link. I’m pretty certain it includes GParted so you only need to create one bootable disk/usb – PonJar Nov 10 '19 at 23:57
  • 1
    On reflection I’d move swap into a swap file, shrink root and move it to the right so the space created is next to sda6, reformat sda6 to ext4 to become the new home, and expand home into the spare space. Then if “C:” is larger than you want shrink it, move sda4 then move and expand home and or root as desired. It shouldn’t be a big deal to move sda4 about because it’s so small – PonJar Nov 11 '19 at 00:11
  • @PonJar I manually mounted sda4 and it had 14mb used and mounted to a /media/michael/C23D-AA9B, its contents looked efi/grub related.I think sda4 is probably not needed/in use. Also I think this shows how GParted can move partitions. So far I think that your suggestion is the best plan so far. – MichaelB Nov 11 '19 at 20:20
  • @PonJar I looked inside /boot/efi/ (where sda1 is mounted) using nautilus and it was empty, but is disks it says that sda1 has 72mb used. – MichaelB Nov 11 '19 at 20:29
  • 1
    Ok I've had another look at GParted today and it definitely has a clone partition function between two disk drives. That suggests you could move a partition from one side of an existing partition to the other in two operations using a spare drive. I'm not sure if there are any pitfalls with that and so would try it out with a couple of usb thumb drives to see. However if you follow my suggestion this is unnecessary. – PonJar Nov 11 '19 at 23:27
  • 1
    I have also checked out my efi partition of which there is only 1. I run Arch and use systemd-boot. The point of interest is that there is a /efi/microsoft/ folder that contains the microsoft bits. The question is whether or not there is a microsoft folder in either or both of your 2 efi partitions. If its only 1 then you can probably do away with the other and fix any Ubuntu boot problems that arise. However there are some very knowledgeable people on this forum so I'd be inclined to ask another question about getting safely from two efi partitions to one. – PonJar Nov 11 '19 at 23:42
  • 1
    One final point, to clone a partition you don't use Resize/Move. You use the Copy menu item followed by the Paste menu item. For my suggested approach you will only need Resize/Move as per the link you included in the comment above. – PonJar Nov 11 '19 at 23:50
  • @PonJar I don't have a spare drive big enough for coping my partitions so I'm not doing that, also sda1 shows contents in nautilus now (don't know why it didn't before) both efi partitions have /EFI/ubuntu, only sda1 has /EFI/Microsoft also sda1 has a /EFI/Boot, but sda4 has /EFI/BOOT both have the same files in them, is that important? – MichaelB Nov 12 '19 at 00:08
  • 1
    Sounds like there is a good chance you don’t need sda4 and that it got created at some point in the history of your Ubuntu install. If you have a USB key you should be able to clone sda4 to the key and also copy the directory structure to somewhere convenient under home. Then just delete sda4 and see what boots. As long as you have an Ubuntu install disc/usb you should be able to recover the ability to boot or restore sda4 if necessary. Do you have a backup of your entire installation? It’s always advised to make one before making changes like this. – PonJar Nov 12 '19 at 00:59
  • @PonJar I don't have the space for a full system backup, but I will backup important stuff before doing anything drastic. could I just rename the base folder in sda4 (to make it easy to restore)? – MichaelB Nov 12 '19 at 22:04
  • 1
    If all the files on sda4 are within folders then I’d say yes, that’s a good test. I’m sure there’s a lot you don’t need to back up. It’s certainly convenient to back up a whole disk if you have somewhere to place it but not essential if you’ve saved off your important data. I redistributed the space on my dual boot setup recently and had no data loss or boot issues. Good luck! Would be good to hear how it goes. – PonJar Nov 13 '19 at 13:35
  • 1
    Just remembered an issue I had with shrinking the Windows partition. It complained of unmovable files stopping me shrink as far as I wanted to. What you have to do is temporarily turn off hibernation, page files or system protection. One or more of these can constrain the amount you can shrink. Just turn them back on again when when you are finished and the immovable files will be created in a different position, although you will lose old restore points. – PonJar Nov 14 '19 at 00:08
  • @PonJar Update sda4 and sda6 are history and everything work fine, I will be shrinking C: today, I am aware of the windows hassle, but thank you anyway. – MichaelB Nov 14 '19 at 18:31
  • Good to hear. :) – PonJar Nov 14 '19 at 21:30
  • @PonJar I made it to my desired state, just a bit of cleanup now (stuff like getting fire fox history back, it got lost in the rsync). – MichaelB Nov 16 '19 at 02:31
  • 1
    Great! It’s good to plan and research like you did – PonJar Nov 16 '19 at 21:16

0 Answers0