LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-04-2014, 08:31 PM   #1
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Rep: Reputation: 3
Deleting Linux Logical Partitions


I would like to know how to delete an extended logical Linux partition such as /dev/sda5 or/dev/sda6 from my Ubuntu computer. I am providing various partition data below genrated by 'sudo blkid', 'sudo parted -l' and 'sudo fdisk -l'.

/dev/sda5: UUID="24239e68-00a6-4ca6-8cc1-c7f1f421e991" TYPE="ext2"
/dev/sda6: UUID="9508a7a7-7306-4f64-9f0f-077ea15f0124" TYPE="ext4"
/dev/sda7: UUID="8816c492-5934-4303-a241-bd3dd5be005d" TYPE="swap"
--------------------------------------------------------------------
Model: ATA ST380011A (scsi)
Disk /dev/sda: 80.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
2 29.0GB 80.0GB 51.0GB extended boot
7 29.0GB 30.0GB 991MB logical linux-swap(v1)
6 30.0GB 78.4GB 48.4GB logical ext4
5 78.4GB 80.0GB 1600MB logical ext2
--------------------------------------------------------------------

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 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 identifier: 0x0006733e

Device Boot Start End Blocks Id System
/dev/sda2 * 56643582 156301063 49828741 5 Extended
/dev/sda5 153176064 156301063 1562500 83 Linux
/dev/sda6 58580992 153176063 47297536 83 Linux
/dev/sda7 56643584 58578943 967680 82 Linux swap / Solaris

Partition table entries are not in disk order
------------------------------------------------------------------
When I try to umount /dev/sda6 or /dev/sda6, Linux tells me that the device is busy. If I try to delete them via gparted, I am told that they can't be dismounted from mount points / and /var/spool/hylafax/etc.

Any help will be much appreciated.

julianvb
 
Old 09-04-2014, 08:49 PM   #2
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
That means sda6 has an entry in fstab that includes auto-mounting the partition. If you are using gparted that is installed on your system, it cannot dismount the partition. You would need to either boot a live disc to modify the partition or edit fstab so that the partition is not mounted upon boot.
 
1 members found this post helpful.
Old 09-04-2014, 09:11 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
What is purpose of deleting /, your system will be broken. You can move to a primary partition, then remove it.
 
1 members found this post helpful.
Old 09-04-2014, 11:06 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,306

Rep: Reputation: 2693Reputation: 2693Reputation: 2693Reputation: 2693Reputation: 2693Reputation: 2693Reputation: 2693Reputation: 2693Reputation: 2693Reputation: 2693Reputation: 2693
Posting your intentions/goals would be useful and someone may be able to give a suggstion. If you want to remove the system, copy any data you have on it to some other medium and format the partition.
 
1 members found this post helpful.
Old 09-05-2014, 07:28 AM   #5
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Hi, Everyone,

My question reflects my newness to Linux. I thought either /dev/sda6 or /dev/sda5 was created when I attempted but failed to installed Linux Mint 17 about a month ago. In other words, I am trying to remove an unneeded partition. Please excuse my obvious ignorance of Linux.

julianvb
 
Old 09-05-2014, 07:36 AM   #6
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Randicus Draco Albus,

Thanks for the suggestion. I did try to modify the fstab file by commenting out the line involving /dev/sda6 before posting my question. It's clear that my modification wasn't correct or complete and therefore failed.

julianvb

Last edited by julianvb; 09-05-2014 at 07:38 AM.
 
Old 09-05-2014, 07:50 AM   #7
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
That raises more questions than it answers.

Was the Mint installation a second system in a dual-boot set-up with Ubuntu and you want to delete Mint's partitions? If so, why are the partitions being mounted by Ubuntu?

Quote:
It's clear that my modification wasn't correct or complete and therefore failed.
Post your fstab for us to look at.
 
Old 09-05-2014, 11:20 AM   #8
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
3 partitions I would have assumed /, /home & swap.
Can you boot into rescue mode?
Also did you comment the entry out or did you delte it?

After looking at the partition types & UUID's it would appear that the entry you are trying to remove is sda5 which is ext2 & mint most likely ustilizes ext4. But post your fstab to be sure.

Last edited by EDDY1; 09-05-2014 at 11:26 AM.
 
Old 09-05-2014, 08:21 PM   #9
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
2014-09-05
Hi, Everyone,

About a month ago as I was having a GUI problem with Ubuntu 12.04 (which I finally fixed by deleting the .Xauthority file via text mode), I attempted to install Linux Mint 17 with Linux Mint 11 as the only viable resident O.S. on the computer. Even though I didn't succeed in installing Mint 17, Linux created a partition for it any way. That's is how this Mint 17-associated partition came into being.

When I tried and failed in modifying /etc/fstab in order to remove /dev/sda6, simply nothing happened. Here's the original and current /etc/fstab file. To avoid confusion and unnecessary problems, I've discarded my modified version of the file.
--------------------------------------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda6 during installation
UUID=9508a7a7-7306-4f64-9f0f-077ea15f0124 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=22cc3707-a892-448d-9c7d-13e69f11d00f none swap sw 0 0
----------------------------------------------------------------------------------------------------
Is rescue mode the same as recovery mode? If the above information does not suffice, I'll do more probing. Thanks again.

julianvb

Last edited by julianvb; 09-05-2014 at 08:54 PM.
 
Old 09-05-2014, 08:52 PM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
So did you comment out sda5 or sda6, because on first post sda6 matches the sda5 entry in fstab. sda 7 doesn' match the swap from fstab either.
 
Old 09-05-2014, 10:59 PM   #11
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Hi, Everyone,

Here's the latest picture of my Linux computer's partitions at the moment with Ubuntu 12.04 as its sole OS. I hope the data can be of some use.

julianvb

(1) blkid output:

/dev/sda5: UUID="24239e68-00a6-4ca6-8cc1-c7f1f421e991" TYPE="ext2"
/dev/sda6: UUID="9508a7a7-7306-4f64-9f0f-077ea15f0124" TYPE="ext4"
/dev/sda7: UUID="8816c492-5934-4303-a241-bd3dd5be005d" TYPE="swap"

(2) fdisk output:

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 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 identifier: 0x0006733e

Device Boot Start End Blocks Id System
/dev/sda2 * 56643582 156301063 49828741 5 Extended
/dev/sda5 153176064 156301063 1562500 83 Linux
/dev/sda6 58580992 153176063 47297536 83 Linux
/dev/sda7 56643584 58578943 967680 82 Linux swap / Solaris

Partition table entries are not in disk order

(3) parted output:
Model: ATA ST380011A (scsi)
Disk /dev/sda: 80.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
2 29.0GB 80.0GB 51.0GB extended boot
7 29.0GB 30.0GB 991MB logical linux-swap(v1)
6 30.0GB 78.4GB 48.4GB logical ext4
5 78.4GB 80.0GB 1600MB logical ext2

(4) Gparted listing:

Partition File System Mount Point Size used Unused Flags
unallocated unallocated - 27.01GiB - - -
/dev/sda2 extended - 47.52GiB - - boot
/dev/sda7 linux-swap - 945MiB - - -
/dev/sda6 ext4 /, /var/spool/hylaxfax/etc 45.11GiB 13.41GiB 31.70GiB -
/dev/sda5 ext2 - 1.49GiB 1.49GiB 0.00 -

------------------------------------------------------------------------------------------------------------------------------------
I think /dev/sda5 was created when I unsuccessfully attempted to install Linux Mint 17 with Linux Mint 11 running as the only viable OS on my 'dual-boot' computer.
------------------------------------------------------------------------------------------------------------------------------------

Last edited by julianvb; 09-05-2014 at 11:11 PM.
 
Old 09-06-2014, 12:37 AM   #12
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Which 1 did you comment out, did you comment out sda5 or sda6.
can you still mount the 2 partitions sda5 & sda6?
Post /etc/fstab from both but label them.
 
Old 09-06-2014, 11:25 PM   #13
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
2014-09-07
EDDY1,

Nothing happened after I commented out both the sda5 and sda6 lines in /etc/fstab and the /var/spool//hylafax/etc mount-point line in /etc/mtab. However, I later learned that in order for Gparted to modify /dev/sda5 or /dev/sda6 I needed to unmount the linux-swap partition /dev/sda7 via 'swapoff -a'. Indeed, I was able to unmount and then delete /dev/sda6, only to my regret. I underestimated the importance of /dev/sda6 and now deserve to be sent to grub-rescue land! I've restored the deleted partition but grub still boots to rescue mode. My apology to you all. I'll re-post here when I find my way back to grub and not grub-rescue. Many thanks again to you all.

julianvb

Last edited by julianvb; 09-06-2014 at 11:33 PM.
 
Old 09-06-2014, 11:38 PM   #14
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Did the UUID change when partition was restored?
Or did the restored partition change location to sda7?
 
Old 09-07-2014, 02:05 PM   #15
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
EDDY1,

Here's my new report based on my Browser Linux CD, which turns out to be a handy tool. Thanks again.

julianvb

New blkid-output from Browser Linux CD:


/dev/loop0: TYPE="squashfs"
/dev/loop1: UUID="62ecbddf-56f4-4495-9696-0ba697867cd2" TYPE="ext2"
/dev/sda5: UUID="24239e68-00a6-4ca6-8cc1-c7f1f421e991" TYPE="ext2"
/dev/sda6: UUID="8816c492-5934-4303-a241-bd3dd5be005d" TYPE="swap"
/dev/sda7: UUID="c6a171de-d531-4965-9edb-018122283eef" TYPE="ext4"
----------------------------------------------------------------------------
New fdisk-output from Browser Linux CD:

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda2 * 3526 9730 49828741 5 Extended
/dev/sda5 9535 9730 1562500 83 Linux
/dev/sda6 3526 3647 967680 82 Linux swap / Solaris
/dev/sda7 3647 9535 47296512 83 Linux

Partition table entries are not in disk order
----------------------------------------------------------------------------
My interpretation of above data:

New /dev/sda2 is same as /dev/loop1 and old /dev/sda2.
New /dev/sda5 is same as old /dev/sda5, was created for Mint 17.
New /dev/sda6 is same as old /dev/sda7, namely linux-swap partition.
New /dev/sda7 replaces old /dev/sda6 but new UUID is different; old UUID was
reported in an earlier post by me beginning with "UUID=9508a7a7....".

This may be cause of my grub-rescue problem.

Last edited by julianvb; 09-07-2014 at 02:07 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] cfdisk : FATAL ERROR: Bad logical partition 10: enlarged logical partitions overlap riller Fedora 8 05-31-2012 08:17 AM
Change primary partitions to logical partitions AND migrate their data? chickenlinux Linux - Hardware 10 04-04-2010 04:31 PM
Linux does not boot on logical partitions anymore ingmember Linux - Newbie 9 10-27-2009 05:05 PM
how do I add partitions to drives that have Logical Volume (LVM) partitions? The MJ Linux - Software 5 08-17-2006 06:15 PM
How to add logical partitions in linux ? copernicus Linux - General 2 10-21-2003 07:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:02 PM.

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