LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 05-18-2010, 08:46 PM   #1
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Rep: Reputation: 32
Increasing the size of an extended partition to allow the creation of a new partition


Hello there

I've got a server that needs more space. To achieve this we added space (by extending the VMware disk attached to it).

Normally this isn't an issue, because we just add an new partition and LVM it from there, but this host predates our deployment of LVM everywhere.

Thus i'm facing this issue:

Code:
Command (m for help): p

Disk /dev/sda: 204.0 GB, 204010946560 bytes
255 heads, 63 sectors/track, 24802 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          16      128488+  83  Linux
/dev/sda2              17         538     4192965   83  Linux
/dev/sda3             539         799     2096482+  82  Linux swap / Solaris
/dev/sda4             800       18275   140375970    5  Extended
/dev/sda5             800        1060     2096451   83  Linux
/dev/sda6            1061        1321     2096451   83  Linux
/dev/sda7            1322        1582     2096451   83  Linux
/dev/sda8            1583        1843     2096451   83  Linux
/dev/sda9            1844       18275   131990008+  83  Linux

Command (m for help): v
104871377 unallocated sectors

Command (m for help): n
No free sectors available
Our current theory is that the unallocated sectors can not be assigned because they aren't part of the extended partition, and thus ... we go in a circle.

So what i believe the way forward is to extend sda4 so that i can then create an sda10 inside of it. Anyone have any ideas on how to do this? I was thinking gparted may do the trick ... but being a server i'm in runlevel3, with no X...

Cheers
chakkerz
 
Old 05-18-2010, 08:57 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,353

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
gparted wil certainly do it, but here's a trick using cfdisk.
Allocate a new logical to occupy all that space - that will extend the extended. Then delete the new logical.

Tada ...
 
1 members found this post helpful.
Old 05-18-2010, 10:03 PM   #3
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Original Poster
Rep: Reputation: 32
Too easy.

So I:
- installed cfdisk,
- created a new partition using the unallocated space;
- took the warning about dataloss serious (for once) and thus took a snapshot of the vm;
- wrote the partition table to disk;
- verified that what i wanted to see was happening using fdisk:
Code:
[root@tangelo ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 24802.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 204.0 GB, 204010946560 bytes
255 heads, 63 sectors/track, 24802 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          16      128488+  83  Linux
/dev/sda2              17         538     4192965   83  Linux
/dev/sda3             539         799     2096482+  82  Linux swap / Solaris
/dev/sda4             800       24802   192804097+   5  Extended
/dev/sda5             800        1060     2096451   83  Linux
/dev/sda6            1061        1321     2096451   83  Linux
/dev/sda7            1322        1582     2096451   83  Linux
/dev/sda8            1583        1843     2096451   83  Linux
/dev/sda9            1844       18275   131990008+  83  Linux
/dev/sda10          18276       24802    52428096   83  Linux
- and made the system see the partition using partprobe:
Code:
[root@tangelo ~]# ls /dev/sda*
/dev/sda   /dev/sda2  /dev/sda4  /dev/sda6  /dev/sda8
/dev/sda1  /dev/sda3  /dev/sda5  /dev/sda7  /dev/sda9
[root@tangelo ~]# partprobe
[root@tangelo ~]# ls /dev/sda*
/dev/sda   /dev/sda10  /dev/sda3  /dev/sda5  /dev/sda7  /dev/sda9
/dev/sda1  /dev/sda2   /dev/sda4  /dev/sda6  /dev/sda8
[root@tangelo ~]#
Once again, thanks
 
Old 05-18-2010, 10:08 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,353

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
Didn't notice you were in Brisbane - I could have dropped in and done it for you.
 
Old 05-18-2010, 10:18 PM   #5
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Original Poster
Rep: Reputation: 32
too late now next time
 
  


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
Increasing Partition Size BrianPritchard Ubuntu 6 06-22-2009 10:27 AM
Increasing size of / partition. p_s_shah Linux - Server 4 11-20-2008 06:21 PM
increasing partition size Don Powell Linux - Hardware 3 06-23-2005 09:14 AM
Increasing partition size?? petey *BSD 5 04-25-2002 07:24 AM
Increasing Partition Size? petey Linux - General 1 04-24-2002 11:33 AM


All times are GMT -5. The time now is 11:10 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration