DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 26th August 2009
White White is offline
New User
 
Join Date: Aug 2009
Posts: 9
Thanked 0 Times in 0 Posts
Default Add HD

Hi everyone,
I have added HD to my system.

But here is what i get:

Code:
#  fdisk -i wd0
Do you wish to write new MBR and partition table? [n] y
fdisk: wd0: Operation not permitted
What to do ?
Reply With Quote
  #2   (View Single Post)  
Old 26th August 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,886
Thanked 214 Times in 189 Posts
Default

Several guesses, since we don't have a dmesg or any other information:
  1. wd0 is the wrong device name. Perhaps the device is sd0 or sd1 or wd2.
  2. The device is read-only. Either it is physically strapped R/O, or, perhaps you are running the OS from within a virtual machine which does not have write access to the disk drive (file, or physical device).
If you don't like either of these guesses, provide more information.
Reply With Quote
  #3   (View Single Post)  
Old 26th August 2009
White White is offline
New User
 
Join Date: Aug 2009
Posts: 9
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jggimi View Post
Several guesses, since we don't have a dmesg or any other information:
  1. wd0 is the wrong device name. Perhaps the device is sd0 or sd1 or wd2.
  2. The device is read-only. Either it is physically strapped R/O, or, perhaps you are running the OS from within a virtual machine which does not have write access to the disk drive (file, or physical device).
If you don't like either of these guesses, provide more information.
Thanks for reply !
wd0 is new HD, I am booted from wd1 right now.
I run OpenBSD on real server.
What other info do you need ? maybe logs etc. ?

Quote:
# fdisk wd0
Disk: wd0 geometry: 4865/255/63 [78165360 Sectors]
Offset: 0 Signature: 0xAA55
Starting Ending LBA Info:
#: id C H S - C H S [ start: size ]
-------------------------------------------------------------------------------
*0: A5 0 1 1 - 4865 144 63 [ 63: 78165297 ] FreeBSD
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

Last edited by White; 26th August 2009 at 05:14 PM.
Reply With Quote
  #4   (View Single Post)  
Old 26th August 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,886
Thanked 214 Times in 189 Posts
Default

You have *still* not supplied a dmesg.

According to the limited information you've supplied so far, this is a used drive (with a valid MBR on it), and you failed to write to the drive while running fdisk as root.

Assuming that the above is true, wd0 is configured to be read-only. This is either by pin configuration on the drive electronics, or a setting in your BIOS, or some other hardware issue, such as a drive controller or drive configuration problem. It is not an ATA security setting, as you can read the MBR sector.

Check your BIOS settings. Check your pin configuration on the drive. Post a dmesg. Post the output of # atactl wd0 identify.
Reply With Quote
  #5   (View Single Post)  
Old 26th August 2009
White White is offline
New User
 
Join Date: Aug 2009
Posts: 9
Thanked 0 Times in 0 Posts
Default

Quote:
Check your BIOS settings. Check your pin configuration on the drive. Post a dmesg. Post the output of # atactl wd0 identify.
K, I just checked BIOS, every thing looks good to me.
Drive was working on other server, I just took it out of other server, that's why there is FreeBSD partition ...

Quote:
# atactl wd0
atactl: wd0: Operation not permitted

Quote:
# dmesg
OpenBSD 4.5 (GENERIC) #4: Sun Aug 23 19:01:40 GMT 2009
WHITE@Web:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) 4 CPU 2.80GHz ("GenuineIntel" 686-class) 2.80 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,P GE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE, SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,CNXT-ID,xTPR
real mem = 1063403520 (1014MB)
avail mem = 1019781120 (972MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 02/06/06, BIOS32 rev. 0 @ 0xffe90, SMBIOS rev. 2.3 @ 0xf0450 (66 entries)
bios0: vendor Dell Inc. version "A02" date 02/06/2006
bios0: Dell Inc. PowerEdge SC420
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP SSDT APIC BOOT MCFG HPET
acpi0: wakeup devices VBTN(S4) PCI0(S5) PCI1(S5) PCI2(S5) PCI3(S5) PCI4(S5) KBD_(S1) USB0(S1) USB1(S1) USB2(S1) USB3(S1)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 199MHz
ioapic0 at mainbus0: apid 8 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 8
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 4 (PCI1)
acpiprt1 at acpi0: bus 2 (PCI2)
acpiprt2 at acpi0: bus 3 (PCI3)
acpiprt3 at acpi0: bus 1 (PCI4)
acpiprt4 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
acpibtn0 at acpi0: VBTN
bios0: ROM list: 0xc0000/0x9800! 0xc9800/0x1800! 0xcb000/0x1000
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel E7221 Host" rev 0x04
ppb0 at pci0 dev 1 function 0 "Intel E7221 PCIE" rev 0x04: apic 8 int 16 (irq 11)
pci1 at ppb0 bus 1
vga1 at pci0 dev 2 function 0 "Intel E7221 Video" rev 0x04
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp at vga1 not configured
inteldrm0 at vga1: apic 8 int 16 (irq 11)
drm0 at inteldrm0: couldn't find agp
ppb1 at pci0 dev 28 function 0 "Intel 82801FB PCIE" rev 0x03: apic 8 int 16 (irq 11)
pci2 at ppb1 bus 2
bge0 at pci2 dev 0 function 0 "Broadcom BCM5751" rev 0x01, BCM5750 A1 (0x4001): apic 8 int 16 (irq 11), address 00:11:11:64:4b:85
brgphy0 at bge0 phy 1: BCM5750 10/100/1000baseT PHY, rev. 0
ppb2 at pci0 dev 28 function 1 "Intel 82801FB PCIE" rev 0x03: apic 8 int 17 (irq 10)
pci3 at ppb2 bus 3
uhci0 at pci0 dev 29 function 0 "Intel 82801FB USB" rev 0x03: apic 8 int 21 (irq 9)
uhci1 at pci0 dev 29 function 1 "Intel 82801FB USB" rev 0x03: apic 8 int 22 (irq 5)
uhci2 at pci0 dev 29 function 2 "Intel 82801FB USB" rev 0x03: apic 8 int 18 (irq 4)
uhci3 at pci0 dev 29 function 3 "Intel 82801FB USB" rev 0x03: apic 8 int 23 (irq 3)
ehci0 at pci0 dev 29 function 7 "Intel 82801FB USB" rev 0x03: apic 8 int 21 (irq 9)
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xd3
pci4 at ppb3 bus 4
ichpcib0 at pci0 dev 31 function 0 "Intel 82801FB LPC" rev 0x03: PM disabled
pciide0 at pci0 dev 31 function 1 "Intel 82801FB IDE" rev 0x03: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <ST340015A>
wd0: 16-sector PIO, LBA, 38166MB, 78165360 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
pciide0: channel 1 ignored (disabled)
pciide1 at pci0 dev 31 function 2 "Intel 82801FR SATA" rev 0x03: DMA, channel 0 configured to native-PCI, channel 1 configured to native-PCI
pciide1: using apic 8 int 20 (irq 10) for native-PCI interrupt
wd1 at pciide1 channel 0 drive 0: <WDC WD400JD-75HKA1>
wd1: 16-sector PIO, LBA, 38146MB, 78125000 sectors
wd1(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 5
ichiic0 at pci0 dev 31 function 3 "Intel 82801FB SMBus" rev 0x03: apic 8 int 17 (irq 10)
iic0 at ichiic0
spdmem0 at iic0 addr 0x52: 1GB DDR2 SDRAM non-parity PC2-5300CL5
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
Kernelized RAIDframe activated
mtrr: Pentium Pro MTRR support
ugen0 at uhub4 port 1 "American Power Conversion Smart-UPS 750 FW:651.12.D USB FW:4.2" rev 1.10/0.06 addr 2
softraid0 at root
root on wd1a swap on wd1b dump on wd1b
Reply With Quote
  #6   (View Single Post)  
Old 26th August 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Can you please post the output of the following commands?

$ sysctl kern.securelevel
$ ls -l /dev/{,r}wd0?

Thanks.
Reply With Quote
  #7   (View Single Post)  
Old 26th August 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,886
Thanked 214 Times in 189 Posts
Default

OK, now we're getting somewhere:
Code:
wd0 at pciide0 channel 0 drive 0: <ST340015A>
This Seagate Barracuda does not have a jumper pin setting for read-only. That, at least, has been ruled out as the cause of your problem.

Here's something to note, though Googling tends to indicate this warning may be ignored. It is produced during PIIX compatibility handling in src/sys/dev/pci/pciide.c, and may be specific to the 82801FB chipset on your server's motherboard:
Code:
pciide0: channel 1 ignored (disabled)
While in your dmesg, I also note that you are on the last BIOS Dell produced for the SC420 (BIOS A02), and you are apparently running GENERIC at -release+errata. Did you happen to make any local changes to src/sys/arch/i386/conf/GENERIC?

Please test with ACPI disabled -- it's a guess, but ACPI compatability issues can sometimes get in the way of proper hardware function. Boot with -c, and at the UKC prompts type "disable acpi" and "quit".
Reply With Quote
  #8   (View Single Post)  
Old 26th August 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,886
Thanked 214 Times in 189 Posts
Default

Quote:
Originally Posted by BSDfan666 View Post
Can you please post the output of the following commands?

$ sysctl kern.securelevel
Securelevel 2 prevents writing to a raw device if the block device is mounted. I hadn't thought of this, but then, fdisk/atactl use of "wd0" gets converted to "/dev/rwd0c". Since there's an MBR on that drive, /dev/wd0c would almost assuredly not be mounted.
Quote:
$ ls -l /dev/{,r}wd0?
Oh, very very good thought! It could indeed be a bad special file.
Reply With Quote
  #9   (View Single Post)  
Old 26th August 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

@jggimi: That pciide0 warning indicates that the second channel isn't in use.. an IDE controller has 2 channels, a channel can have 2 devices (master/slave).

Code:
wd0 at pciide0 channel 0 drive 0: <ST340015A>
He only has 1 IDE device on the first channel (0..) and it's in the master position (..0).
Reply With Quote
Old 26th August 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,886
Thanked 214 Times in 189 Posts
Default

Re: IDE channels -- yes, one may have one or both empty and unused. But, as I understand pciide.c you only get that particular warning message for controllers which are Intel 82371-compatible. That section of the code is from 1999, so it's been that way a long time.
Reply With Quote
Old 26th August 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Quote:
Originally Posted by jggimi View Post
Securelevel 2 prevents writing to a raw device if the block device is mounted. I hadn't thought of this, but then, fdisk/atactl use of "wd0" gets converted to "/dev/rwd0c". Since there's an MBR on that drive, /dev/wd0c would almost assuredly not be mounted.
That's the behaviour when securelevel is 1, a securelevel of 2 prevents write-access to unmounted devices as well.

Quote:
Originally Posted by securelevel(7)
2 Highly secure mode
- all effects of securelevel 1
- raw disk devices are always read-only whether mounted or not
- settimeofday(2) and clock_settime(2) may not set the time back-
wards or close to overflow
- pf(4) filter and NAT rules may not be altered
Seems as if this user may have been playing around with his configuration files recently.

Quote:
Originally Posted by jggimi
Re: IDE channels -- yes, one may have one or both empty and unused. But, as I understand pciide.c you only get that particular warning message for controllers which are Intel 82371-compatible. That section of the code is from 1999, so it's been that way a long time.
Yes, likely a little bit of debugging noise that got left in.. could be a especially flaky family of IDE controllers.

EDIT: I'm finding that warning message in at least 10 different chipset handlers in pciide.c.. guess the developers find it useful under some circumstances.

Last edited by BSDfan666; 26th August 2009 at 07:22 PM.
Reply With Quote
Old 26th August 2009
White White is offline
New User
 
Join Date: Aug 2009
Posts: 9
Thanked 0 Times in 0 Posts
Default

Quote:
# sysctl kern.securelevel
kern.securelevel=2
Quote:
# ls -l /dev/{,r}wd0?
crw-r----- 1 root operator 3, 0 Jan 18 2009 /dev/rwd0a
crw-r----- 1 root operator 3, 1 Jan 18 2009 /dev/rwd0b
crw-r----- 1 root operator 3, 2 Jan 18 2009 /dev/rwd0c
crw-r----- 1 root operator 3, 3 Jan 18 2009 /dev/rwd0d
crw-r----- 1 root operator 3, 4 Jan 18 2009 /dev/rwd0e
crw-r----- 1 root operator 3, 5 Jan 18 2009 /dev/rwd0f
crw-r----- 1 root operator 3, 6 Jan 18 2009 /dev/rwd0g
crw-r----- 1 root operator 3, 7 Jan 18 2009 /dev/rwd0h
crw-r----- 1 root operator 3, 8 Jan 18 2009 /dev/rwd0i
crw-r----- 1 root operator 3, 9 Jan 18 2009 /dev/rwd0j
crw-r----- 1 root operator 3, 10 Jan 18 2009 /dev/rwd0k
crw-r----- 1 root operator 3, 11 Jan 18 2009 /dev/rwd0l
crw-r----- 1 root operator 3, 12 Jan 18 2009 /dev/rwd0m
crw-r----- 1 root operator 3, 13 Jan 18 2009 /dev/rwd0n
crw-r----- 1 root operator 3, 14 Jan 18 2009 /dev/rwd0o
crw-r----- 1 root operator 3, 15 Jan 18 2009 /dev/rwd0p
brw-r----- 1 root operator 0, 0 Jan 18 2009 /dev/wd0a
brw-r----- 1 root operator 0, 1 Jan 18 2009 /dev/wd0b
brw-r----- 1 root operator 0, 2 Jan 18 2009 /dev/wd0c
brw-r----- 1 root operator 0, 3 Jan 18 2009 /dev/wd0d
brw-r----- 1 root operator 0, 4 Jan 18 2009 /dev/wd0e
brw-r----- 1 root operator 0, 5 Jan 18 2009 /dev/wd0f
brw-r----- 1 root operator 0, 6 Jan 18 2009 /dev/wd0g
brw-r----- 1 root operator 0, 7 Jan 18 2009 /dev/wd0h
brw-r----- 1 root operator 0, 8 Jan 18 2009 /dev/wd0i
brw-r----- 1 root operator 0, 9 Jan 18 2009 /dev/wd0j
brw-r----- 1 root operator 0, 10 Jan 18 2009 /dev/wd0k
brw-r----- 1 root operator 0, 11 Jan 18 2009 /dev/wd0l
brw-r----- 1 root operator 0, 12 Jan 18 2009 /dev/wd0m
brw-r----- 1 root operator 0, 13 Jan 18 2009 /dev/wd0n
brw-r----- 1 root operator 0, 14 Jan 18 2009 /dev/wd0o
brw-r----- 1 root operator 0, 15 Jan 18 2009 /dev/wd0p
Quote:
Did you happen to make any local changes to src/sys/arch/i386/conf/GENERIC?
Yes, but not much.
Reply With Quote
Old 26th August 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Then kern.securelevel=2 is your problem, you cannot write directly to raw disk device with this secure level.

As for the modified kernel confession.. this is frowned upon in the OpenBSD community, especially when asking for support.

Either remove the securelevel setting in your initialization scripts, or boot into single user mode to prepare this disk.
Reply With Quote
Old 26th August 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,886
Thanked 214 Times in 189 Posts
Default

Great catch, Bsdfan! (as usual )

And thanks for the clarification re: level 2 I/O.
Reply With Quote
Old 26th August 2009
White White is offline
New User
 
Join Date: Aug 2009
Posts: 9
Thanked 0 Times in 0 Posts
Default

Quote:
BSDfan666
Thank you !!!
That did it
Reply With Quote
Old 26th August 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,886
Thanked 214 Times in 189 Posts
Default

Quote:
Originally Posted by BSDfan666 View Post
As for the modified kernel confession.. this is frowned upon in the OpenBSD community, especially when asking for support.
To clarify: Custom kernels should be named something other than GENERIC.

Editing GENERIC complicates the upgrade process, since GENERIC changes constantly -- on i386, there have been 688 changes to GENERIC to-date. You may miss newer source required for the next -release, or make some other mistake due to local changes. The best practice is to copy GENERIC to another file, WHITE, for example, then build WHITE kernels.

Using GENERIC for custom kernels may hide possible problems from someone trying to diagnose a problem you report.

Custom kernels are fine, if you have the appropriate knowledge to use them properly, and a need that isn't met by GENERIC. Just don't report problems with them unless you can re-create the problem with an actual GENERIC kernel.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:23 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick