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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
09-04-2014, 08:31 PM
|
#1
|
Member
Registered: Apr 2009
Posts: 390
Rep:
|
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
|
|
|
09-04-2014, 08:49 PM
|
#2
|
Senior Member
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
|
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.
|
09-04-2014, 09:11 PM
|
#3
|
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841
|
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.
|
09-04-2014, 11:06 PM
|
#4
|
LQ Guru
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,306
|
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.
|
09-05-2014, 07:28 AM
|
#5
|
Member
Registered: Apr 2009
Posts: 390
Original Poster
Rep:
|
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
|
|
|
09-05-2014, 07:36 AM
|
#6
|
Member
Registered: Apr 2009
Posts: 390
Original Poster
Rep:
|
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.
|
|
|
09-05-2014, 07:50 AM
|
#7
|
Senior Member
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
|
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.
|
|
|
09-05-2014, 11:20 AM
|
#8
|
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841
|
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.
|
|
|
09-05-2014, 08:21 PM
|
#9
|
Member
Registered: Apr 2009
Posts: 390
Original Poster
Rep:
|
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.
|
|
|
09-05-2014, 08:52 PM
|
#10
|
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841
|
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.
|
|
|
09-05-2014, 10:59 PM
|
#11
|
Member
Registered: Apr 2009
Posts: 390
Original Poster
Rep:
|
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.
|
|
|
09-06-2014, 12:37 AM
|
#12
|
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841
|
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.
|
|
|
09-06-2014, 11:25 PM
|
#13
|
Member
Registered: Apr 2009
Posts: 390
Original Poster
Rep:
|
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.
|
|
|
09-06-2014, 11:38 PM
|
#14
|
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841
|
Did the UUID change when partition was restored?
Or did the restored partition change location to sda7?
|
|
|
09-07-2014, 02:05 PM
|
#15
|
Member
Registered: Apr 2009
Posts: 390
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 09:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|