LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-14-2009, 05:13 AM   #1
skn
LQ Newbie
 
Registered: Aug 2009
Posts: 12

Rep: Reputation: 0
Splitting partition - need help


Hello

I am trying to split a partition in two, because i need the free space for another folder. I wanted to avoid rebooting the machine, so I have tried to do it without any partition parograms. The machine is running Red Hat Enterprice linux 5.
I found some usefull information here: http://home.comcast.net/~dckrinke/jan_02_linux.html
I got trough most of it, but got stuck at the end.


The target is /dev/sda2
Code:
Disk /dev/sda: 64 heads, 32 sectors, 17365 cylinders
Units = cylinders of 2048 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1        50     51184   83  Linux
/dev/sda2            51      9050   9216000   83  Linux
/dev/sda3          9051     11458   2465792   83  Linux
/dev/sda4         11459     17365   6048768    f  Win95 Ext'd (LBA)
/dev/sda5         11459     14530   3145712   83  Linux
/dev/sda6         14531     16578   2097136   82  Linux swap
/dev/sda7         16579     17034    466928   83  Linux
I started by doing a lazy unmount and then used resize2fs to shrink the partition to 2,7GB. Then I deleted the partition using fdisk and created a new one from cylinder 51 - 2765.

The problem is that now I can't create a new partition with free space (cylinders 2766 - 9050).
It will only allow me to create a new partition from cylinder 17035 - 17365.

It this an impossible mission?
 
Old 08-14-2009, 07:38 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,354
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
By default a DOS-compatible disk only handles four primary partitions. You have three and the extended partition makes four. You deleted one primary partition and created one primary partition so now you can only created a new logical partition.
 
Old 08-17-2009, 04:49 AM   #3
skn
LQ Newbie
 
Registered: Aug 2009
Posts: 12

Original Poster
Rep: Reputation: 0
It wont let me create a logical partition with that 5GB.
I solved my problem in another way:
1. I shrunk sda5
2. Moved the swap disk sda6
3. Resized sda7 where i originally needed the extra free space.

I still cant use the 5GB, but I got 1,6GB where I needed it.
 
Old 08-17-2009, 09:56 AM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
You would have to move sda3 to the left so that it takes up the free 5GB. Then you can shrink sda3 to restore it to its original size, which would leave you with 5GB free after sda3. This can be used by moving your logical partition 5GB to the left so that the 5GB now becomes available for a logical partition.
 
Old 08-17-2009, 06:25 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
BTW, in RHEL, after you have used the 'w' cmd to write the new partition table to disk, you can exit fdisk and run 'partprobe', which will force the kernel to read/start using the new partition table without a system reboot.
 
  


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
Splitting sound puntjuh Linux - Hardware 3 07-29-2006 07:30 AM
splitting strings basher400 Linux - Newbie 6 04-12-2005 02:24 AM
Help! Splitting 1 large partition into 3! sh1ft Linux - Hardware 2 06-30-2004 09:04 AM
splitting a vfat windows partition zLinuxz Linux - General 3 10-07-2002 11:14 AM
Splitting my 6o Madmanator Linux - Newbie 1 01-03-2002 11:21 PM

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

All times are GMT -5. The time now is 05:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration