Newfs crash on external HDD

2009-07-22 Thread kellvyn
I'm trying to use an external HDD for backups.  In case it's relevant: 
this is a SATA drive in an enclosure w/ eSATA and USB 2 interfaces (which 
shows up as JMicron JM20336 SATA, USB Combo in dmesg).  The jack on the 
computer is USB 1, however.  I'm currently running i386 4.4-stable with 
raidframe.

Initializing with fdisk and partitioning with disklabel worked fine, but 
several attempts to newfs have caused crashes, with messages like the 
following:

umass0: BBB reset failed, STALLED
umass0: BBB bulk-in clear stall failed, STALLED
umass0: BBB bulk-out clear stall failed, STALLED

I didn't see anything mentioned on openbsd.org/plus45.html or 
openbsd.org/errata45.html about an update to umass.  Did I miss 
something, so that this problem could be fixed by upgrading to 4.5?  
Otherwise, any ideas on how to fix this?

The output of fdisk, disklabel, newfs, trace, ps, and the subsequent boot 
messages follows.

Thanks!


# fdisk sd0
Disk: sd0   geometry: 121601/255/63 [1953525168 Sectors]
Offset: 0   Signature: 0xAA55
Starting Ending LBA 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: A6  0   1   1 - 121600 254  63 [  63:  1953520002 ] OpenBSD
# disklabel -p g sd0
# Inside MBR partition 3: type A6 start 63 size 1953520002
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: EADS-00M2B0
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 121601
total bytes: 931.5G
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:   500.0G 0.0G  4.2BSD   2048 163841
  c:   931.5G 0.0G  unused  0 0
# umount /home
# mount
/dev/wd0a on / type ffs (local, softdep)
/dev/wd0d on /tmp type ffs (local, nodev, nosuid, softdep)
/dev/wd0f on /usr type ffs (local, nodev, softdep)
/dev/wd0e on /var type ffs (local, nodev, nosuid, softdep)
# newfs sd0a
/dev/rsd0a: 512001.2MB in 1048578552 sectors of 512 bytes
2529 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
umass0: BBB reset failed, STALLED
umass0: BBB bulk-in clear stall failed, STALLED
umass0: BBB bulk-out clear stall failed, STALLED
umass0: BBB reset failed, STALLED
umass0: BBB bulk-in clear stall failed, STALLED
umass0: BBB bulk-out clear stall failed, STALLED
disk_unbusy: sd0: dk_busy  0
pool scxspl: putting with none out
panic: pool_do_put
Stopped at  Debugger+0x4:   leave
RUN AT LEAST 'trace' AND 'ps' AND INCLUDE OUTPUT WHEN REPORTING THIS PANIC!
DO NOT EVEN BOTHER REPORTING THIS WITHOUT INCLUDING THAT INFORMATION!
ddb trace
Debugger(d08308fc,50,d83c7d4c,d08c2ec0,d62ab000) at Debugger+0x4
panic(d074c741,d0772c02,d83c7d8c,6295,d83c7d74) at panic+0x55
pool_do_put(d08c2ec0,d62ab000,0,7df7,d0e68b00) at pool_do_put+0x193
pool_put(d08c2ec0,d62ab000,d83c7dec,d0506936,d0e95630) at pool_put+0x27
scsi_free_xs(d62ab000,1,d0e5d000,0) at scsi_free_xs+0x3c
scsi_done(d62ab000,d0e68c00,d83c7e4c,d06a1e6a,0) at scsi_done+0xb3
umass_scsi_cb(d0e95800,d62ab000,2000,3,d0e95800) at umass_scsi_cb+0x8a
umass_detach(d0e95800,1,10,d06a249f,d0e68880) at umass_detach+0xfb
config_detach(d0e95800,1,d83c7f0c,d06a2a18,d0e68880) at config_detach+0x228
usb_disconnect_port(d0e687b0,d0e65500,10) at usb_disconnect_port+0x65
uhub_explore(d0e68880,d06a0b08,d83c7f8c,d06a0bbd,0) at uhub_explore+0x205
usb_discover(d0e68900,78,d09f3e78,d0200936,d62a86b8) at usb_discover+0x36
usb_event_thread(d0e68900) at usb_event_thread+0x91
Bad frame pointer: 0xd09f3e78
ddb ps
   PID   PPID   PGRPUID  S   FLAGS  WAIT  COMMAND
 14469 60  14469  0  2  0x4002newfs
60  1 60  0  3  0x4082  pause ksh
 25272  1  25272  0  3  0x4082  ttyin getty
 20404  1  20404  0  3  0x4082  ttyin getty
  5680  1   5680  0  3  0x4082  ttyin getty
 18113  1  18113  0  3  0x4082  ttyin getty
 29327  1  29327  0  3  0x4082  ttyin getty
  5215  1   5215  0  30x80  selectcron
  4794  1  12275  0  30x82  nanosleep perl
 21395  19976  19976  0  3   0x181  pause smbd
  7185  1   7185  0  30x81  selectnmbd
 19976  1  19976  0  3   0x181  selectsmbd
  1613  1   1613  0  30x80  selectsshd
 21487  1  21487  0  3 0x40180  selectsendmail
  9935  1   9935  0  3   0x180  select  

Choosing components for RAID array [Was: newfs changes fstype...]

2009-04-23 Thread kellvyn
Michal wrote (04/22/09 08:45):
 So create an a and a d partition not an a and a b partition. Of
 course, this guide is for 2 drives that are both bootable, yours will
 be simpler of course but it should help you out.

Thanks; that's helpful.  I know that the array can be bootable, but the
kernel must be located outside of the array, according to raidctl(8).
My array will be for /home only.  So it seems like there are two
options:

1) Use wd1a and wd2a for the components of the array.

2) Use wd1d and wd2d as the components and setting up wd1a and wd2a with
a 4.2BSD fs.

The only dis/advantages I see would be that (1) maximizes the space for the
array, but (2) leaves open the possibility that I could boot from wd1 or
wd2 in the future by putting a basic OpenBSD installation in wd1a or
wd2a.  Are there any other considerations I should take into account?
Or any advice on choosing between these two?

Thanks!



newfs changes fstype from RAID to 4.2BSD?

2009-04-21 Thread kellvyn
I'm trying to have everything except /home mounted on wd0, with /home
mounted on a RAID 1 array comprising wd1a and wd2a.  There are no other
partitions on wd1 and wd2.  (Unless you count the c partition.)

I tried to prepare wd1 and wd2 with:
# fdisk -i wd1
# disklabel -E wd1
and following the prompts.  After writing the disklabel, here's the
output:
# disklabel wd1
# Inside MBR partition 3: type A6 start 63 size 488392002
# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: WDC WD2500AAJB-0
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30401
total sectors: 488397168
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:488392002   63RAID
  c:4883971680  unused  0 0

So far so good.  Following some advice I found on the web [1][2], I
continued with:
# newfs wd1a
Before moving forward.  But now disklabel gives the following output:
# disklabel wd1
# Inside MBR partition 3: type A6 start 63 size 488392002
# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: WDC WD2500AAJB-0
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30401
total sectors: 488397168
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:488392002   63  4.2BSD   2048 163841
  c:4883971680  unused  0 0

It looks like wd1a's label changed.  How?  More importantly, is this a
problem for setting up a RAID array?  I know that the manual for raidctl
says While FS_BSDFFS (e.g. 4.2BSD) will also work as the component
type, the type FS_RAID (e.g. RAID) is preferred for RAIDframe use, as it
is required for features such as auto-configuration.  But it would be
nice to keep my wd1a, and wd2a once I get to it, as FS_RAID.

I'm running 4.4-stable with GENERIC plus raid support kernel.  Which, in
case it's relevant, I did by adding
pseudo-device   raid4
option RAID_AUTOCONFIG
to the GENERIC config file.  (I don't know how *else* one would do it,
but perhaps the order of the lines matters?)

Any advice is greatly appreciated!


[1] geektechnique.org/projectlab/797/openbsd-encrypted-nas-howto
[2] www.argon18.com/raid_openbsd.html



Re: newfs changes fstype from RAID to 4.2BSD?

2009-04-21 Thread kellvyn
Nick Holland wrote (04/21/09 21:39):
 I looked.  Your advice does not tell you to newfs your raw RAID
 partition.  Go read it again.
 
 I REALLY recommend UNDERSTANDING how this works, not just blindly
 following someone's recipe.

You're right -- on both counts.

Emailing the list was an attempt to get from the blindly following
stage to the understanding stage.  Now the that newfs issue is cleared
up, here's another question:  the author of a page I cited writes, In my
experience I couldn't the 'a' partition to become of type FS_RAID.  But
according to my disklabel output, it looks like I was able to do this:

# disklabel wd1
# Inside MBR partition 3: type A6 start 63 size 488392002
# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: WDC WD2500AAJB-0
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30401
total sectors: 488397168
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:488392002   63RAID   
  c:4883971680  unused  0 0