How to Uninstall Fedora Partitions to create more space for Debian Partiton

My goal is to remove the Fedora partitions to create space for and expand the Debian partition. These are the partitions that I have on my disk currently. I do not need any data from Fedora because I moved it all to Debian.

I believe p1 is the boot partition for Debian, p2 is where Debian is installed, and p3 is a swap partition. I am not sure what p4 is but p5 is where Fedora is installed on a LVM. I have a usb with gparted on it. How should I proceed with removing Fedora?

That you believe the debian partition is some place means you are uncertain and thus to avoid breaking things you must become certain how things are configured.

It would appear that there is an LVM partition which may be p5 and may contain one or more LVs including the one you show as fedora_homeserver-root.

Please post the full output of the following commands as preformatted text by first copy and paste the text, then highlight the pasted text and click the </> button on the text input window toolbar.

sudo fdisk -l
lsblk -f
sudo vgdisplay
sudo lvdisplay

Here are the outputs

sudo fdisk -l

Disk /dev/nvme0n1: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ADATA LEGEND 850 LITE
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8CAA09B1-BC27-4DD6-83B9-ACA9361CA5B2

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048   1050623   1048576   512M EFI System
/dev/nvme0n1p2   1050624 492154879 491104256 234.2G Linux filesystem
/dev/nvme0n1p3 974772224 976771071   1998848   976M Linux swap
/dev/nvme0n1p4 492154880 494252031   2097152     1G Linux filesystem
/dev/nvme0n1p5 494252032 974772223 480520192 229.1G Linux LVM

Partition table entries are not in disk order.


Disk /dev/mapper/fedora_homeserver-root: 120 GiB, 128849018880 bytes, 251658240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdc: 16.37 TiB, 18000207937536 bytes, 35156656128 sectors
Disk model: ST18000NT001-3NF
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 25BB16BB-5E60-5F47-A4E5-FAB32315C3CC

Device           Start         End     Sectors  Size Type
/dev/sdc1         2048 35156637695 35156635648 16.4T Solaris /usr & Apple ZFS
/dev/sdc9  35156637696 35156654079       16384    8M Solaris reserved 1


Disk /dev/sdb: 18.19 TiB, 20000588955648 bytes, 39063650304 sectors
Disk model: ST20000NM007D-3D
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 2912ADCF-C6F5-A647-8CCA-926DEF02EFBF

Device           Start         End     Sectors  Size Type
/dev/sdb1         2048 39063631871 39063629824 18.2T Solaris /usr & Apple ZFS
/dev/sdb9  39063631872 39063648255       16384    8M Solaris reserved 1


Disk /dev/sdd: 16.37 TiB, 18000207937536 bytes, 35156656128 sectors
Disk model: ST18000NT001-3NF
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 5EE9C116-B0D5-A940-A8B8-1B7DA4448635

Device           Start         End     Sectors  Size Type
/dev/sdd1         2048 35156637695 35156635648 16.4T Solaris /usr & Apple ZFS
/dev/sdd9  35156637696 35156654079       16384    8M Solaris reserved 1


Disk /dev/sda: 18.19 TiB, 20000588955648 bytes, 39063650304 sectors
Disk model: ST20000NM007D-3D
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: A301A34B-7AAB-A643-888B-5E93DE8E0253

Device           Start         End     Sectors  Size Type
/dev/sda1         2048 39063631871 39063629824 18.2T Solaris /usr & Apple ZFS
/dev/sda9  39063631872 39063648255       16384    8M Solaris reserved 1

lsblk -f

NAME                       FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                                         
├─sda1                     zfs_member  5000     tank  1325287621727104366                                   
└─sda9                                                                                                      
sdb                                                                                                         
├─sdb1                     zfs_member  5000     tank  1325287621727104366                                   
└─sdb9                                                                                                      
sdc                                                                                                         
├─sdc1                     zfs_member  5000     tank  1325287621727104366                                   
└─sdc9                                                                                                      
sdd                                                                                                         
├─sdd1                     zfs_member  5000     tank  1325287621727104366                                   
└─sdd9                                                                                                      
nvme0n1                                                                                                     
├─nvme0n1p1                vfat        FAT32          4622-7A56                               497.7M     3% /boot/efi
├─nvme0n1p2                ext4        1.0            51f907f2-54a5-4699-a466-2a74a143204e    136.4G    35% /
├─nvme0n1p3                swap        1              62203f48-3a8f-475d-951f-7dcf878f1596                  [SWAP]
├─nvme0n1p4                xfs                        2aff985a-3083-4fcf-b3e6-d32d1d8ceda2                  
└─nvme0n1p5                LVM2_member LVM2 001       7I19LV-MmaO-jv2l-J0KM-wCYJ-9Ui2-7O3ZJn                
  └─fedora_homeserver-root xfs                        bb828c08-fbc2-419d-8e97-413136d92705

sudo vgdisplay

  --- Volume group ---
  VG Name               fedora_homeserver
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <229.13 GiB
  PE Size               4.00 MiB
  Total PE              58657
  Alloc PE / Size       30720 / 120.00 GiB
  Free  PE / Size       27937 / <109.13 GiB
  VG UUID               3Pd7sb-TYYx-qBLB-61bQ-WID4-7JC3-ZLD117

sudo lvdisplay

  --- Logical volume ---
  LV Path                /dev/fedora_homeserver/root
  LV Name                root
  VG Name                fedora_homeserver
  LV UUID                QNOMGt-T9Po-onLl-d0EM-3FH1-VFlQ-F1Yktt
  LV Write Access        read/write
  LV Creation host, time homeserver.lan, 2024-01-19 23:32:07 -0500
  LV Status              available
  # open                 0
  LV Size                120.00 GiB
  Current LE             30720
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

Thank you for the help.

It is clear that /dev/nvme0n1p5 was a fedora LVM partition.
I suspect that since p4 was also an xfs file system it may have been the /boot partition for fedora as well.
The swap partition is already at the end of that drive so it would not interfere with the next steps.

It looks like it may be possible to remove the partitions p5 and p4.
Then simply expand p2 and the ext4 file system to occupy the space that was freed up by removing p4 & p5.

You might be able to use gparted to manage all the arrangements. Usually an ext4 partition and file system can be expanded with no issues using gparted, though it may require that you boot to live media to do that since debian would have p2 mounted and active when booted.

I make no guarantees for the security of your data and as always I suggest a suitable backup before modifying partitions.

1 Like

I was able to remove the partitions and expand the Debian Partition. Thank you for the help.

1 Like