newfs: cg 0: bad magic number

2008-01-02 Thread Xavier Mertens
Hi *,

I'm trying to build a new FS on an IDE disk.
All newfs commands end with:

# newfs /dev/rwd1a
..
..
newfs: cg 0: bad magic number
newfs: fsinit1 failed

Here is the disk info:

# disklabel wd1
# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: Maxtor 6B250R0
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30515
total sectors: 490234752
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0   # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize  cpg]
  a:481950  4.2BSD   2048 16384   16
  c:4902347520  unused  0 0


(I tried several fs size (stard or end of the disk, same error)

Any idea?

Xavier
--
Weird enough for government work.



Re: newfs: cg 0: bad magic number

2008-01-02 Thread Xavier Mertens
Strange... fdisk wd1 reports:

# fdisk wd1
Disk: wd1   geometry: 30515/255/63 [490234752 Sectors]
Offset: 0   Signature: 0x180
  Starting EndingLBA Info:
 #: id  C   H  S -  C   H  S [   start:size ]

 0: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 1: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 2: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 3: 00  0   0  0 -  0   0  0 [   0:   0 ] unused

When I create some partitions, write them to the disk, restart fdisk, I'm back
to the same empty config. Is my disk physically dead? :(

Xavier
--
There's no place like ~

On Thu, 3 Jan 2008, Xavier Mertens wrote:

 Hi *,
 
 I'm trying to build a new FS on an IDE disk.
 All newfs commands end with:
 
 # newfs /dev/rwd1a
 ..
 ..
 newfs: cg 0: bad magic number
 newfs: fsinit1 failed
 
 Here is the disk info:
 
 # disklabel wd1
 # /dev/rwd1c:
 type: ESDI
 disk: ESDI/IDE disk
 label: Maxtor 6B250R0
 flags:
 bytes/sector: 512
 sectors/track: 63
 tracks/cylinder: 255
 sectors/cylinder: 16065
 cylinders: 30515
 total sectors: 490234752
 rpm: 3600
 interleave: 1
 trackskew: 0
 cylinderskew: 0
 headswitch: 0   # microseconds
 track-to-track seek: 0  # microseconds
 drivedata: 0
 
 16 partitions:
 #size   offset  fstype [fsize bsize  cpg]
   a:481950  4.2BSD   2048 16384   16
   c:4902347520  unused  0 0
 
 
 (I tried several fs size (stard or end of the disk, same error)
 
 Any idea?
 
 Xavier
 --
 Weird enough for government work.



Re: newfs: cg 0: bad magic number

2008-01-02 Thread Nick Holland
Good thing OpenBSD only runs on one platform and one type of computer,
eh?

Xavier Mertens wrote:
...
 
 16 partitions:
 #size   offset  fstype [fsize bsize  cpg]
   a:481950  4.2BSD   2048 16384   16
   c:4902347520  unused  0 0

Assuming this is i386 (what people usually assume when they don't
bother to show dmesg or even mention platform), you need a one
cylinder offset on your 'a' partition (or more accurately, your
first partition.  TYPICALLY, that's 63 sectors, but not always).
What you have here clobbers your MBR, which holds your (now hosed)
fdisk partitions.

see faq4.html.

Nick.



Re: newfs: cg 0: bad magic number

2008-01-02 Thread Martin Schröder
2008/1/3, Xavier Mertens [EMAIL PROTECTED]:
 When I create some partitions, write them to the disk, restart fdisk, I'm back
 to the same empty config. Is my disk physically dead? :(

http://www.openbsd.org/faq/faq4.html#Install
4.5.2:

On platforms which use fdisk, it is important that the first
partition skips the first track of the disk, in this case, starting on
sector 63. This will vary from machine to machine and disk system to
disk system. If an OpenBSD partition is created starting at offset 0,
this partition table will end up being overwritten by the OpenBSD
partition's Partition Boot Record. The system may still be bootable,
but it will be very difficult to maintain, and this configuration is
not recommended or supported.

Best
   Martin



Re: newfs: cg 0: bad magic number

2008-01-02 Thread Ted Unangst
On 1/2/08, Xavier Mertens [EMAIL PROTECTED] wrote:
 16 partitions:
 #size   offset  fstype [fsize bsize  cpg]
  a:481950  4.2BSD   2048 16384   16

your partition is not properly offset from the beginning of the disk,
where all the goodies like mbr need to live.



Re: newfs: cg 0: bad magic number

2008-01-02 Thread Xavier Mertens
Indeed, this test was bad...
But the same occurs with an offset of 63 sectors :(

Same with fdisk:

fdisk: 1 edit 3
  Starting EndingLBA Info:
 #: id  C   H  S -  C   H  S [   start:size ]

 3: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
Partition id ('0' to disable)  [0 - FF]: [0] (? for help) A6
Do you wish to edit in CHS mode? [n]
offset: [0] 63
size: [0] 488392002
fdisk:*1 q
Writing current MBR to disk.
bash-3.2# fdisk wd1
Disk: wd1   geometry: 30515/255/63 [490234752 Sectors]
Offset: 0   Signature: 0x100
  Starting EndingLBA Info:
 #: id  C   H  S -  C   H  S [   start:size ]

 0: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 1: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 2: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 3: 00  0   0  0 -  0   0  0 [   0:   0 ] unused


Xavier
--
Secret hacker rule #11: hackers read manuals.

On Wed, 2 Jan 2008, Nick Holland wrote:

 Good thing OpenBSD only runs on one platform and one type of computer,
 eh?
 
 Xavier Mertens wrote:
 ..
  
  16 partitions:
  #size   offset  fstype [fsize bsize  cpg]
a:481950  4.2BSD   2048 16384   16
c:4902347520  unused  0 0
 
 Assuming this is i386 (what people usually assume when they don't
 bother to show dmesg or even mention platform), you need a one
 cylinder offset on your 'a' partition (or more accurately, your
 first partition.  TYPICALLY, that's 63 sectors, but not always).
 What you have here clobbers your MBR, which holds your (now hosed)
 fdisk partitions.
 
 see faq4.html.
 
 Nick.



Re: newfs: cg 0: bad magic number

2008-01-02 Thread Xavier Mertens
Ok,

I fixed the disk partitions:

# fdisk wd1
Disk: wd1   geometry: 30515/255/63 [490234752 Sectors]
Offset: 0   Signature: 0x0
  Starting EndingLBA Info:
 #: id  C   H  S -  C   H  S [   start:size ]

 0: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 1: A6  0   1  1 -  30514 254 63 [  63:   490223412 ] OpenBSD
 2: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 3: 00  0   0  0 -  0   0  0 [   0:   0 ] unused

# disklabel wd1
# Inside MBR partition 1: type A6 start 63 size 490223412
# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: Maxtor 6B250R0
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30515
total sectors: 490234752
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0   # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize  cpg]
  a:490223412   63  4.2BSD   2048 16384   16
  c:4902347520  unused  0 0

But I still have the same error at the end of the newfs:

newfs: cg 0: bad magic number
newfs: fsinit1 failed

:(

Xavier
--
Hint: A reload a day, keeps the TAC away .

On Wed, 2 Jan 2008, Ted Unangst wrote:

 On 1/2/08, Xavier Mertens [EMAIL PROTECTED] wrote:
  16 partitions:
  #size   offset  fstype [fsize bsize  cpg]
   a:481950  4.2BSD   2048 16384   16
 
 your partition is not properly offset from the beginning of the disk,
 where all the goodies like mbr need to live.



Re: newfs: cg 0: bad magic number

2008-01-02 Thread Xavier Mertens
Is that normal to have a signature of 0x0 reported by fdisk?
On my other disks, signature is 0xAA55.
Thanks for your help!

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Xavier Mertens
Sent: jeudi 3 janvier 2008 2:28
To: misc@openbsd.org
Subject: Re: newfs: cg 0: bad magic number

Ok,

I fixed the disk partitions:

# fdisk wd1
Disk: wd1   geometry: 30515/255/63 [490234752 Sectors]
Offset: 0   Signature: 0x0
  Starting EndingLBA Info:
 #: id  C   H  S -  C   H  S [   start:size ]

 0: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 1: A6  0   1  1 -  30514 254 63 [  63:   490223412 ] OpenBSD
 2: 00  0   0  0 -  0   0  0 [   0:   0 ] unused
 3: 00  0   0  0 -  0   0  0 [   0:   0 ] unused

# disklabel wd1
# Inside MBR partition 1: type A6 start 63 size 490223412 # /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: Maxtor 6B250R0
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30515
total sectors: 490234752
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0   # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize  cpg]
  a:490223412   63  4.2BSD   2048 16384   16
  c:4902347520  unused  0 0

But I still have the same error at the end of the newfs:

newfs: cg 0: bad magic number
newfs: fsinit1 failed

:(

Xavier
--
Hint: A reload a day, keeps the TAC away .

On Wed, 2 Jan 2008, Ted Unangst wrote:

 On 1/2/08, Xavier Mertens [EMAIL PROTECTED] wrote:
  16 partitions:
  #size   offset  fstype [fsize bsize  cpg]
   a:481950  4.2BSD   2048 16384   16
 
 your partition is not properly offset from the beginning of the disk, 
 where all the goodies like mbr need to live.