LinuxQuestions.org
Visit Jeremy's Blog.
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 07-10-2009, 12:53 AM   #1
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Rep: Reputation: 15
How to divide a partition into two parts?


Hi All,
I am having a big /home partition. I need to make it small and create one more partition from it which will be used for some other purpose. Can you tell me please how to do it?
I searched on google and found some methods which were very different from each other.I don't know which one is good, so, I thought I will ask you experts before doing anything. Please tell me how would you do this partitioning job?
NOTE: there is no need to protect the data written in /home
 
Old 07-10-2009, 01:01 AM   #2
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
I always use gParted http://gparted.sourceforge.net/livecd.php
 
Old 07-10-2009, 01:11 AM   #3
peeths003
Member
 
Registered: Jun 2008
Distribution: Fedora 12 i686, Debian 5.0.1 i686, Fedora 14 x86_64, Debian Lenny 5.0.1x86_64 and CentOS_5.4_x86-64
Posts: 311

Rep: Reputation: 32
I would also suggest the same , use gparted and free some space in the /home partition . and then mount it for other use.

Cheers
Peeths
 
Old 07-10-2009, 01:43 AM   #4
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
Hi !
I saw the link which you have posted. It tells to make a Live CD first. But, can it be done without that? I mean, by using instructions like umount,fsck, fdisk resize2fs(you know better which ones to use in this case)?
 
Old 07-10-2009, 01:50 AM   #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
If you're not worried about the data, fdisk will do it; need to be root.
 
Old 07-10-2009, 03:12 AM   #6
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by chrism01 View Post
If you're not worried about the data, fdisk will do it; need to be root.
Since I am new to this thing, can you please explain me how fdisk should be used? I mean what instructions will you give in your terminal when logged in as root? Do we have to first unmount and then delete it? I don't want to crash my system, so can you tell me how is it done step by steep? I have already crashed it before in attempt to partition it
 
Old 07-14-2009, 03:51 AM   #7
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
Hi All,
Seeing the complexity of this doing in command line( I am new), I decided to do it by GParted as all of you suggested at first. I saw that I have 1 GB free space as "unallocated", I tried to create a new partition.But it said that I need to create an extended partition first and for doing this, I will need to delete a primary partition ! Now the things become complex for me again

Here is how my partitions look:

device boot start End Blocks id system

/dev/sda1 1 262 2104483+ 82 Linux swap/solaris

/dev/sda2 * 265 2743 19928632 83 Linux

/dev/sda3 2874 8748 47190937 83 Linux

/dev/sda4 8749 9720 7807590 83 Linux


Here is how it is mounted
/dev/sda1 swap

/dev/sda2 /

/dev/sda3 /home (I want to make it smaller and create one extra partition out of it)

/dev/sda4 /mnt/point1 (This is another Distro Linux from scratch.)
 
Old 07-14-2009, 03:52 AM   #8
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
Hi,
I have made the /home partition smaller using GParted. But when I tried to create one more partition, it tells me that it cannot create more than 4 primary partitions. I need one more partition.What should I do now?
 
Old 07-14-2009, 06:50 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Confusing set of things here....

First, you don't "split partitions". As you have already seen, you can resize one or more partitions to create empty space, and then create new partitions.

If you have used all four primary partitions, then you need to create logical partitions to make more. (Linux does not care about primary vs. logical) In GParted, you can create the extended partition first---be sure to make it big enough to hold all future changes**, since some partitioning tools will not let you change it.

fdisk does not resize partitions, nor does cfdisk. To use these tools, you would have to delete the existing partitions and create new ones. (Save data first)


**Normally, if you already have 4 primaries, you would want to make the extended partition fill most or all of the remaining disk space. The only reason not to do this would be to allow future expansion of one of the primaries. This, however, may require moving partitions to allow others to be expanded-----thus a bit higher risk of losing data. The easy solution is to have BIG drives, oversized partitions, and lots of empty space. "Brute force" IS often the best answer.
 
Old 07-14-2009, 11:56 PM   #10
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
Thanks for the advice. According to your post, I have understood that an extended partition is like a big container within which we can make many smaller containers.
So, here is what I plan to do. I will delete the /home (/dev/sda3) partition to make a big empty space. Then I will make an extended partition called /extd (it will become /dev/sda3)(I have thought this name for it). Then I will create the following logical partitions:
/dev/sda5 /home
/dev/sda6 /embedded (this will be the name of the partition in which I am going to put embedded linux distro)

Is it a correct and safe way to solve this problem? I will proceed only if any linux master gives me a go ahead signal because I don't want to crash again.Thanks.

Last edited by LinuxNewman; 07-15-2009 at 02:49 AM. Reason: forgot to give name of partition
 
  


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
How to divide a partition in 2 partitions? rakeshj Linux - Software 12 08-12-2007 05:04 PM
to divide ext3 partition czezz Linux - Software 6 08-10-2007 04:26 AM
divide job sunkitty Linux - Newbie 2 05-10-2007 12:33 AM
cant divide with C skoot Programming 23 08-26-2005 06:50 PM
Divide a file into 2 parts bmbsa Linux - Newbie 3 08-13-2003 04:08 PM

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

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