Long range repartitioning plan

I am planning to do a massive change to my Lenovo X1 carbon laptop’s SSD partitioning to:

  • increase size of /boot/EFT to 2GB
  • increase size of / from 25GB to 50GB
  • increase size of MS-windows from ~78GB to 100GB
  • delete /swap
  • reduce size of /home from 833 GB to about ~798GB (where that is an estimate).

I don’t plan to attempt this until November this year, giving me lots of time to ponder it. Currently my laptop has this:

Device               Size Type
/dev/nvme0n1p1    260M EFI System
/dev/nvme0n1p2     16M Microsoft reserved
/dev/nvme0n1p3    78.1G Microsoft basic data
/dev/nvme0n1p4    25.1G Linux filesystem ( / ) 
/dev/nvme0n1p5    1000M Windows recovery environment
/dev/nvme0n1p6    16.4G Linux swap
/dev/nvme0n1p7     833G Linux filesystem ( / home)

and I am thinking to change it to this:

/dev/nvme0n1p1      2G EFI System
/dev/nvme0n1p2     16M Microsoft reserved
/dev/nvme0n1p3    100G Microsoft basic data
/dev/nvme0n1p4    1000M Windows recovery environment
/dev/nvme0n1p5      50G Linux filesystem (/ )
/dev/nvme0n1p6   ~ 798G Linux filesystem (/home)

Years ago I used gparted live CD (and later USB) to do partitioning (many times), but it has been a very long while since then … and I forgot about this. A recent openSUSE user post is refreshing my memory. Hence i am considering using a gparted liveUSB to do most of the “heavy lifting”.

Current plan (subject to change):

After backing any LEAP-15.6 data (including copy of /boot/efi especially with the Microsof boot aspects) I was thinking to

1. boot to gparted live USB
2. delete all Linux partitions (/dev/nvme0n1p4 ( / ) , /dev/nvme0n1p6 (swap), and /dev/nvme0n1p7 (/home).
3. move  1000M Windows recovery environment - to the end of SSD
4. move  78.1G Microsoft basic data (contains Windows-10) - almost to the end of the SSD (beside 1000M Windows recovery environment)
5. resize  78.1G Microsoft basic data - from 78.1G to 100G
6. reboot and see if MS-Windows can see the increase from 78.1G to 100G. I suspect MS-Windows may complain, but I think it should boot
7. boot to gparted live USB
8. move - 16M Microsoft reserved - almost to end of the SSD (next to 100G MS-Windows) This is to make space for resizing of EFI system
9. increase  EFI system or ESP (another name for it) from 260M to 2G
10. reboot and see if MS-Windows can boot. Again, I think it may complain about the ESP being increased from 260M to 2GB but  I speculate it will work. 
11. boot to gparted live USB
12. move the 16M Microsoft reserved - back next to newly sized 2GB EFI System
13. Move the newly sized 100G Microsoft basic data next to the 16 MB Microsoft reserved
14. reboot and see if MS-Windows can boot.  Again, I speculate MS-Windows will complain but I think it should boot.
15. boot to gparted live USB
16. Move the 1000M Windows recovery environment next to newly sized 100G Microsoft basic data - this should leave a LOT of space at the end of SSD for GNU Linux.  In remaining space:
17. create 50GB space for future ] ' / '
18. create remaining ~798G for future /home
19. install either openSUSE-16.0 in the 2GB (boot/efi), 50GB ( / ), and ~798GB ( /home).

I thought to check here if that makes sense? No hurry for an answer

In the near future I am about to go travelling for a couple of months, and I want to wait until I return before I start hacking away at my laptop’s current partitions. I am rusty on this … and I note I have lots of time before doing this … (some months before I start mainly as I my thinking is to tie this re-partitioning in with my timing for the installation of LEAP-16.0).

I have already created a backup external SSD boot drive on a USB external enclosure, with openSUSE GNU/linux LEAP-15.6, but I prefer not to use such a backup unless I have no choice.

EDIT: clarified ’ / ’ partition and fixed a couple of typos

This looks reasonable.

I did a resize using “gparted” several years ago. And that left the Windows partition corrupted. I had to run CHKDSK under Windows to fix it.

I would first shrink the linux items. Then expand the windows things with windows software such as aoemi.

1 Like

Thanks for the suggestions.

I considered trying to shrink the GNU/Linux partitions. I’ve never tried to ‘shrink’ or ‘expand’ a Linux partition and expect to retain the apps/data but that could be fun to try - except in my case I do not believe it suitable.

Why? In part because I want to expand the /dev/nvme0n1p1 EFI size. To do that means ALL other partitions need to be moved (or deleted).

Further, currently I have a /dev/nvme0n1p5 ( 1000M Windows recovery environment ) sitting between the /dev/nvme0n1p4 ( 25.1G Linux filesystem - / ) and the remaining Linux file systems. That “1000M windows recovery” partition needs to be moved and simply deleting the GNU/Linux swap does not provide enough room.

Frankly, I do not like that “1000M Windows recovery partition” sitting in between GNU/Linux partitions. I believe the only way to prevent that is to either place the “1000M Windows recovery partition” next to the Microsoft partitions (by deleting / ) or to place the "1000M Windows recovery partition at the end of the SSD (deleting both /swap and /home). In any case, it needs to be moved.

I guess I should have mentioned an additional requirement is to have no MS-Windows related partitions sitting in between GNU/Linux partitions.

So my requirements are:

  • increase size of /boot/EFT to 2GB
  • increase size of / from 25GB to 50GB
  • increase size of MS-windows from ~78GB to 100GB
  • delete /swap
  • reduce size of /home from 833 GB to about ~798GB (where that is an estimate).
  • ensure there is no MS-Windows partition in between / and /home partitions

So I think that means I need to do a lot of ‘heavy’ lifting (so to speak) in regards to partitioning movement and resizing.

I may search the internet a bit and compare the advantages of ‘aoemi’ to ‘gparted live USB’.

I confess to having preference as a GNU/Linux user to using gparted. I have not been an MS-Windows user in any meaningful way since 1998. I did have to use MS-Windows at work from 1999 to 2019, but that was as a user with no operating system configuration effort needed. I so rarely use MS-Windows on my computer (maybe a few times per year, typically at tax reporting time) that it is always an incredibly frustrating experience - likely due to my lack of use of MS-Windows (where I have no desire to learn about MS-Windows).

Still, thankyou for the suggestion … I may search the internet a bit and compare the advantages of ‘aoemi’ to ‘gparted live USB’, but if functionality is similar, I am tempted by ‘gparted’.

EDIT: fixed a couple of typos and clarified " / " .

Looking at this, … I may thou only shrink the /home by a large amount (and delete the /swap and /home) and re-install GNU/Linux after moving the MS-Windows partitions.

However given LEAP-16.0 is going to be a pretty big change over LEAP-15.6, I am also tempted to start with a ‘clean slate’ and have a new /home for that installation.

i.e. do this partitioning/installation in late-November or early December, after various bugs (if any) with the released version of LEAP-16.0 are sorted.

I did not read the rest of the thread, but this triggered me to become pedantic :unamused:.

I assume you do not mean /root, but that you mean /.

/root should not be on a separate file system. Changing the home directory of user root from /home/root to /root was done (long ago) specifically to avoid having it on another file system.
Earlier having the home directory of root on a separate file system will make the system un-bootable when e.g. the /home file system can not be mounted for some reason.

1 Like

Yes. I do mean / …

You are correct that my typing / root is misleading. Originally I had typed " / (root) " but I went and edited many places in my planned post where i had brackets, and that made it read bizarre as you have noted.

1 Like

Sorry that I used your topic to post this. I know you most probably just did some mistyping. But I know this error is made sometimes on a more serious base and had led to large confusion in a thread. Can sometimes even lead to dangerous advice when someone with a question and someone with an answer have complete different subjects in their mind.

1 Like

by /root I did mean /

That is nice, but what then do you write when you mean /root?

So when you say: please provide a list of the contents of /root, you do NOT mean

ls -l /root

but you DO mean

ls -l /

Having your personal way off calling names, that deviate from what others use might be rather confusing. Specially if the names that others use are based on facts.

I think you’ve already made your point, Henk. A very valid point, that @tckosvic already got.

Then why does he come back on the already finished exchange between oldcpu and me. About something he may have posted, but that I even did not read (sea my first remark in my post #5).

In any case we are going off topic more and more.

Anyway … I don’t want anyone confused by my inaccurate terminology when labeling the partitioning I am considering. So I edited the above posts of mine (with a comment at the end of each post of mine that I edited).

Now that I have this partitioning planned I have to resist the temptation to proceed.

My laptop (on LEAP-15.6) is running ok now, albeit / is rather short of space, and MS-Windows is so small it struggles to even install its updates. So I really do need to sort this eventually.

However sorting this partitioning now is not timely … I am about to shift my priorities to planning for upcoming global travel. So I have the noted partitioning tentatively planned for a LEAP-16.0 install in late Nov or sometime Dec.

Why would you need to increase the size of the boot/EFI partition?? I just checked mine, it is 295 Mb and only 1.2 Mb is used. That’s not even 1%.

The reason is the move away from grub2 to systemd-boot with FDE which needs more space.
https://en.opensuse.org/Portal:MicroOS/FDE#Migrating_from_GRUB2-EFI

Further to what user hui noted:

That is an excellent question.

While I was planning the partitioning of a 1 TB SSD drive in an external USB enclosure (which is now a ‘portable’ backup hard drive with LEAP-15.6 on it), I had an interesting and educational (for me) and much appreciated exchange with openSUSE users.

It was proposed for me to consider (for future proofing) creating the /boot/EFI partition to be 2-4GB !! I was very surprised, as I had not been keeping up with planned future changes to openSUSE GNU/Linux.

I posted here what I learned:

This still surprises me, but then many things in GNU/Linux surprise me at present.

Despite using GNU/Linux since 1998, the past ~5 years I have allowed myself to get out of date, while GNU/Linux has been moving along. And I am now trying to play catchup.

And on second thougth, I’m not 100% sure, but I think you cann’t just move the MS partition and hope the boot procedure will magically find the Win installation.

I think that is a good question, and I am not certain. I am still researching here.

I suspect the UEFI’s method of finding the ESP is generally unaffected by moving partitions. But as you note, a problem may arise when the bootloaders themselves can’t find their respective operating system files because their internal pointers (which may or may not rely on a partition’s physical location) are no longer correct.

Given this is an EFI system, I too speculate that moving the partitions MS-Windows can also break if its configuration data (BCD store) is no longer valid. I read the BCD store contains information about where the Windows partition is located. I agree moving the partition might cause the bootloader to look for the Windows files in the wrong place. My assumption is I may have to have an MS-windows installation or recovery media (a free download from Microsoft) and use it to rebuild the bootloader for MS-Windows.

I am not an MS-Windows user - so this part will be … fun ? interesting ? annoying ? maybe all three.

I have not researched this yet. I still have time given my ‘late Nov’ / ‘early Dec’ planning.

On the topic of moving the MS-Windows partition in the re-partition planning that i am doing.

Currently on this laptop I note:

lenovo:/boot/efi/EFI/Microsoft/Boot # dir
total 6204
-rwxr-xr-x 1 root root   57344 Jul 23 17:09 BCD
-rwxr-xr-x 1 root root   65536 Jul 16  2021 BCD.LOG
-rwxr-xr-x 1 root root       0 Jul 16  2021 BCD.LOG1
-rwxr-xr-x 1 root root       0 Jul 16  2021 BCD.LOG2
-rwxr-xr-x 1 root root   65536 Oct  9  2024 BOOTSTAT.DAT
drwxr-xr-x 2 root root    4096 Jul 16  2021 Fonts
drwxr-xr-x 3 root root    4096 Jul 16  2021 Resources
-rwxr-xr-x 1 root root  160560 Aug 11  2024 SecureBootRecovery.efi
drwxr-xr-x 2 root root    4096 Jul 16  2021 bg-BG
-rwxr-xr-x 1 root root   11030 Jul  2  2024 boot.stl
-rwxr-xr-x 1 root root 1596920 Oct  9  2024 bootmgfw.efi
-rwxr-xr-x 1 root root 1580016 Oct  9  2024 bootmgr.efi
... etc ....

Just now I read the following on the internet (I have re-written it a bit).

The MS-Windows Boot Configuration Data (BCD) store is located in a file in the /boot/efi/EFI/Microsoft/Boot . It’s a small, binary database file that stores the boot configuration settings and options.

This BCD file contains:

  • The location of the Windows partition.
  • The path to the Windows Boot Loader file (\Windows\System32\winload.efi).
  • Boot menu options for dual-boot systems.
  • Other boot-related settings and parameters.

I read further that the BCD file replaces the older boot.ini file used in BIOS-based systems so to manage the Windows boot process. Tools like bcdboot and bcdedit (on the Recovery Media) are used to create and modify this file.

Purportedly I can go to the MS-Windows web site and download the Recovery Media for Windows 10. Create a bootable USB stick with that Recovery media. After the partitioning on my laptop, I can insert the MS Windows Recovery media into my laptop computer with the moved partition, boot from the USB, and then select the “Repair your computer” option. This is supposed to take me to the Windows Recovery Environment, where supposedly I can access MS-Windows command prompt to use tools like bootrec and bcdboot to fix the boot configuration data.

I have not done this before … so … it will be an experience. As noted, I am not an MS-Windows user , but I want to keep (and even expand a bit) and also move the MS-Windows partition position on the SSD.

I hope to read up more on this in coming months (in between travel planning for my upcoming travel (and maybe more reading after I return).

And hopefully, before Christmas ( lol ! ) I will have this all done with LEAP-16 running on my laptop with far superior partitioning in place.

Just a tip: we are reading of a NVME disk here? So the actual place where data is written is irrelevant and might not even be known to you anyway. No real need to move the Win recovery as long as you have enough room somewhere for your Linux. The need to have contiguous data to avoid excessive head movements and delays doesn’t apply to silicon.
If you prefer an “ordered” layout for peace of mind is another story (and we should not comment on that).