Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
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.
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!
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.