How to remove a partition that I had created?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
thor_odin

How to remove a partition that I had created?

Post by thor_odin »

Hi, recently I had created a partition using GParted. Now I have 2 partitions (sda1 and sda2, sda 1 is boot and both partitions have ext4 file systems). Now I would like to remove the sda2 partition and prefer to have a single partition. I have backed up all the data. How do I do it? Please help me with the steps as I am new to Linux OS. System info - Dell Latitude E6410, 4 GB Ram, Linux Mint Cinnamon 19.3. There is no other OS installed. Please let me know if you require any further info.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
coffee412
Level 8
Level 8
Posts: 2276
Joined: Mon Nov 12, 2012 7:38 pm
Location: I dont know
Contact:

Re: How to remove a partition that I had created?

Post by coffee412 »

From the info that you posted it sounds like you have an MBR partition scheme. To be sure can you post the output of:

Code: Select all

sudo fdisk -l /dev/sda
(That would be a lower case L for -l)


Lets see what your partition layout is.
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
Dell PE T610, Dell PE T710
- List your hardware Profile: inxi -Fxpmrz
MeshCentral * Virtualbox * Debian * InvoiceNinja * NextCloud * Linux since kernel 2.0.36
thor_odin

Re: How to remove a partition that I had created?

Post by thor_odin »

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 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
Disklabel type: dos
Disk identifier: 0xa96f11b3

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 211965951 211963904 101.1G 83 Linux
/dev/sda2 211965952 488396799 276430848 131.8G 83 Linux
User avatar
coffee412
Level 8
Level 8
Posts: 2276
Joined: Mon Nov 12, 2012 7:38 pm
Location: I dont know
Contact:

Re: How to remove a partition that I had created?

Post by coffee412 »

thor_odin wrote: Fri Jan 10, 2020 7:43 am Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 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
Disklabel type: dos
Disk identifier: 0xa96f11b3

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 211965951 211963904 101.1G 83 Linux
/dev/sda2 211965952 488396799 276430848 131.8G 83 Linux
Ok, Its as I thought.

If you remove your partitions then you will lose what is on them. When you reinstall, Since your using an MBR scheme for your system you will always have the two partitions - /boot and the root (/) partitions. If you go UEFI then your going to pick up another partition. You might boot up the live cd and run the install program on it and see. However, Im pretty sure from the last time I did an install.

Why do you want only one partition may I ask?
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
Dell PE T610, Dell PE T710
- List your hardware Profile: inxi -Fxpmrz
MeshCentral * Virtualbox * Debian * InvoiceNinja * NextCloud * Linux since kernel 2.0.36
thor_odin

Re: How to remove a partition that I had created?

Post by thor_odin »

Thanks for your reply!! Having partitions has advantages however I wanted to go back to single partition because I wanted to understand how things work on linux as I believe that the more I can work on it the more I will learn but I wanted to do it with the correct information. I was little confused with regards to MBR.
Now its clarified. On second thoughts I may not go for the single partition and may rather create one more additional partition.
User avatar
AZgl1800
Level 20
Level 20
Posts: 11184
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: How to remove a partition that I had created?

Post by AZgl1800 »

IMO,

the way it is set up now, should be ideal.
this is assuming that sda1 contains all of your install along with the /home data.

I purposely divide my HDD/SSd into 2 paritions.

I then use the 2nd partition as my backup drive.
that is where Timeshift, backintime/Luckybackup, Aptik, all store their backup files.

you may want to give that some thought, before you do away with the two partitions.

Now, what is on sd2 ???
is it of any importance to the operation of your pc?

if not, then format it as ext4 and then set up all of your backup programs like I have mentioned, to use sda2 as their data storage location.


Image
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
jglen490

Re: How to remove a partition that I had created?

Post by jglen490 »

thor_odin wrote: Fri Jan 10, 2020 5:15 am Hi, recently I had created a partition using GParted. Now I have 2 partitions (sda1 and sda2, sda 1 is boot and both partitions have ext4 file systems). Now I would like to remove the sda2 partition and prefer to have a single partition. I have backed up all the data. How do I do it? Please help me with the steps as I am new to Linux OS. System info - Dell Latitude E6410, 4 GB Ram, Linux Mint Cinnamon 19.3. There is no other OS installed. Please let me know if you require any further info.
If you still have your Live Install USB drive, insert the drive and boot from it.

Once in the Live session, open a terminal and enter:

Code: Select all

gparted
It should display both partitions. Highlight /dev/sda2 and delete it. Then highlight /dev/sda1, right click on it and enter or select the full size, DO NOT select the Format box. Make sure the partition is ext4, designated as / , and Save it.

Reboot, remove the Live drive, and when Linux comes up, verify that it's using the full 240GB. It may fsck the full partition as it's booting.

The worst that can happen having to re-install and restore your backup.
ajgreeny
Level 7
Level 7
Posts: 1662
Joined: Mon Nov 19, 2007 3:27 pm

Re: How to remove a partition that I had created?

Post by ajgreeny »

You said one partition is your /boot partition but I think you mean it is the root partition, ie the one containing the complete operating system; a /boot partition is seldom needed unless you have either a server install or an encrypted or LVM partitioning system, which you do not.

As jglen490 says, you should be able to boot to a live USB or DVD, and then use gparted to delete the unused sda2, but check that there'snothing on sda2 first that you need to keep. You should then be able to enlarge the sda1 partition by grabbing the right hand end extending it to the far right of the available space, leaving you with just one main OS partition.
Locked

Return to “Beginner Questions”