Archive

Posts Tagged ‘FreeBSD’

iStor problem solved / can’t find block in cyl 0 / cg 0: bad magic number

01:14 PM No comments

After over one year working together with Danny Braniss and testing several thousands of options, settings and configurations, I managed to get the iStore iSCSI-device working together with FreeBSD.

Just to remember. The following error occured, when trying to write an UFS filesystem to the device:

newfs -O2 /dev/da0s1
/dev/da0s1: 782023.5MB (1601584044 sectors) block size 16384, fragment size 2048
using 4256 cylinder groups of 183.77MB, 11761 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
160, 376512, 752864, … … …
1601377920
internal error: can’t find block in cyl 0

And in dangerously dedicated mode:

# newfs -O2 /dev/da0

Creating the lable in this mode fails with the message:

newfs -O2 /dev/da0
/dev/da0: 782023.5MB (1601584044 sectors) block size 16384, fragment size 2048
using 4256 cylinder groups of 183.77MB, 11761 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
160, 376512, 752864, … … …
1601377920
internal error: cg 0: bad magic number

The important hint I got from a test with a PetaStor system, where everything worked perfectly. On the FreeBSD-FS mailinglist, I got the last part of the puzzle. Creating the filesystem works with these commands:

# gpart create -s GPT da0"
# gpart show da0
# gpart add -b 34 -s 20971519 -t freebsd-ufs -l AnosLabel da0
# newfs -O2 /dev/da0p1

Important: Replace 20971519 by the size of your device, given by gpart show da0.

FreeBSD freezes on: Trying to mount root from ufs:/dev/md0 and is stucked

09:51 PM 1 comment

Yeah – huge projects with different types of hardware always bring up many different type of problems: Today I had an INTEL Server Platform S7000FC4UR  (really a fantastic System: 160GB of RAM, 4x INTEL Xeon X7350 with 4 Cores, 2,93Ghz, so the system has 16 Cores!) to boot up with FreeBSD 7.1.

The boot-process hang up at several points, but went further after a delay of 20 to 30 secs, till the following point was reached:

md0: Preloaded image 4194304 bytes at 0xffffffff80c4be40
Trying to mount root from ufs:/dev/md0

The boot process is stuck

The boot process is stuck

After trying different boot-options and kernels, I disabled USB2.0 support in the Bios and – *whoop* FreeBSD was booting without any problems. ACPI also seems to have some influences – but the mainproblem is the USB 2.0 support. Due to the fact, that a keyboard is nearly as fast on USB1.0 as on USB2.0 the solution to this problem was quite ok for the customer ;)

Tyan S2925 and FreeBSD 6.3 onboard LAN problem solution

10:37 AM No comments

Today I had to install a FreeBSD 6.3 on a server with a “Tyan S2925 Tomcat n3400B” mainboard. Unfortunatly, the chipset of this board (nForce Pro 3400 / MAC with Marvell 88E1116-CAA Gigabit Ethernet PHY) isn’t supported by FreeBSD 6.3. So after successfully installing the system, the ifconfig looked like this:

/root# ifconfig
lo0: flags=8049 mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0×4
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000

In this special case the onboard network interfaces had to be used, so I checked up FreeBSD 7.0 – and – I was lucky!

After downloading the driver-files from the FreeBSD sourectree, I made a Makefile for this driver:

.PATH: ${.CURDIR}
KMOD= if_nfe
SRCS= if_nfe.c miibus_if.h opt_bdg.h device_if.h bus_if.h pci_if.h

.include <bsd.kmod.mk>

So, the directory with the files looked like this:

drwxr-xr-x 4 root wheel 512 Dec 22 17:11 ..
-rw-r–r– 1 root wheel 156 Nov 24 2007 Makefile
-rw-r–r– 1 root wheel 82631 Nov 24 2007 if_nfe.c
-rw-r–r– 1 root wheel 10223 Nov 24 2007 if_nfereg.h
-rw-r–r– 1 root wheel 3633 Nov 24 2007 if_nfevar.h

Compiling the driver with a simple “make” on the commandline made no problems, but after installing the driver, there were some wired effects, that prevent the driver from working fine (You shouldn’t install the driver at this time, so I explain this later). After a lot of more work I found out, that the native nve-Support in the kernel must be disabled (you should do this first):

By editing the Kernel Config (Here you find how to make a new kernel for FreeBSD) and commenting out the following line:

device nve # nVidia nForce MCP on-board Ethernet Networking

change to:

#device nve # nVidia nForce MCP on-board Ethernet Networking // removed 21.12.2008 sch

After building the new kernel, the devices can be used as expected. To install the driver you compiled, you must copy the resulting driver into the modules directory:

/root# cp if_nfe.ko /boot/modules/.

To load this driver at boot-time of the system change the /boot/loader.conf, by adding the following line:

if_nfe_load="yes"

You do not need to restart the system. To load the driver during runtime, simply type the following into your command-line:

kldload if_nfe

After this, your ifconfig will look like this:

/root# ifconfig
nfe0: flags=8843 mtu 1500
options=1b
inet 192.168.1.110 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:e0:81:b5:45:08
media: Ethernet autoselect (100baseTX )
status: active
nfe1: flags=8802 mtu 1500
options=1b
ether 00:e0:81:b5:45:09
media: Ethernet autoselect (none)
status: no carrier
lo0: flags=8049 mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0×4
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000

That’s it – happy networking!

Categories: FreeBSD Tags: , , , , ,