Resizing ostree ext4 partition without unmount

I am trying to create a new partition on my laptop however, the entire 512 GB of space is taken up by the ostree ext4 partition which is Linux (bootable), on dev/sda2 and it is mounted at filesystem root. It cannot be unmounted as it always has open files running because it is running the operating system. In the disks application I cannot resize this partition as it cannot be unmounted. I have been researching how to still do this while keeping it mounted but although there are a lot of tutorials on how to do this with Linux systems using terminal, everything I have seen hasn’t quite applied to my situation. Please help me to be able to do this. (I do not have much experience using Linux systems so please give me details of steps to perform, thanks.)

Shrinking a existing partition is not that easy as increasing the size. You have to perform a few steps:

  1. Attach a second drive big enough to hold the amount of data you currently use
  2. Boot with a live USB
  3. Backup the entire Filesystem to the Medium attached at step (1)
  4. Destroy the original filesystem and create a new one with smaller sizhe
  5. Format and restore the backup

Let me know if you want to do this lengthy process, i will need a few days to work out a good working tutorial on this.

1 Like

Thank you for such a quick reply (and I have seen one of your previous replies on another question about booting a new OS to replace Endless so I would actually like to ask if I have another option to what I first asked). The reason I wish to resize the partition is because I want to format a partition as NTFS to be able to install Windows 10 (I have a Windows bootable USB) on it. When I boot the computer using the USB it takes me to the installation process but when I choose which partition to install Windows on, it tells me it needs to be NTFS formatted (it is obviously currently ext4 to be Linux bootable) but the option to format the partition is faded out and I cannot select it. Is there a way for me to format the ext4, 512GB partition to be NTFS where it will safely allow me to install windows (I am just worried that if I format it and lose Endless OS, if Windows does not install I will have a laptop which cannot get Windows and won’t work at all with no OS). So essentially, before you would make that lengthy working tutorial (for which just the fact that you would do it I am very grateful) is there an easier way to either replace Endless with Windows or ideally, have both available as booting options taking into account that it will not let me do the formatting with the Windows installation?

If there is no easy way to do this, would it be an option to install a different Linux OS, maybe Ubuntu, and go from there just because it would then be able to install on the current partition with its ext4 format?

Really appreciate your answer and how quickly you replied so thank you!

Hi,

if you have a good working Windows USB Stick (like one created with the Windows 10 Media Creation Tool) then theres nothing to worry when installing Windows 10. The Microsoft Installer is very robust and almost ever brings you to a bootable Windows 10.

One thing i would recommend you is to completely wipe the Disk in the Windows installer before doing the actual installation. Once at the Windows 10 Installer Welcome Screen, press Shift-F10 to get to a command line window. Then run

diskpart

use the command lis dis to show the available disks, then sel dis 1 (or, if you have multiple disks the one you want to wipe), then clean. Now create the Microsoft Structure as follows:

convert gpt
create par efi size=512
create par msr size=100
create par prim
exit

now close the command line window and proceed with the windows installer. Select the large partition during install and everything will be fine.

1 Like

I created the USB using an old Windows 10 ISO (I could not get the October 2018 version so I found another one that was less than 4GB, I think from 2015) and mounting the USB in the Disks application and then copying the ISO files onto the USB. It does begin the Windows installer but encounters the previously mentioned problem so that does mean the USB is perfectly fine, right? I just want to make 100% sure of that :)).
Thank you so much for this help, I don’t know what I would have done without it!

What are potential problems I may encounter doing this method because I am just worried that I do it and then something different happens and I am left with a laptop that I cannot use because this does wipe Endless off the system does it not?

The best way to create a fully working installer for Windows 10 nowadays is to:

  1. Use a Windows Computer at first
  2. Use a big USB stick, partition it with two partitions in the Disk Manager (or with diskpart); I normally use 32 GB sticks for it.
  3. Make the first partition around 8 GB, the second one 24 GB.
  4. Format the first partition with FAT32, the second one with NTFS
  5. Extract the content of the ISO to the NTFS Partition
  6. Extract the content of the ISO to the FAT Partition, excluding \sources\install.wim (which is to large for the FAT32 filesystem as its >4 GB)

Boot with the USB Stick and install Windows. Or, the option i would recommend if possible: Stick with Endless :slight_smile:

1 Like

I do not have access to a Windows computer but I can create the bootable USB in disks on Endless. I cannot use Endless as it does not support the majority of applications I want to use like LTSpice, MatLab, Proteus, Keil uVision etc.
Is the FAT32 partition as a backup for the NTFS partition so that if the NTFS one does not work, you can still try using the FAT32 partition. I should be able to include install.wim as the one I have is less than 4GB.
Sorry to keep asking all these questions but just finally, is it possible to have an NTFS partition with Windows, a FAT32 partition with Windows and still have another partition (ext4 I would assume) with an Endless bootable ISO?

The Problem is as follows:

  • A modern computer uses UEFI instead of a classical BIOS. UEFI needs a FAT32 Boot partition to find and load a Bootloader.
  • FAT32 partitions can only hold files which are smaller than 4 GB.
  • Here’s the problem: The WIndows 10 install.wim is larger than 4 GB. So the process is twofold:
  1. Boot the computer from the USB Stick’s FAT32 partition and load the WIndows installer from there
  2. The Windows installer looks for all partitions to find the install.wim - and finds it on the NTFS Partition (which can hold files of arbitrary size)
1 Like

Okay, that makes sense, thank you.
So the process you detailed above regarding wiping the disk and then creating a partition, it is safe and reliable and should work on any machine correct? I know I am probably being overcautious but I would just like to make sure.

Yes, as long as the Windows 10 Install Stick is OK.

Okay, thank you so much for all of your help! I really appreciate it so much and the Endless Community is lucky to have you on it.

The method worked and I now have Windows successfully installed on my laptop so thank you! However, it appears that many drivers are missing. For example, my mouse doesn’t exist, I cannot connect to any wifi network (they don’t even come up) and I can see in device manager that all of the Other Devices say the drivers are not installed and they all show yellow warning signs with exclamation marks. I know this is an Endless forum but I trust your advice so if you don’t mind, please help me with this.

Just install the wireless drivers provided by the vendor of your Notebook, Windows Update will do the rest in fetching the drivers for your device as soon as a internet connection is available.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.