re-partitioned ext3 parition with parted, weird behaviour.

rmrf

Platinum Member
May 14, 2003
2,872
0
0
My system is as follows:

60GB SATA laptop HDD
kernel 2.6.12-10-386

1xWindows XP Pro - 19GB
1xLinux ext3 - ~36GB

That's how it was. I wanted to repartition the linux partition so that I had the following set up:

1xWindows XP Pro - 19GB
1xLinux ext3 - 19GB
1xLinux ext3 - 10GB
1xShared FAT32 - ~6GB(remainder)

Don't give me crap on the windows partition :p, I pride myself for not having to use windows, but since I was promoted and given a company laptop, we have required apps that only run on windows.

I started by booting from a live-cd and using parted to resize the partition I wanted.

resize 1 0 19077

The command seems to have gone through successfully, gave me a message that I needed to reboot before the kernel is able to see the new size. I rebooted into my linux install, and qtparted/parted/gparted shows that my drive is partitioned the old way:

1xWindows XP Pro - 19GB
1xLinux ext3 - ~36GB

when I issue 'df -h', it gives a reading of 19GB on my linux partition. Am I missing something? Any help on this would be greatly appreciated.


*******SOLUTION:*******

The resize was complete, but the partition table was not altered. In order to do this, I used fdisk. This is what I did to figure out how to place my partition:

Information needed: size of new partition (in MB), start cylinder of resized partition.

Here is my output from "fdisk -l" as root, before I altered the partition table (see attached code).

The start cylinder of my partition that had the filesystem resized (/dev/sda2) was 2433, this will stay the same. Now I will figure out the end cylinder. In my case, I resized the filesystem to 19077MB, so I need the parition to line up to that:

19077*1024/63.0/255.0*2=2431.976

<size of partition> * 1024(1MB)/63.0(sectors)/255.0(heads) * 2(to get bytes)

^^ That is my understanding anyway, I had a crash course, so I may have gotten a little confused.

The end result is how many total cylinders my new partition will take up. I round up to the nearest cylinder, of course, and add that to my starting cylinder, and I get this as my table when I am finished (see attached code).

Hope that helps anyone else having the same problem.

btw, I can't take credit for this answer. Sophomore on irc.arstechnica.com #linux helped me with this a great deal. I wouldn't have figured it out if it weren't for them. Thanks again :beer:
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Dude, I'm having the PRECISE same problem with resizing my ReiserFS partition. It says resized yet it still shows it's as big as it always was. I'm using gparted.
 

rmrf

Platinum Member
May 14, 2003
2,872
0
0
what kernel version? I'm wondering if that has anything to do with it, but I'm not sure.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Does fdisk show the old or new partition layout? It's possible the filesytem itself was never resized, but I would assume the kernel would complain when trying to use a filesystem that extends past it's partition boundaries.
 

rmrf

Platinum Member
May 14, 2003
2,872
0
0
Originally posted by: Nothinman
Does fdisk show the old or new partition layout? It's possible the filesytem itself was never resized, but I would assume the kernel would complain when trying to use a filesystem that extends past it's partition boundaries.

fdisk shows the old partition layout, as does gparted, qtparted, and parted. I was mistaken before when I thought parted showed the new layout.

the only thing that shows the new partition layout is 'df -h'.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
df just reads /etc/mtab and does statfs on all of the entries, it doesn't actually look at the partition table.
 

rmrf

Platinum Member
May 14, 2003
2,872
0
0
so does that mean my partition table isn't modified? I'm thinking of just throwing in a debian boot disc, and using it to resize my partition.

I was reading about ntfsresize (I know, different fs), and it said that one of the steps was to delete and recreate the partition the size you wanted, and as long as you didn't format before you wrote the new partition table, your data would be in tact. Do I need to do something similar here?

also, when I did this, I removed journaling so it was an ext2 fs, changed the partition table, and added the journaling back in. Is there something that I missed there?

I'm wondering if I missed a step where I needed to commit the changes.... I'm confused.

Thanks for the replies.
 

Ausm

Lifer
Oct 9, 1999
25,213
14
81
Originally posted by: xtknight
Dude, I'm having the PRECISE same problem with resizing my ReiserFS partition. It says resized yet it still shows it's as big as it always was. I'm using gparted.


I had the same problem witha a ReiserFS partition I tried to reformat it with Qpart using Ext3 with no luck so I went down to EXT2 and then reformatted the partition again with EXT3. I am not crazy about ReiserFS partitions.


Ausm
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Yeah, um, so what's the deal? It's not actually changing the partition table? It just changes the 'superblock' of the partition or something?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It's possible that you resized the filesystem, but not the partition table entry. I would have thought that parted would do both, but I don't know for sure.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Hmm. I started up Partition Magic and it said my second drive had boundary errors or something. It said it could fix it by changing some value so I said yes. Now my extra space shows up. And it shows my ResierFS as ext2. Who knows. :confused:
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
PQMagic doesn't support reiserfs, it's probably just displaying the name that goes with the partition type since reiserfs doesn't have it's own type.