How to remove a partition that I had created?

All Gurus once were Newbies
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. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
thor_odin
Level 1
Level 1
Posts: 3
Joined: Fri Jan 10, 2020 4:19 am

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.

User avatar
coffee412
Level 6
Level 6
Posts: 1057
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
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
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************

thor_odin
Level 1
Level 1
Posts: 3
Joined: Fri Jan 10, 2020 4:19 am

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 6
Level 6
Posts: 1057
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
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
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************

thor_odin
Level 1
Level 1
Posts: 3
Joined: Fri Jan 10, 2020 4:19 am

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
AZgl1500
Level 12
Level 12
Posts: 4328
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 AZgl1500 »

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
Linux Mint 19.3 Cinnamon

jglen490
Level 6
Level 6
Posts: 1000
Joined: Sat Jul 15, 2017 9:57 pm

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.
I feel more like I do than I did when I got here.
Toshiba A135-S2386, Intel T2080, ATI Radeon® Xpress 200M Chipset, 2GB RAM, 500GB

ajgreeny
Level 5
Level 5
Posts: 531
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.

Post Reply

Return to “Newbie Questions”