LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can't partition free space from shrunken partition (https://www.linuxquestions.org/questions/linux-newbie-8/cant-partition-free-space-from-shrunken-partition-403121/)

john_b 01-13-2006 07:49 PM

can't partition free space from shrunken partition
 
Hello,
I am having some partitioning problems. Recently I repartitioned my drive to make some space for fedora, setting up a dual debian/fedora boot. After I got that working I shrunk my original hda1 with debian on it to make space for a partition that I wish to share between the two distros. However I can't seem to partition the free space that I made. I even tried moving the swap partition back to see if shuffling the placement of the free space would help. Parted gives different strange output depending on which version I use (i.e. from my distros or off the fedora cd) and fdisk won't even let me think about creating a new partition, claiming there is no free space, although it's 'p' output shows otherwise:

/---------------\
Command (m for help): p

Disk /dev/hda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3291 26434926 83 Linux
/dev/hda2 3292 3422 1052257+ 82 Linux swap / Solaris
/dev/hda3 4315 4327 104422+ 83 Linux
/dev/hda4 4328 4864 4313452+ 5 Extended
/dev/hda5 4328 4864 4313421 8e Linux LVM

Command (m for help): n
No free sectors available
\----------------/

I have even tried running a new fedora install to see if it would partition the free space, thinking I could get rid of fedora later, but it failed. 'disk druid' showed the space as being "free space" but it wouldn't let me use it.

Can anyone give me an idea how to do this. I just want another partition to hold media, etc. that I can share between distros.

Thanks for any help

syg00 01-13-2006 08:10 PM

Due to limitations that we inherit from the (MS-DOS) mists of time, there is only room for 4 entries in the partition table. As a work-around, the extended partition appeared as a container for logical partitions. Allowed for many more usable partitions, but it needs to occupy one of those 4 original slots.

Have a look at your partition list - you have all 4 occupied, and are trying to create another primary.
No go.
If both your systems have LVM support, I guess you could move swap into the LVM you have as hda5.
That would open up a slot in the partition table, and you could (should) use all that space as your shared partition.

pixellany 01-13-2006 11:28 PM

4 entries in the FIRST partition table. If one is extended, then you go to the 2nd partition table--and the 3rd, 4th, etc.---with logical partitions.

On a typical system you can have 60+ sectors with partition tables---for a total of over 200 partitions. For a real trip into the absurd, does anyone know if there is an absolute upper limit?

syg00 01-13-2006 11:55 PM

Quote:

Originally Posted by pixellany
4 entries in the FIRST partition table. If one is extended, then you go to the 2nd partition table--and the 3rd, 4th, etc.---with logical partitions.

ALL those "extra" part tables you mention are the same structure - and have "only room for 4 entries in the partition table." as I said.
Regardless of how many of those entries are actually used.

john_b 01-14-2006 12:42 AM

Thank you very much. I have seen the light. So how about if I trash my swap partition and make an extended partition that holds both swap and the shared logical partitions? I am going to post this before I try but if I understand this should solve my problems.

Thanks again :-)

edit: okay, won't work (see below)

john_b 01-14-2006 02:46 AM

Ugh, sorry... I think I get it now: four primary partitions, only one of which can be extended. I really don't want to get into LVM, just get this done fast and keep it simple. What if I do this:

-remove swap
-move part 3 (the /boot partition for fedora, which is on part 5) to start after part 1
-resize extended part 4 backward to cover the empty space
-add two logical partitions in the space created for swap and shared storage

That would mean my /boot partition for fedora is far away on the disk from the rest of the OS. Is this bad? Sorry I'm so dense; I'll wait to hear an opinion before I try this.

Thanks

syg00 01-14-2006 03:23 AM

O.k., seems we're getting closer to being on the same page... :rolleyes:
Don't worry about the boot partition finding the root - it'll happen.
Of course, after moving everything, you'll need to re-install the boot-loader, and clean up the fstab.

As to your plan, the only other concern I would have is expanding the extended by "lowering" (for want of a better term) the start. The (primary) partition table entry defines the start and size of the (extended in this case) partition. Those "extra" partition table entries pixellany mentioned are all imbedded and relative to the start of the expanded partition.
See my concern ??? - yuck !!!.
I have used cfdisk (note, fdisk won't, or at least didn't, work for this) to expand an extended into contiguous free space higher than the extended - I've not tried expanding like you plan.
Might work, might not.


Nothing, repeat nothing should be attempted without a good backup. I prefer two backups personally.

john_b 01-14-2006 04:43 AM

Thanks for your patience. I think the resizing backward of extended partitions is okay(theoretically). (Can't post links apparently, until I've made 5 posts... :scratch: )

However, now my fedora boot partition #3 won't move. I get:
Error: File system has an incompatible feature enabled.
:cry: A quick google turned up this thread and some problem with 'dir_index':

(will post later)

I'm traveling tomorrow and probably won't have time to get to this for a couple days. Will post when I get something to work.


All times are GMT -5. The time now is 10:05 AM.