[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


shrinking a partition with parted

Posted on 2006-05-13
Medium Priority
Last Modified: 2013-12-15
I want to shrink a linux ext3 partition and use the new space for a fat32 partition.

So I downloaded a linux CD.
I boot with the CD, and ran parted off the CD.
I typed "print". The logical partition in question goes from 23GB to 39GB. It is partition number 6, ext3.
                       I have about 4.5 GB of data on the partition.
I typed "resize 6 23GB 30GB".
The system does a bunch of work and eventually finishes and gives me a parted prompt.
I type "print" -- there is no change in the table. (Why not?)
I type "mkpts fat32 30GB 39GB". It asks if I want a logical/primary partition. I say logical. It asks for the 30GB and 39GB numbers again -- which is strange. It then says that I cannot have overlapping partitions.

It, of course, says this because the old partition still seems to have the same size. Did I miss something? What am I doing wrong -- or what step did I miss? Do I have to delete the old partition? I'd prefer not to screw over my linux partition.
Question by:rjsurati
  • 4
  • 3
LVL 88

Accepted Solution

rindi earned 2000 total points
ID: 16676486
If your linux Boot cd is knoppix, there is a grafical frontend for parted, QtParted on it. This is much easier to use and it works too.

Author Comment

ID: 16678232
Par your suggestion, I grabbed a knoppix CD. I believe it is version 4.0

It can mount /dev/hda6 with no problem.
 But fdisk and parted and qtparted do not know that /dev/hda exists.

Any thoughts?
LVL 88

Expert Comment

ID: 16680170
Are you root and is the partition unmounted?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 16685188
I am root. I unmounted all the partitions for /dev/hda.

fdisk /dev/hda yielded the error message that /dev/hda does not exist.

parted and qparted don't seem to know about /dev/hda either.

The drive is a standard laptop drive, I presume IDE.

Expert Comment

ID: 16686370
With the disk you are looking to resize partitions on mounted, type in:
cat /proc/partitions
I'm curious to know what it says about /dev/hda.

So, originally you were able to 'fdisk /dev/hda' and get partition info, and now you aren't?  What has changed since the first time you ran fdisk?  

Author Comment

ID: 16687333
I think the error with knoppix was my fault.  I may not have been root in the window that I was running parted.

I tried again, su-ing to root first in the correct window. It worked with no problem. And, parted worked just fine.

Thanks for the suggestion on knoppix.

Author Comment

ID: 16687336
By the way, qtparted crashed on me. But, parted worked just fine.
LVL 88

Expert Comment

ID: 16688031
your welcome

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month19 days, 13 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question