LinuxQuestions.org
Visit Jeremy's Blog.
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 11-11-2017, 09:14 AM   #1
Terry Clarke
LQ Newbie
 
Registered: Nov 2017
Posts: 7

Rep: Reputation: Disabled
Installed Ubuntu multiple times by mistake and can't delete partition with GParted


Hi

First of all I’m a newbie to Linux and I’ve downloaded 14.02 32 bit Ubuntu and upgraded to 16.04 32 bit. Its working fine now but my disk is almost full because I downloaded it twicw (or maybe three times) by mistake.

I got this info from Tereminal using sudo fdisk -l:

Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 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: 0x006c006c

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 63 136884168 136884106 65.3G 7 HPFS/NTFS/exFAT
/dev/sda2 136884222 214972415 78088194 37.2G 5 Extended
/dev/sda4 215896064 234434559 18538496 8.9G 7 HPFS/NTFS/exFAT
/dev/sda5 152602624 210917375 58314752 27.8G 83 Linux
/dev/sda6 210921472 214972415 4050944 2G 82 Linux swap / Solaris
/dev/sda7 136884224 152602623 15718400 7.5G 83 Linux

Partition table entries are not in disk order.
Since there are three Linux entries I presume the /dev/sda5….27.8G partition is the one I did by mistske.

I’m trying to delete it using GParted Partition Editor but having no luck.

When I click my RHM and select Delete I get the following error:

Unable to delete /dev/sda5!

Please unmount any logical partitions having a number higher than 5
Now /dev/sda6 doesn’t have an option to unmount so I did it on /dev/sda7 and got the following error:

Could not unmount /dev/sda7

# umount -v "/"
umount: /: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
I’ve done this a number of times but get the same errrors every time.

Can anyone please help?
 
Old 11-11-2017, 09:38 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
You should use the Gparted live CD to manipulate the partitions.
 
Old 11-11-2017, 09:41 AM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by Terry Clarke View Post
Hi
...
I got this info from Tereminal using sudo fdisk -l:

Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 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: 0x006c006c

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 63 136884168 136884106 65.3G 7 HPFS/NTFS/exFAT
/dev/sda2 136884222 214972415 78088194 37.2G 5 Extended
/dev/sda4 215896064 234434559 18538496 8.9G 7 HPFS/NTFS/exFAT
/dev/sda5 152602624 210917375 58314752 27.8G 83 Linux
/dev/sda6 210921472 214972415 4050944 2G 82 Linux swap / Solaris
/dev/sda7 136884224 152602623 15718400 7.5G 83 Linux

Partition table entries are not in disk order.
Since there are three Linux entries I presume the /dev/sda5….27.8G partition is the one I did by mistske.
Can you run the following command and post the output: (use CODE tags, when you do)

Code:
lsblk
If your not sure how to use CODE tags, see this: https://www.linuxquestions.org/quest...do=bbcode#code

Quote:
I’m trying to delete it using GParted Partition Editor but having no luck.

When I click my RHM and select Delete I get the following error:

Unable to delete /dev/sda5!

Please unmount any logical partitions having a number higher than 5
Now /dev/sda6 doesn’t have an option to unmount so I did it on /dev/sda7 and got the following error:

Could not unmount /dev/sda7

# umount -v "/"
umount: /: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
I’ve done this a number of times but get the same errrors every time.

Can anyone please help?
You can't un-mount the "root" partition while the system is still running. That's why your getting the error message "target is busy".
 
Old 11-11-2017, 10:32 AM   #4
Terry Clarke
LQ Newbie
 
Registered: Nov 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
Can you run the following command and post the output: (use CODE tags, when you do)

Code:
lsblk
I ran the code lsblk as you suggested and got this:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 111.8G 0 disk
├─sda1 8:1 0 65.3G 0 part
├─sda2 8:2 0 1K 0 part
├─sda4 8:4 0 8.9G 0 part
├─sda5 8:5 0 27.8G 0 part
├─sda6 8:6 0 2G 0 part [SWAP]
└─sda7 8:7 0 7.5G 0 part /
sr0 11:0 1 1024M 0 rom
Does this help identify which partition can be safely deleted?

Quote:
You can't un-mount the "root" partition while the system is still running. That's why your getting the error message "target is busy".
Is there a way to un-mount the "root" partition without having the system running?

Last edited by Terry Clarke; 11-11-2017 at 10:34 AM.
 
Old 11-11-2017, 10:43 AM   #5
Terry Clarke
LQ Newbie
 
Registered: Nov 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Keruskerfuerst View Post
You should use the Gparted live CD to manipulate the partitions.
I'm using GParted 0.25.0 GNOME Partition Editor. Is this the wrong software?
 
Old 11-11-2017, 10:49 AM   #6
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
Are you using the Live CD or the installed Gparted in Ubuntu?
 
Old 11-11-2017, 10:59 AM   #7
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by Terry Clarke View Post
I ran the code lsblk as you suggested and got this:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 111.8G 0 disk
├─sda1 8:1 0 65.3G 0 part
├─sda2 8:2 0 1K 0 part
├─sda4 8:4 0 8.9G 0 part
├─sda5 8:5 0 27.8G 0 part
├─sda6 8:6 0 2G 0 part [SWAP]
└─sda7 8:7 0 7.5G 0 part /
sr0 11:0 1 1024M 0 rom
Does this help identify which partition can be safely deleted?
Did you run the command from within Ubuntu?

If so, sda7 is your "root" partition.
If not, please run it from Ubuntu, so we know which partition Ubuntu is using as your "root" partition.

Quote:
Is there a way to un-mount the "root" partition without having the system running?
Yes, as said in posts from other members, you would need to use a "live" CD/DVD/USB.
 
Old 11-11-2017, 11:10 AM   #8
Terry Clarke
LQ Newbie
 
Registered: Nov 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Keruskerfuerst View Post
Are you using the Live CD or the installed Gparted in Ubuntu?
I'm using the installed Gparted in Ubuntu. Can anyone tell me how to obtain, create and use the Live CD in the Ubuntu Application? I'm afraid I'm a complete Newbie :-(
 
Old 11-11-2017, 11:13 AM   #9
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by Terry Clarke View Post
I'm using the installed Gparted in Ubuntu. Can anyone tell me how to obtain, create and use the Live CD in the Ubuntu Application? I'm afraid I'm a complete Newbie :-(
https://gparted.org/download.php

(Under "GParted Live CD/USB/HD/PXE Bootable Image")

https://gparted.org/livecd.php - HowTo on installing it to a USB, etc.
 
Old 11-11-2017, 02:49 PM   #10
DVOM
Member
 
Registered: Nov 2010
Posts: 223

Rep: Reputation: 48
If you've still got the Ubuntu installation media, either DVD or USB, that's got gparted on it. So if you boot to that you'll be able to deal with your partitions.

Edit: Those 3 linux partitions could easily be your root, home, and swap partitions. If that's true then there's nothing wrong with your setup.

Last edited by DVOM; 11-11-2017 at 03:11 PM.
 
Old 11-11-2017, 03:12 PM   #11
Terry Clarke
LQ Newbie
 
Registered: Nov 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by DVOM View Post
If you've still got the Ubuntu installation media, either DVD or USB, that's got gparted on it. So if you boot to that you'll be able to deal with your partitions.
I didnt realise I had to use ISO Image Software to create the boot CD, so wasted a couple of hours there, but now I have it, 'Furious ISO Mount Tool 0,11,3,1', I've created the CD and it loads up on boot.

My problem now is once I boot from the CD, the first screen appears as it should and I select: DParted Live (Default Settings) by pressing enter. It say Automatic boot in 30 seconds. It repeats this sequence every time I press enter, but reloads the original first screen again and again, even when I press esc.

Had enough for today but going to download the ISO file again tomorrow, make a new CD and try it again.

Last edited by Terry Clarke; 11-11-2017 at 04:29 PM.
 
Old 11-11-2017, 06:43 PM   #12
DVOM
Member
 
Registered: Nov 2010
Posts: 223

Rep: Reputation: 48
Quote:
Originally Posted by Terry Clarke View Post
I didnt realise I had to use ISO Image Software to create the boot CD, so wasted a couple of hours there, but now I have it, 'Furious ISO Mount Tool 0,11,3,1', I've created the CD and it loads up on boot.

My problem now is once I boot from the CD, the first screen appears as it should and I select: DParted Live (Default Settings) by pressing enter. It say Automatic boot in 30 seconds. It repeats this sequence every time I press enter, but reloads the original first screen again and again, even when I press esc.

Had enough for today but going to download the ISO file again tomorrow, make a new CD and try it again.
Check your ISO with the MD5 or SHA256 or whatever number. And most CD/DVD burning programs have the ability to burn ISOs correctly. In this circumstance I would definitely try a different one.
 
Old 11-11-2017, 07:23 PM   #13
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,526

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
If you used a DVD/flash drive to install Ubuntu and you still have it/them, you have GParted as pointed out above. Just boot the DVD/flash drive and open a terminal and type: sudo gparted This will open the partition manager.

From the info you posted it appears sda7 is your root filesystem partition and it is only 7.5GB. I'm surprised you were able to install on that small a partition and you will have constant problems with a partition that small if you install any new software or save data to it. Probably better off to start over and create a larger partition or use sda5 which is 27GB.
 
Old 11-13-2017, 05:36 PM   #14
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I would just start over with a custom partitioning set up.

Code:
/boot   500MB
/        30GB
/home   100GB
/usr    100GB
swap      8GB
/data remainder
 
  


Reply

Tags
gparted, installed linux, ubuntu 16.04



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
I've delete dpkg by mistake ! Please help ! siemaeniu500 Linux - Newbie 24 09-16-2012 03:05 PM
Ubuntu 10.04.1 loaded multiple times nowellah Linux - Desktop 2 10-18-2010 02:40 PM
Partition unmounting/deleting issues with GParted Ubuntu 9.04 Thikr Linux - Newbie 8 02-17-2010 01:07 PM
Installed Ubuntu twice, and would like delete one of them newb66 Linux - Newbie 9 09-01-2009 08:21 AM
Installed Ubuntu, ran GParted and have an issue now? fuzzylogic25 Linux - Newbie 2 06-03-2009 11:15 AM

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

All times are GMT -5. The time now is 01:35 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