LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-01-2014, 08:30 AM   #1
Aakas
LQ Newbie
 
Registered: Feb 2014
Location: USA
Posts: 5

Rep: Reputation: Disabled
How to delete the created Partition in Linux.


I create the partition with the following name and commands
fdisk /dev/sda -->as the disk is SATA type
-->to diaplay the list of partition
:n -->to create a new partition with certain size
Now anyone please advice me how to delete the partition?
Thankyou in advance.
 
Old 03-01-2014, 08:46 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Easy way is to, as root, use cfdisk; it's a lot easier to see what you're doing than fdisk is. You open a terminal window (or get into run level 3) and
Code:
cfdisk /dev/sda
You'll see something similar to this (yours will not look exactly like mine):
Code:
                                     cfdisk (util-linux 2.21.2)

                                        Disk Drive: /dev/sda
                                 Size: 500107862016 bytes, 500.1 GB
                       Heads: 255   Sectors per Track: 63   Cylinders: 60801

     Name           Flags         Part Type    FS Type              [Label]            Size (MB)
 --------------------------------------------------------------------------------------------------
     sda1                          Primary     ext4                                     15998.17    
     sda2                          Primary     swap                                     15998.17
     sda3                          Primary     ext4                                     20003.89
     sda5                          Logical     ext4                                     20003.89
     sda6                          Logical     ext4                                     20003.89
     sda7                          Logical     ext4                                     20003.89
     sda8                          Logical     ext4                                    100002.96
     sda9                          Logical     ext4                                    100002.96
     sda10                         Logical     ext4                                    188087.48
                                   Logical     Free Space                                   2.62   *

<bunch of space>

      [ Bootable ]  [  Delete  ]  [   Help   ]  [ Maximize ]  [  Print   ]  [   Quit   ]
      [   Type   ]  [  Units   ]  [  Write   ]

                            Quit program without writing partition table
Move the cursor to the partition you want to delete (the line is highlighted) and then move to or type Delete. You will also need to Write the partition table to actually change it.

Read though the manual page before you do this, note that if you delete a partition, it's gone and you won't be able to get back any data that was there easily.

When you're partitioning a drive for Linux it's a good idea to have a reasonable size for the operating system (the distribution software) of at least 15G, maybe 20G would be better -- as time goes on, you'll be adding software that will go into that partition. Create a separate partition for swap spaces (rule of thumb, 2x RAM size), a 20G partition for /home and maybe a couple of others for different purposes (those large ones above are for MySQL/MariaDB and PostgreSQL. Think through your needs before you do the partitioning.

Oh, by the way, you get into run level 3 like this:
Code:
log in as root
init 3
which will reboot the system and you'll have a console screen (no X running). Log in as root (be careful!) and use cfdisk to delete that partition you want gone (it won't be /dev/sda1 or /dev/sda2, those are the root and swap usually). When you're all done, simply enter
Code:
init 6
which will reboot the system to the graphic mode.

Hope this helps some.

Last edited by tronayne; 03-01-2014 at 08:53 AM.
 
1 members found this post helpful.
Old 03-01-2014, 04:17 PM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Can you post output of fdisk -l?
 
Old 03-01-2014, 07:39 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Simply read when you get into fdisk - the prompt is
Quote:
Command (m for help):
If you do that, you find out the command to delete a partition.
 
Old 03-01-2014, 10:24 PM   #5
lahirushanaka
Member
 
Registered: Oct 2012
Posts: 46

Rep: Reputation: Disabled
fidsk -cu /dev/sda

after login to it, read help, then you can delete what ever partition you want
 
Old 03-02-2014, 12:06 AM   #6
Aakas
LQ Newbie
 
Registered: Feb 2014
Location: USA
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks tronayne cfdisk works well.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installed Linux alongside Windows, created partition but it's not being used LinuxNewbieTYLT Linux - Newbie 9 11-04-2012 04:36 AM
Can I delete my Windows partition and re-install without affecting Linux partition? Whatshisface Linux - Hardware 6 07-26-2010 01:18 AM
Delete partition created by YAST trying to install SUSE 9.2 giuliano1 Linux - Newbie 1 05-03-2005 11:14 PM
Linux can't see newly created partition Dswissmiss Linux - Software 5 05-17-2004 08:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration