LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 07-15-2005, 04:46 PM   #1
MCD_Thom
LQ Newbie
 
Registered: Nov 2004
Location: England
Posts: 21

Rep: Reputation: 15
Partitioning A Full Drive


I currently have my 120Gb Hard Drive full with Ubuntu Hoary and want to split this down to 60Gb so I can install another distro alongside. Is this do-able?
 
Old 07-15-2005, 04:47 PM   #2
shane25119
Member
 
Registered: Aug 2003
Location: ohio
Distribution: Ubuntu 9.04
Posts: 498
Blog Entries: 1

Rep: Reputation: 34
Absolutely. Just use a program like parted (other members please help me out, I don't know many partition programs) to resize your partition. However, if you have more than 60gb on that drive you might loose some data. So, keep your partition size greater than the amount of data on it.

Shane
 
Old 07-15-2005, 04:48 PM   #3
ctkroeker
Senior Member
 
Registered: May 2005
Location: Paraguay
Posts: 1,563
Blog Entries: 1

Rep: Reputation: 50
Yes. Use a program like QTparted to do this. But first make a backup of your Ubuntu stuff.
 
Old 07-15-2005, 04:50 PM   #4
ichi
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 50

Rep: Reputation: 15
fdisk is good too, it's supposed to produce good partition tables. The fdisk man page says cfdisk produces very high quality ones.
 
Old 07-17-2005, 04:07 PM   #5
MCD_Thom
LQ Newbie
 
Registered: Nov 2004
Location: England
Posts: 21

Original Poster
Rep: Reputation: 15
Right, so I downloaded GParted and discovered that I couldn't use it because the hard drive was mounted, so I dug out a linspire live CD that I got free awhile ago and rebooted with that in. I loaded up QParted from it but it still won't let me resize the partition. Help!
 
Old 07-17-2005, 04:23 PM   #6
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: arch, slackware 10.2
Posts: 2,020

Rep: Reputation: 45
Quote:
Originally posted by ichi
fdisk is good too, it's supposed to produce good partition tables. The fdisk man page says cfdisk produces very high quality ones.


but c/fdisk would wipe his data.

it's maybe an option to consider if all else fails and you BACKUP first. you should backup anyway if you are messing around with resizing partitions no matter what you're using. feel free to ignore at your own peril.
 
Old 07-17-2005, 04:27 PM   #7
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 30
Why? It should be possible. Have you tried parted from the command line (from the LiveCD)? I've found that sometimes it works, even when qtpart refuses to do the job.
 
Old 07-17-2005, 07:00 PM   #8
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 45
What we all want is a utility that resizes both the partition and the filesystem it encloses at the same time (or at least from a single command), but what you usually run into when using utilities like parted, qtparted, partitionmagic, etc. is an error message about being unable to proceed due to an unsupported filesystem feature. Been there, done that.

If you try those utilities and they don’t work in your situation, then you can manually break the task up into it’s components: Resizing the filesystem and resizing the partition. And I guarantee that you are not going to like how it’s done.

As always, it is a really, really, really good idea to back up your critical files before resizing a partition/filesystem.


Shrinking a partition/filesystem:

Since the partition will need to be unmounted, boot using something like a Live-CD or a linux rescue CD.

The first step is to downsize the filesystem to a size at least as small, and preferably a little smaller, than the final desired size. For example, if you were using an 120GB ext3-formatted partition on hda1 and your desired final size is around 60GB, you would:

resize2fs /dev/hda1 50000M

to get a 50,000MB-sized filesystem enclosed in a 120GB partition. You will get a message about running e2fsck or fsck the first time you try this.


After the filesystem has been shrunken, run linux fdisk (fdisk /dev/hda), print the layout (“p”) and write down the starting and ending cylinders and the partition number of the partition.

Now comes the unnerving part. Delete the partition (“d”). Contrary to popular belief, this in and of itself does not destroy the filesystem. Now, create a new partition (“n”) that starts at the same cylinder as the old partition, but ends at either a cylinder of your choosing or at +60000M (i.e. 60000MB), that will be bigger than the shrunken filesystem. It is critical that the new partition is not smaller than the filesystem.

Then write the final setup (“w”) or bailout and quit (“q”), which exits without doing anything. From my own experience, the first time you do this, it is very hard to push the “w” key.


Now resize the filesystem to match the new partition size, which for an ext3 partition would be:

resize2fs /dev/hda1

Not specifying a size infers that you want the filesystem to fill all available space in the partition.

As a side note, I have run into cases at this final step where you keep getting the “run e2fsck” message, even after running it and getting no errors. You can force the resizing by running:

resize2fs -f /dev/hda1

Last edited by WhatsHisName; 07-17-2005 at 10:37 PM.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
df says my hard drive is full but its not Trijicon Slackware 7 10-30-2005 05:10 AM
Full USB DRIVE? banner Linux - General 2 09-12-2005 08:18 AM
Drive Partitioning BiPolar Linux - General 8 04-01-2005 12:44 AM
disk drive full? syklone Linux - Newbie 5 09-12-2004 01:48 AM
Partitioning new drive ander45 Linux - Software 1 02-09-2002 04:42 PM


All times are GMT -5. The time now is 07:48 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
Open Source Consulting | Domain Registration