From: hugo vanwoerkom on
Hi,

I just noticed that the partition sizes on my usb disk are wrong.

debian:/# fsck -f /dev/sdb2
fsck 1.41.3 (12-Oct-2008)
e2fsck 1.41.3 (12-Oct-2008)
The filesystem size (according to the superblock) is 1953905 blocks
The physical size of the device is 487974 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? yes

These are the sizes reported:

debian:/# sfdisk -l /dev/sdb

Disk /dev/sdb: 9729 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/sdb1 * 0+ 972 973- 7815591 83 Linux
/dev/sdb2 973 1215 243 1951897+ 83 Linux
/dev/sdb3 1216 2918 1703 13679347+ 83 Linux
/dev/sdb4 2919 9728 6810 54701325 5 Extended
/dev/sdb5 2919+ 3891 973- 7815591 83 Linux
/dev/sdb6 3892+ 4864 973- 7815591 83 Linux
/dev/sdb7 4865+ 9728 4864- 39070048+ 83 Linux


sdb2 an sdb3 are wrong, they both ought to be 7815591.

How does one repair that?

Hugo


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/i3egja$run$1(a)dough.gmane.org
From: George-Cristian Bîrzan on
On Thu, 2010-08-05 at 09:07 -0500, hugo vanwoerkom wrote:
> Hi,
>
> I just noticed that the partition sizes on my usb disk are wrong.
> [snip]
> sdb2 an sdb3 are wrong, they both ought to be 7815591.
>
> How does one repair that?

Try gpart: http://www.brzitwa.de/mb/gpart/index.html

--
George-Cristian Bîrzan


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/1281018770.30379.1701.camel(a)gcbirzan
From: hugo vanwoerkom on
George-Cristian Bîrzan wrote:
> On Thu, 2010-08-05 at 09:07 -0500, hugo vanwoerkom wrote:
>> Hi,
>>
>> I just noticed that the partition sizes on my usb disk are wrong.
>> [snip]
>> sdb2 an sdb3 are wrong, they both ought to be 7815591.
>>
>> How does one repair that?
>
> Try gpart: http://www.brzitwa.de/mb/gpart/index.html
>

Gpart finds the partitions allright, but they aren't lost, just the
wrong size. How do I set the correct size?

Hugo


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/i3ejkd$7in$1(a)dough.gmane.org
From: George-Cristian Bîrzan on
On Thu, 2010-08-05 at 09:59 -0500, hugo vanwoerkom wrote:
> Gpart finds the partitions allright, but they aren't lost, just the
> wrong size. How do I set the correct size?

>From its page:

Now if after the check-phase it says Ok, you should check the proposed
partition table very carefully. After that you may write back the
guessed table by calling "gpart -W /dev/hdc /dev/hdc" (exchange /dev/hdc
with your disk device). When gpart has successfully written the new
primary partition table, cross your fingers and reboot.

--
George-Cristian Bîrzan


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/1281020500.30379.1702.camel(a)gcbirzan
From: hugo vanwoerkom on
George-Cristian Bîrzan wrote:
> On Thu, 2010-08-05 at 09:59 -0500, hugo vanwoerkom wrote:
>> Gpart finds the partitions allright, but they aren't lost, just the
>> wrong size. How do I set the correct size?
>
>>From its page:
>
> Now if after the check-phase it says Ok, you should check the proposed
> partition table very carefully. After that you may write back the
> guessed table by calling "gpart -W /dev/hdc /dev/hdc" (exchange /dev/hdc
> with your disk device). When gpart has successfully written the new
> primary partition table, cross your fingers and reboot.
>


Actually in my /dev/sdb both partition 2 + 3 are wrong:

num start should be end should be
2 8003MB 8003MB 10.0GB 16.0GB
3 10.0GB 16.0GB 24.0GB 24.0GB

The simplest fix would be to delete both and recreate them because I
have backups for both. But I would like to see if it can be fixed.

Gpart /dev/sdb gives:

Begin scan...
Possible partition(Linux ext2), size(7632mb), offset(0mb)
Possible partition(Linux ext2), size(7632mb), offset(7632mb)
Possible extended partition at offset(22897mb)
Possible partition(Linux ext2), size(7632mb), offset(22897mb)
Possible partition(Linux ext2), size(7632mb), offset(30529mb)
Possible partition(Linux ext2), size(38154mb), offset(38162mb)
End scan.

Checking partitions...
Partition(Linux ext2 filesystem): primary
Partition(Linux ext2 filesystem): primary
Partition(Linux ext2 filesystem): logical
Partition(Linux ext2 filesystem): logical
Partition(Linux ext2 filesystem): logical
Ok.

Guessed primary partition table:
Primary partition(1)
type: 131(0x83)(Linux ext2 filesystem)
size: 7632mb #s(15631176) s(63-15631238)
chs: (0/1/1)-(972/254/57)d (0/1/1)-(972/254/57)r

Primary partition(2)
type: 131(0x83)(Linux ext2 filesystem)
size: 7632mb #s(15631240) s(15631245-31262484)
chs: (973/0/1)-(1023/254/63)d (973/0/1)-(1945/254/58)r

Primary partition(3)
type: 015(0x0F)(Extended DOS, LBA)
size: 53419mb #s(109402650) s(46893735-156296384)
chs: (1023/254/63)-(1023/254/63)d (2919/0/1)-(9728/254/63)r

Primary partition(4)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

But I don't think that is right: there are 3 primary partitions and 3
logical partitions and they should be all 8GB in length except the last
one that is 40GB in length.

Hugo


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/i3enij$nj3$1(a)dough.gmane.org