Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
partition table problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
themoebius
Tux's lil' helper
Tux's lil' helper


Joined: 10 Mar 2004
Posts: 117

PostPosted: Mon Dec 13, 2004 9:46 am    Post subject: partition table problems Reply with quote

I want to resize my ext3 partition so I can make a windows partition on the second half of the disk. I've tried parted and partition magic and they both seem to be having problems with the partition tables. Partition magic (launching off the CD) says "Partition Table Error #110 found." And when I try to resize the partition it gives me this message: No Implementation: This ext2 filesystem has a rather strange layout! Parted can't resize this (yet)." Note that it says ext2 even though it's an ext3 filesystem. I've tried using the rescue function in parted, no change. I tried opening the disk with fdisk and re-saving the partition table, no change, but I don't know if it really re-saved it because I didn't make any changes to it. When I use the verify partition tables option in fdisk, all it says is "62 unallocated sectors". Yet if I try to add a partition it says "no available sectors".

When I'm booting linux every time it says errors were corrected in hda3 (the main data partition and the one I want to resize).

What can I use to detect any problems in the partition tables and correct them? Or how to I rebuild the partition tables without losing any of my data?

Thanks.
Back to top
View user's profile Send private message
nyteryda
Guru
Guru


Joined: 26 Jul 2003
Posts: 337
Location: London

PostPosted: Wed Dec 15, 2004 11:15 pm    Post subject: Re: partition table problems Reply with quote

themoebius wrote:
I want to resize my ext3 partition so I can make a windows partition on the second half of the disk. I've tried parted and partition magic and they both seem to be having problems with the partition tables. Partition magic (launching off the CD) says "Partition Table Error #110 found." And when I try to resize the partition it gives me this message: No Implementation: This ext2 filesystem has a rather strange layout! Parted can't resize this (yet)." Note that it says ext2 even though it's an ext3 filesystem. I've tried using the rescue function in parted, no change. I tried opening the disk with fdisk and re-saving the partition table, no change, but I don't know if it really re-saved it because I didn't make any changes to it. When I use the verify partition tables option in fdisk, all it says is "62 unallocated sectors". Yet if I try to add a partition it says "no available sectors".

When I'm booting linux every time it says errors were corrected in hda3 (the main data partition and the one I want to resize).

What can I use to detect any problems in the partition tables and correct them? Or how to I rebuild the partition tables without losing any of my data?

Thanks.




I had similar problems once before. (I rember it being about the ext3/2 partion being at the end of the hard disk with no space left or starting point of partion not being fixes ? but that may not be the case with you)

Also ext3 is ext2 with journelling which is why it calls it ext2.

The following can be risky
Ok there are two things you could try methords.
if you have a some unpartioned spaced, or you have another machine on the network, you could tar the whole system up making sure to use the -p option, and then just delete the partion and recreate it to the size you want, format it then just untar (using -p option again) back, you can do this with the LiveCD.

I think there is a pation tool out there called ranish partion manager, it is windows based (well a dos boot disk is needed to stick it on) but it is kinda low level. so what you might try is shrinking your filesystem, then shrinking your using resize2fs after carefull manpage reading, you can then try the parted program again, if not try the ranish program.

if none of the above work (or you don't have the disk space) , you can try resizing the ext2(or 3) filesystem to slightly smaller than you want your final partion to be, make carefule note of the start point of your current partion, delete it, then recreate it at exact same start point and set its size to what you want (a little bit bigger than the filesystem). todo this you will have to look at the differnt partion programs.

Look here to see how to backup and restore your current partion table


Anyway if you need futher help just let me know, (also if you don't understand i will try and explain better)
_________________
Code:
#include "forums.h"
     int main() {while (bollox) postcount++;}
Back to top
View user's profile Send private message
akaempf
n00b
n00b


Joined: 01 Nov 2003
Posts: 17
Location: London

PostPosted: Fri Mar 11, 2005 8:34 pm    Post subject: Another approach Reply with quote

I had this problem as well, and could not solve it by converting the ext3 to an ext2 system, removing dir_index, or any of the other
methods suggested on other forums. Parted just kept giving me the stupid "strange layout" error no matter what I tried. What ended up working for me was to give up on parted, and instead delete both partitions and recreate the first one using fdisk. Apparently, fdisk doesn't delete any data, so the data is still there if you recreate the first partition on a disk using the same starting block number. resize2fs (available via emerge) can extend the original file system to fill up the enlarged partition.

Deleting the partition with my data was a bit scary, and I only tried it after everthing else failed, and of course everything was backed up. Use at your own risk!

I had two 80GB partitions (/dev/hdb1 and /dev/hdb2) on a 160GB drive, which I wanted to consolidate into one partition. It was not my root drive, which made things a bit easier, since I didn't have to boot off a CD. Here is what I did:

0) I first converted the file system to ext2, as part of other attempts to used parted. Not sure if this is necessary for the procedure that follows, but you might need to do it if resize2fs doesn't handle ext3 (you'll have to check this).

1) Copy as much of the data as possible to the first partition, and back up the remaining data from the second partition. Obviously, it's best to back *everything* up in case the procedure fails.

2) Unmount the two partitions disk:

Code:

umount /dev/hdb1
umount /dev/hdb2


3) Using fdisk, delete the second partition, and delete the first partition as well. Don't quit fdisk or issue the write command yet!

4) Recreate the first partition, making sure it has the same starting block as the one you just deleted, and fill the whole disk. The original data will still be there, occupying the space originally occupied by the first partition.

5) Issue the w command to save changes, then quit fdisk

6) Run
Code:
resize2fs /dev/hdb1
This will extend the file system containing your data to fill up the entire enlarged partition

7) Run
Code:
e2fsck /dev/hdb1
to check the partition file system

8) Update /etc/fstab to reflect the new file system and drive layout (e.g., delete mapping of /dev/hdb2 and perhaps change /dev/hdb1 to ext2 if necessary)

9) Remount the file system. Hopefully, all your data will still be there (mine was)!

If you're afraid this won't work, you might want to try a test case first. I did so by first deleting the second partition (which had no data), and then creating a small /dev/hdb2 partition (about 5 gb) in its place. This did not touch the /dev/hdb1 partition with the data on it. I saved the changes, exited fdisk, mounted the small /dev/hdb2 partition, and copied some data onto it. I then unmounted the partition, went into fdisk, deleted /dev/hdb2, and immediately recreated a larger /dev/hdb2 (about 10 GB), starting at the same sector number. Saved changes, ran
Code:
resize2fs /dev/hdb2
and then
Code:
e2fsck /dev/hdb2
to extend the enlargened partition's file system and check it. Mounted it, and confirmed that the data I had copied onto the 5 GB partition was still there on the 10 GB partition. This made me gesticulate in amazement, and gave me the confidence to proceed with the real thing.

Hope this helps!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum