Recommendations for disk repartitioning

I have a Dell laptop with UEFI Bios with Win 11 and Fedora 40 on it. I would like to:

  1. Get rid of Windows,
  2. Make a backup of my Fedora installation
  3. Repartition disk to have separate home/data/boot partitions.
  4. Reinstall Fedora and restore backup.

I have never removed Windows from a laptop with secure boot and UEFI. It is unclear to me how to go about repartitioning the disk to make sure that EFI and secure boot continue to work.
There are a number of other Dell specific partitions.

I’m also unsure how best to backup my Fedora installation.

sudo fdisk -l give the following output:

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048   1333247   1331200   650M EFI System
/dev/nvme0n1p2   1333248   1595391    262144   128M Microsoft reserved
/dev/nvme0n1p3   1595392 347955199 346359808 165.2G Microsoft basic data
/dev/nvme0n1p4 470835200 472862719   2027520   990M Windows recovery environment
/dev/nvme0n1p5 472862720 497719295  24856576  11.9G Windows recovery environment
/dev/nvme0n1p6 497721344 500084735   2363392   1.1G Windows recovery environment
/dev/nvme0n1p7 347955200 457164799 109209600  52.1G Linux filesystem
/dev/nvme0n1p8 459261952 470827007  11565056   5.5G Linux swap
/dev/nvme0n1p9 457164800 459261951   2097152     1G Linux filesystem

And lsblk gives:

NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
zram0       252:0    0   7.4G  0 disk  [SWAP]
nvme0n1     259:0    0 238.5G  0 disk  
├─nvme0n1p1 259:1    0   650M  0 part  /boot/efi
├─nvme0n1p2 259:2    0   128M  0 part  
├─nvme0n1p3 259:3    0 165.2G  0 part  
│ └─Windows 253:0    0 165.2G  0 crypt /home/user/documents
│                                      /mnt/Windows
├─nvme0n1p4 259:4    0   990M  0 part  
├─nvme0n1p5 259:5    0  11.9G  0 part  
├─nvme0n1p6 259:6    0   1.1G  0 part  
├─nvme0n1p7 259:7    0  52.1G  0 part  /
├─nvme0n1p8 259:8    0   5.5G  0 part  [SWAP]
└─nvme0n1p9 259:9    0     1G  0 part  /boot

Here’s a screenshot from Gparted:

Questions

  1. I suspect that, after backing up data, I should keep nvme0n1p1 and maybe p2. I’m not sure about p4, p5 and p6. Any ideas?
  2. p3 and p7 should definitely go and be replaced by the new root and home partitions. Should I also delete the boot partition create it again during the installation process?
  3. Should I have a Swap partition or is it better to have a swap file instead?
  4. How do I backup and subsequently restore Fedora?

Thanks for any suggestions and tips.

Looking at your image I would do the following when booted into linux.

  1. remove the efi directory and its content for windows.
    sudo rm -r /boot/efi/EFI/microsoft/
  2. using gparted, remove the following partitions on nvme0n1 p2, p3, p4, p5, & p6
  3. create a new partition for your data in the space now freed up.
  4. While creating the new data partition also resize your fedora partitions should you feel the need.

Partitions p1, p7, p8, & p9 are your fedora partitions. It would not be necessary to do a reinstall unless you truly want to. The root and home subvolumes are part of what is contained in p7.

If you choose to do a full reinstall then (after making a backup of /home) simply do the reinstall and tell it to use the entire drive, which should wipe out all the existing partitions and create new. You could then restore the backed up data and be good to go.

Should you choose to have a separate data partition that is not part of /home you should create that at the time of doing the install since you could make it part of the btrfs file system or a separate partition and file system type if you wish.

Many choose to use the btrfs file system for everything since by default it would cover the entire drive other than what is used for /boot and /boot/efi. Fedora’s default partitioning is pretty standard and easy to use.

I do not use anything for swap on the drive but instead rely on zram for all my swap. Some use cases may require extra swap, but most do not. How you manage that depends entirely on your use.

You can see from your fdisk output that p1 - p3 are before the linux partitions (p1 is the efi partition) and p4-6 are after the linux partitions in order of where they are placed on the drive by looking at the start & end sectors of each partition.

Thanks Jeff V.

  • p3 is the Windows partition where I’m keeping my files (documents, music, etc.). Definitely, I would need to back that data on an external HDD before removing it.
  • p7 is my root partition and it is very full. I need to resize it. Unfortunately, at the moment, the boot partition is exactly after it on disk so I could only increase the size before it.
  • To me, it makes more sense to have the boot partition instead of p2. Would it be possible to, say, create a partition instead of p2 of the same size as the current boot partition, clone the contents and then “fix” EFI to point to the new partition. That would permit me to resize root till the end of the disk without moving the partition.

@entodoays,

Getting rid of MSWindows is great. After working with MS products for many years I personally moved over to Linux exclusively around '96 and have only become more pleased with using computers.

If you go the full reinstall route, which I prefer, it is a great time to do as much cleanup of your storage device as you can. A firmware invoked dell-data-wipe is a starting point I use on hardware that supports it. I also take the time to make sure all firmware is up-to-date and all firmware settings are as desired and as secure as possible (ie: password protect access to settings is highly desirable).

Filling the disk with random data before reinstalling if you are going to use encryped storage is also a good practice and now is an opportune time.

1 Like

Till now I have never used full disc encryption and from what I have read, it can be quite complex to manage. I’m not sure that what I would gain through encryption is worth the effort and possible issues with losing access to my data.

What I gain with encryption (and with the encryption you get with the fedora installer it is NOT full disk, the ESP and /boot will be unencrypted) is a little peace of mind on the off chance my device is stolen.

Even without using encryption the dell-data-wipe (or other storage device cleanup procedure) is useful as there are possible performance benefits as well.

1 Like

I thought I made it clear that my preference would be a full reinstall since you are removing windows entirely.

Other than the need to save your data with a backup the full reconfig is normally managed automatically and everything should be clean.

As mentioned by Stephen the only security issue would be whether you choose to encrypt or not, but few have problems when using encryption as long as they remember the passphrase to unlock during boot. If you do not have the risk of someone getting hold of your device and breaking in encryption may not be required. If you travel a lot with that device it is highly recommended.

I think you are building a mountain out of the molehill when looking at needs.
Simplest – backup and reinstall
Secondary – backup from windows then remove p2 & p3 and expand p7 into the newly freed up space. Remove the /boot/efi/EFI/Microsoft directory and contents.

Fedora apparently is using p1 as the efi partition.

One other possibility and very easy to do would be to boot into windows and shrink the window file system by the size you wish to expand the fedora file system, which can usually be done without data loss. When reducing an ntfs file system windows releases the space at the end of the partition.
Following that then expand p7 into the space left by reducing p3. The 2 partitions are adjacent so it should work flawlessly using gparted.

If you shrink p3 by the amount or more of what is used by your data on windows then you could just copy that data over into your newly enlarged home file system and potentially avoid an additional backup/restore step.

The relative locations of /boot and the btrfs partition is immaterial if you do the manual expansion since fedora already knows where those files are located. If you reinstall it probably would become p2. with p3 as the btrfs partition.

1 Like

Thank you both. Your conversations gave me enough information to proceed with a reinstall when I find the time to go through the process.

I recently removed Windows 10 from a Dell laptop, while preserving my Fedora 40 installation on an external drive… fdisk -l now has:

Device           Start       End   Sectors   Size Type
/dev/nvme0n1p1    2048   1026047   1024000   500M EFI System
/dev/nvme0n1p2 1026048   3123199   2097152     1G Linux extended boot
/dev/nvme0n1p3 3123200 976773119 973649920 464.3G Linux filesystem

Most users don’t need a swap partition. I recommend sticking with Fedora’s default filesystems (BTRFS with root and home subvolumes and zram swap) unless your use case is “special” (such as your separate Data partition). It is easier to troubleshoot if your configuration is close to what others are using.

I keep notes of configuration changes I make in /etc/ along with a list of installed packages, so I can easily create a “clone” on different hardware or restore a fresh install to the previous condition.

I used Gnome Disks to make an images of the important partitions in case of a problem, then gparted to remove all but the EFI System partition, did a fresh install of Fedora 40, then restored /home from a backup. There are still some Windows settings/files in /dev/nvme0n1p1 – the grub2 menu has a Windows entry that will be removed “real soon now” (but is harmless if never selected).

Before removing the Windows partitions it would be good to check how Dell does BIOS updates. I encounter this at the moment with my laptop where on day 0 I removed all that is Windows and now I can’t do a BIOS update since it is only offered as a Windows package. I was still under the impression it would be like years ago where you download a file, place it on a stick and boot from there, but no, also this is taken over by Windows.

I get all my bios updates from fwupd that is installed on fedora i have 2 dell laptops and fedora user long time always bios firmware updates shows up and installs

I did not know this system even exists. Thank you for mentioning it.

Actually you can. Hirens winpe image allows a windows environment from USB to perform those updates. https://www.hirensbootcd.org/

Thank you Jeff, I will look into that.

One final question: As far as I know, one of those recovery partitions is to enable the factory reset capability. Should I want to give the laptop to someone who prefers having Windowz as OS, wouldn’t this partition facilitate things or is it simpler and better to install Windows ex-novo?

Without having a similar installation to test it is truly difficult to answer.
It is certain that removing those parts would interfere with doing a factory reset, but reinstalling windows should be very easy.

However, I cannot envision many situations where you would give the laptop to someone where you would need to be concerned about their potential preferences. Maybe if the recipient were a close family member?

If they received a gift, or if they purchased it, they should be aware of its current condition and not expect you to make it perfect for their preferences. (nor should you necessarily want to invest the effort to do so).

If giving it away is the plan from the beginning then it may be an issue but otherwise why worry about that.