Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Apr 2014 11:58:33 +0200
From:      Dirk-Willem van Gulik <dirkx@webweaving.org>
To:        "freebsd-hackers@freebsd.org Hackers" <freebsd-hackers@freebsd.org>
Subject:   int32 in badsect.c / int64 
Message-ID:  <C6EBB166-B7F5-41C7-9E95-4EDC02758116@webweaving.org>

next in thread | raw e-mail | index | archive | help
Was trying to map out some bad blocks prior to temporarily read/empty 4 =
Tbyte volume using =82badsect(8)=92 - and returing it.

Was expecting to be able to put the sector # into badsect (e.g. =
3432631424 from below FSCK output).

This gave me a bit of an odd:

	badsect: 3432631424: Result too large=20

As the daddr_t seems to be a 64bit unsigned; I assumed that the:

			number =3D strtol(*argv, NULL, 0);

was some legacy culprint - and changed it to a strtoll as the daddr_t =
you are entering is an int 64.=20

			number =3D strtoll(*argv, NULL, 0);

That gets it past that point; only to segv out on:

      cg =3D dtog(fs, fsbn);

	/usr/include/ufs/ffs/fs.h:#define	dtog(fs, d)	((d) / =
(fs)->fs_fpg)
	/usr/include/ufs/ffs/fs.h:#define	dtogd(fs, d)	((d) % =
(fs)->fs_fpg)

a bit later.  While fs is valid - it seems  fs->fs_fpg returns as =820=92 =
=97 why is this ?  Is geom too new ? Or is badsect too old/retired ?

Dw.

aacd1: hard error cmd=3Dread 4246326690-4246326721
..

fsck(8):...
THE FOLLOWING DISK SECTORS COULD NOT BE READ: 3432631424, 3432631425, =
3432631426, 3432631427, 3432631428, 3432631429, 3432631430, 3432631431, =
3432631432, 3432631433, 3432631434, 3432631435, 3432631436, 3432631437, =
3432631438, 3432631439, 3432631440, 3432631441, 3432631442, 3432631443, =
3432631444, 3432631445, 3432631446, 3432631447, 3432631448, 3432631449, =
3432631450, 3432631451, 3432631452, 3432631453, 3432631454, 3432631455,


$sudo geom label list aacd0s1d
Geom name: aacd0s1d
Providers:
1. Name: ufsid/4a08af657f7e3930
 Mediasize: 4544528384 (4.2G)
 Sectorsize: 512
 Stripesize: 0
 Stripeoffset: 536903168
 Mode: r0w0e0
 secoffset: 0
 offset: 0
 seclength: 8876032
 length: 4544528384
 index: 0
Consumers:
1. Name: aacd0s1d
 Mediasize: 4544528384 (4.2G)
 Sectorsize: 512
 Stripesize: 0
 Stripeoffset: 536903168
 Mode: r0w0e0




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C6EBB166-B7F5-41C7-9E95-4EDC02758116>