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-04-2013, 10:19 PM   #1
Grtyop
Member
 
Registered: May 2013
Location: Over the Rainbow..
Distribution: LinuxMint , RedHat
Posts: 31

Rep: Reputation: Disabled
Partioning a single partition into multiple partitions.


Right now, I have a 5GB hard disk with a single partition taking up the entire space of the disk.

Is it possible to split the single huge partition into multiple partitions without deleting the entire single partition ?

Thanks.
 
Old 07-04-2013, 10:50 PM   #2
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbang
Posts: 620
Blog Entries: 1

Rep: Reputation: 140Reputation: 140
Yes it is! But there is always a risk of data loss when partitioning so back-up your important files first.

I use Gparted for partitioning.

Using Gparted, you can shrink the partition to any size that's larger than the used portion of the partition. (you can shrink it from the front or the back, but it's better and faster to only adjust the marker from the back.)

The unallocated space can then be used to create new partitions. Remember that you can only have four primary partitions. If you want more than four, you have to make at least one of your primary partitions an extended partition first.

The most important part is that you cannot repartition a hard drive that is mounted. If you want to repartition the main hard drive, you have to boot from a live CD to do that. I use SystemRescueCD because it already has all the tools included. Some people prefer to use Puppy or some other variant of Knoppix.

But always remember to backup important data first. Accidents do happen, even to the pros.

P.S: Are you sure you mean 5GB and not 500GB?

Last edited by qlue; 07-04-2013 at 10:52 PM. Reason: added post script
 
Old 07-05-2013, 02:05 AM   #3
Grtyop
Member
 
Registered: May 2013
Location: Over the Rainbow..
Distribution: LinuxMint , RedHat
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by qlue View Post
Yes it is! But there is always a risk of data loss when partitioning so back-up your important files first.

I use Gparted for partitioning.

Using Gparted, you can shrink the partition to any size that's larger than the used portion of the partition. (you can shrink it from the front or the back, but it's better and faster to only adjust the marker from the back.)

The unallocated space can then be used to create new partitions. Remember that you can only have four primary partitions. If you want more than four, you have to make at least one of your primary partitions an extended partition first.

The most important part is that you cannot repartition a hard drive that is mounted. If you want to repartition the main hard drive, you have to boot from a live CD to do that. I use SystemRescueCD because it already has all the tools included. Some people prefer to use Puppy or some other variant of Knoppix.

But always remember to backup important data first. Accidents do happen, even to the pros.

P.S: Are you sure you mean 5GB and not 500GB?
Thanks for the reply =)

I am attaching a 5GB virtual Disk to my Linux VM.

However, I already entered some data on the small 5GB disk, and now I wish to try to re-partition it.

The 5GB contains only 1 single primary partition occupying the entire space.

This 5GB disk is mounted to a self created directory. So what i have to do now is to :
1) unmount this 5GB disk
2) Use gparted to access the disk and repartition it ?

On a sidenote, fdisk cannot be used in such a situation right ?
 
Old 07-05-2013, 10:07 AM   #4
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbang
Posts: 620
Blog Entries: 1

Rep: Reputation: 140Reputation: 140
I've never used virtual disks or virtual machines so I'm not sure to what extent it becomes a different issue.
As for fdisk, I've never used that. but for command line you can use parted. (Gparted is just the Gnome gui for parted anyway.)
 
Old 07-05-2013, 03:28 PM   #5
jefro
Guru
 
Registered: Mar 2008
Posts: 11,747

Rep: Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445
A virtual hard drive file can be used in two ways. It can be attached to a host system by some tools so that it might be read but usually not manipulated. The normal way to do tasks on a virtual hard drive file is by booting to either that drive or a different boot media within the VM and then using tools to manipulate it.

For example. Take an iso of gparted or almost any common cd/dvd live image (or rescue image) and boot the VM to it. About all of them boot to a live environment or environment that one can use tools. Fdisk doesn't shrink partitions.

Along this same line one could create another virtual hard drive image and use common tools to partition the new vmhd and format it. Once that is done one could copy over this saved data.
 
  


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
creating multiple user in multiple linux boxes from single remote host niaz_ph Linux - Newbie 3 09-12-2011 03:48 PM
Multiple Distros, Single /boot partition grndrush LinuxQuestions.org Member Success Stories 5 03-09-2011 05:54 AM
How to partition 750g drive into multiple partitions that currently has only linux. bmr Linux - Newbie 6 12-01-2009 09:28 PM
tri boot, fun with partioning, getting swap to NOT take up a primary partition johnsshadow Linux - Software 13 09-25-2008 04:19 AM
Can multiple clients access a single iSCSI partition? psteele555 Linux - Server 6 06-09-2008 07:54 AM


All times are GMT -5. The time now is 03:03 PM.

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