LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-16-2016, 11:07 PM   #1
Camillion
LQ Newbie
 
Registered: Dec 2016
Posts: 4

Rep: Reputation: Disabled
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.
 
Old 12-18-2016, 10:39 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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.
Old 12-18-2016, 10:51 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,634

Rep: Reputation: 2393Reputation: 2393Reputation: 2393Reputation: 2393Reputation: 2393Reputation: 2393Reputation: 2393Reputation: 2393Reputation: 2393Reputation: 2393Reputation: 2393
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
Code:
fdisk -l /dev/sda
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.
Old 12-18-2016, 11:07 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,916

Rep: Reputation: 5988Reputation: 5988Reputation: 5988Reputation: 5988Reputation: 5988Reputation: 5988Reputation: 5988Reputation: 5988Reputation: 5988Reputation: 5988Reputation: 5988
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.
 
Old 12-18-2016, 11:07 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,786

Rep: Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216
Quote:
Originally Posted by business_kid View Post
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.
 
Old 12-18-2016, 06:45 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,188

Rep: Reputation: 4130Reputation: 4130Reputation: 4130Reputation: 4130Reputation: 4130Reputation: 4130Reputation: 4130Reputation: 4130Reputation: 4130Reputation: 4130Reputation: 4130
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"
 
Old 12-19-2016, 08:52 AM   #7
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,569

Rep: Reputation: Disabled
I would also point you to man tune2fs, as that could give you a bit more space for files.
 
Old 12-19-2016, 08:58 AM   #8
dlb101010
Member
 
Registered: Dec 2016
Posts: 61

Rep: Reputation: 18
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.
Old 12-19-2016, 08:36 PM   #9
Camillion
LQ Newbie
 
Registered: Dec 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks all. I am going to try dlb101010's suggestion first, & will report back on the results.
 
Old 12-20-2016, 12:46 AM   #10
Camillion
LQ Newbie
 
Registered: Dec 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
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
Code:
swapoff -a
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.
 
Old 12-20-2016, 09:03 AM   #11
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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,
 
  


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] what is a logical partitions and group partitions and how to check disk space on a partition ITareliteralyMyInitials Linux - Newbie 10 02-08-2016 11:19 AM
[SOLVED] No space to create more partitions, but there is free space anon091 Linux - Newbie 35 10-31-2012 10:46 AM
partitions : lots of space is wasted DBabo Linux - General 12 12-13-2009 11:56 AM
Help removing free space to create Raw free space nightmare55 Linux - Newbie 11 10-01-2009 03:07 AM
Lots of disk space missing Tsuroerusu *BSD 7 11-25-2005 07:29 AM

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

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