1

Topic: Changing partitions made first primary unbootable - superblock error

Using GParted, I created the following setup:
sda1 - ext3 (for present OS) (after changes, nuked)
sda2 - ext3 (for another OS)
sda3 - ditto
sda4 - extended partition which included the balance of the hard drive
sda5 - swap
sda6 - /tmp (after changes -- sda8)
sda7 - /opt (after changes -- sda9)
sda8 - data (after changes -- sda6)
sda9 - ext3 (for whatever) (after changes -- sda7)

I discovered that /opt needed to be larger.  So, using GParted again, I reduced sda5 (swap) in size, used some of the space for /tmp, deleted sda6 and sda7 and used all the then unallocated space for /opt (now sda9).  So, the number and sequence of partitions remained the same.  Locations and numbering of some partitions were altered.

After applying the changes, the message reporting completion mentioned "two warnings".  When I pressed "details", there were none.

I could not subsequently log into sda1, even after using a live cd to alter /etc/fstab.  I kept getting a message about some "superblock" problem.  The penultimate partition sda8 (now sda6) was unaffected.  Now I'm wondering whether I should create a very small sda1 and use it just for the MBR and partition table.

My questions: why did my changes make sda1 unbootable and how do I set partitions up so that this will not happen again?  I'm willing to start again from scratch rather than continue with partition settings which are so fragile.

2

Re: Changing partitions made first primary unbootable - superblock error

Well the problem you mention is really bad. But explanation is very easy too.
Since you delete partitions, number change in the same way ! Deleting sda6 makes sda7 to become sda6 !!!
What you have to do is easy ! Two ways :
-either you make the need changes in your fstab (booting off any livecd that allows you to mount your /root partiton with rw rights.
- either your delet partitions using fdisk, and recreate them with the good number. : but you first need to note : start-end, type, toggle, and so on ...

Tell me what you prefer, and i can easly give you some help.

PS : i think you should add some comments to the reported bug, about that point !

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)

3

Re: Changing partitions made first primary unbootable - superblock error

Thank you for your reply.  I know about partition numbers changing and the need to alter /etc/fstab.  In my first post I mention the number changes and altering fstab.  I was able to mount sda1 from my distro's live cd - that is how I altered /etc/fstab on sda1.  I had to do that because I wanted sda8, sda9 and sda6 to mount automatically and the old version of fstab referred to partition numbers which no longer applied.

I could not boot sda1 - when I tried, I got the "superblock" message.  I was in such a hurry to get my OS back, I did not think of writing it down.  I needed to get back to work so I reinstalled my OS on sda1.  sda8, 9 and 6 all mount automatically as required.

As far as I can see, sda1 should not have been affected at all.  It is the first primary partition on the drive (obviously).  My changes related to the first 3 logical partitions (sda5, sda6 and sda7).  sda5 was made smaller and sda6 and sda7 were deleted.  In the then unallocated space I created sda8 (to replace sda6) and sda9 (to replace sda7).  Why should any of those operations affect sda1?

I do not want to have partitions becoming unbootable like that whenever I make alterations to other partitions.  If the problem cannot be avoided, I would like to know that so that I do not go to the trouble of repartitioning from scratch.

If it can be avoided, I would like to know what setup is required.  Should I create a small (say, 16Mb) sda1 to hold the master boot record and the partition table and install my main OS in primary sda2?  Or should I make sda2 an extended partition encompassing the rest of the disk and use logical partitions instead of primaries?  Is there a way of avoiding this problem?

4

Re: Changing partitions made first primary unbootable - superblock error

Thx for reporting.
Could you please fisrt tell me what kinda system you use ?
It is possible that your system use label instead of partition number. If you move/change partition, the label is removed.
For instance, if you use fedora it will be a real nice mess, since it uses labels...

So tell me please...

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)

5

Re: Changing partitions made first primary unbootable - superblock error

Thanks for your reply.  I'll do my best.  The OS I presently use is PCLinuxOS.  I installed it on sda1 after using GParted to create the partitions.  I installed Vector 5.8 on sda2 but foolishly damaged that installation independently of altering partitions.

Here is a printout of sfdisk:

[root@localhost terry]# sfdisk -l /dev/sda

Disk /dev/sda: 14593 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1   *      0+    782     783-   6289416   83  Linux
/dev/sda2        783    1565     783    6289447+  83  Linux
/dev/sda3       1566    2348     783    6289447+  83  Linux
/dev/sda4       2349   14592   12244   98349930    5  Extended
/dev/sda5       2349+   2413      65-    522081   82  Linux swap / Solaris
/dev/sda6       2741+   5481    2741-  22017051   83  Linux
/dev/sda7       5482+   6264     783-   6289416   83  Linux
/dev/sda8       2414+   2478      65-    522081   83  Linux
/dev/sda9       2479+   2740     262-   2104483+  83  Linux

PCLinuxOS has a partitioning tool but I have not used it except during installation to set mount points: sda1 is / ; sda5 is swap ; sda8 is /tmp ; sda9 is /opt ; sda6 is /xfl (abbrev for "x files").  The partitioning tool describes the partitions by sda number.  PCLinuxOS is an rpm-based OS derived from Mandriva (but much better).

I remembered after posting previously that the error message I got when trying to boot was that sda1 was not an ext2 file system, which is correct - it was and remains ext 3.  It is possible, I suppose, that I made an error when editing fstab but I used the live cd again to check it after the first boot failure.

6

Re: Changing partitions made first primary unbootable - superblock error

could you please check differencies between the "fdisk /dev/sda" output and the "parted  /dev/sda" one ?
Just to be sure they both see the same.
GParted is using parted as you can guess.
I am going to download PClinuxOs to make a VM install and see how it goes. This could be a GParted bug anyway ... So i must catch it smile

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)

7 (edited by xanthon 2007-01-24 14:23:53)

Re: Changing partitions made first primary unbootable - superblock error

Thanks.  I'm using PCLinuxOS .93.  A beta of .94 has just been released.

I had to install parted.  Here is its printout:

[root@localhost terry]# parted
GNU Parted 1.6.25.1
Copyright (C) 1998 - 2005 Free Software Foundation, Inc.
<snip>
Using /dev/sda
(parted) print
Disk geometry for /dev/sda: 0kB - 120GB
Disk label type: msdos
Number  Start   End     Size    Type      File system  Flags
1       32kB    6440MB  6440MB  primary   ext3         boot
2       6440MB  13GB    6440MB  primary   ext3
3       13GB    19GB    6440MB  primary   ext3
4       19GB    120GB   101GB   extended
5       19GB    20GB    535MB   logical   linux-swap
8       20GB    20GB    535MB   logical   ext3
9       20GB    23GB    2155MB  logical   ext3
6       23GB    45GB    23GB    logical   ext3
7       45GB    52GB    6440MB  logical   ext3
(parted) quit
Information: Don't forget to update /etc/fstab, if necessary.

Regarding the start point of 32Kb for partition 1, could the change in that (caused by changes to the partition table) mess with partition 1?  I've been told I don't need an area dedicated to the MBR and partition table but I've got this nagging feeling that I do.

8

Re: Changing partitions made first primary unbootable - superblock error

Well i must say i dont understand how you got the problem you report !
I am currently installing PClinuxos on VM machine and after this i will make some changes to see how it goes.
...

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)