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 |
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.
|
 |
12-16-2016, 11:07 PM
|
#1
|
LQ Newbie
Registered: Dec 2016
Posts: 4
Rep: 
|
Can't create partitions but have lots of free disk space
I am not exactly a newbie, but this problem has me foxed. I have a system that I setup some years ago, so I don't remember how I did it, but the partition table looks like this:
Quote:
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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
Number Start End Size Type File system Flags
1 1049kB 106MB 105MB primary ntfs boot
2 106MB 315GB 315GB primary ntfs
3 315GB 1331GB 1016GB extended
5 315GB 415GB 100GB logical ext3
6 415GB 431GB 16.0GB logical linux-swap(v1)
7 431GB 431GB 98.6MB logical ext2
8 431GB 1231GB 800GB logical ext3
9 1231GB 1331GB 100GB logical fat32
|
As you see, the various logical partitions 5-9 are inside an extended partition (no. 3). But there is a big chunk of unused space after the end of the extended partition.
parted, fdisk, partition manager all refuse to create a new logical partition because there is no space inside the extended partition. The only option is one primary partition. But I want two new partitions, so I can't use that option.
How can I safely make the extended partition bigger without damaging any of the existing partitions inside it? This is the primary HD of my system, so I am also worried about having file systems mounted, and I may need to boot from a live CD or something.
Any cure will do! Cheers.
|
|
|
12-18-2016, 10:39 AM
|
#2
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
You're going to have to boot off of live media and use a tool like gparted to expand the extended partition. Because your Linux install resides completely inside the extended partition, it is not possible to do this from within the running system. I found a thread on ask Ubuntu that roughly describes the procedure: http://askubuntu.com/questions/59121...nded-partition .
Make sure you heed the advice given in the answers there to back up your data before you try this. Any mucking about with the partition table is inherently risky IMO and contains a non-zero risk of data loss. In fact, if this system contains data you care about, you should be backing it up regularly anyway, since hard drives can and regularly do fail (sometimes very suddenly - don't rely on smartmontools to give you advanced warning!).
|
|
1 members found this post helpful.
|
12-18-2016, 10:51 AM
|
#3
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,778
|
Frankly, I don't know how you did it either. With reference to your partition table, sda3 is the extended partition, which is supposed to equal sda(5+6+7+8+9).
Putting in sizes, sda3 = 1016GB
sda(5+6+7+8+9) = (100+16+98.6+800+100)GB = 1114.6GB
On a sane system, the partitions (totaling 1114.6GB) would be less than, or equal to the extended partition (1016GB)they reside in. Your system fails that basic test, so I can understand why programs are hesitant to operate. Please post the output of in 'Code' tags like this one
Code:
Device Boot Start End Blocks Id System
/dev/sda1 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 14682111 6291456 82 Linux swap
/dev/sda3 14682112 67110911 26214400 83 Linux
/dev/sda4 67110912 468862127 200875608 5 Extended
/dev/sda5 67112960 130027519 31457280 83 Linux
/dev/sda6 130029568 182458367 26214400 83 Linux
/dev/sda7 182460416 468862127 143200856 83 Linux
Code tags are got with the '#' icon. Then we see start & end cylinders. It would appear from the information you have posted that sda7 doesn't exist, and indeed they would add up without it. This might be as simple as verifying that sda7 doesn't exist, then deleting it in fdisk. Can you mount sda7?
|
|
1 members found this post helpful.
|
12-18-2016, 11:07 AM
|
#4
|
Moderator
Registered: Aug 2002
Posts: 26,912
|
Code:
7 431GB 431GB 98.6MB logical ext2
sda7 is 98.6 MB not GB...
I agree that backing important data is a good idea.
|
|
|
12-18-2016, 11:07 AM
|
#5
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,828
|
Quote:
Originally Posted by business_kid
Frankly, I don't know how you did it either. With reference to your partition table, sda3 is the extended partition, which is supposed to equal sda(5+6+7+8+9).
Putting in sizes, sda3 = 1016GB
sda(5+6+7+8+9) = (100+16+98.6+800+100)GB = 1114.6GB
|
Note the units. That "98.6" is Megabytes, not Gigabytes.
|
|
|
12-18-2016, 06:45 PM
|
#6
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,441
|
It is possible to resize partitions online - particulalrly that extended if space exists contiguous to it. Not recommended - gparted liveCD is my go-to.
Show us the output of this instead - shows what (if any) free space exists
Code:
parted /dev/sda "print free"
|
|
|
12-19-2016, 08:52 AM
|
#7
|
LQ Guru
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: One main distro, & some smaller ones casually.
Posts: 5,942
Rep: 
|
I would also point you to man tune2fs, as that could give you a bit more space for files.
|
|
|
12-19-2016, 08:58 AM
|
#8
|
Member
Registered: Dec 2016
Posts: 61
Rep:
|
Hello Camillion,
I recently did something similar, so let me give a heads up and a bit of moral support:
The heads up: when I tried to resize the extended partition using gparted from a live boot of Linux Mint 18, it errored out due to an outdated support program. (Apologies, I didn't take the time to note specifics.) But switching to a live boot of Fedora 25, that has a newer gparted, worked nicely.
I unmounted the /dev/sda swap partitions that were auto mounted by the live boot, resized the extended partition to include the rest of the disk (leaving a little unallocated space at the end because I'm superstitious that way), and was then able to successfully create several more logical partitions.
HTH,
Dave
Last edited by dlb101010; 12-19-2016 at 09:29 AM.
|
|
1 members found this post helpful.
|
12-19-2016, 08:36 PM
|
#9
|
LQ Newbie
Registered: Dec 2016
Posts: 4
Original Poster
Rep: 
|
Thanks all. I am going to try dlb101010's suggestion first, & will report back on the results.
|
|
|
12-20-2016, 12:46 AM
|
#10
|
LQ Newbie
Registered: Dec 2016
Posts: 4
Original Poster
Rep: 
|
dlb101010's solution worked for me.
In brief:
Use a live cd; make sure gparted is recent enough (the version on the fedora cd is 0.27.0).
Disconnect swap partition, which gets mounted by default, with
In gparted from the live boot, expand the extended partition.
Create any extra needed partitions in the newly available space.
Reboot normally, all works fine.
|
|
|
12-20-2016, 09:03 AM
|
#11
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
For the sake of simplicity, you can get a live boot of GParted only (latest version on a minimal Debian image) for this type of situation. It's faster than live-booting a full (large) distro like Fedora.
Glad all worked out for you !
Cheers,
|
|
|
All times are GMT -5. The time now is 11:12 AM.
|
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
|
|