From owner-freebsd-questions@FreeBSD.ORG Sun Dec 5 11:24:37 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F53B16A4CE for ; Sun, 5 Dec 2004 11:24:37 +0000 (GMT) Received: from engine140.deployzone.net (engine140.deployzone.net [193.17.85.140]) by mx1.FreeBSD.org (Postfix) with SMTP id E82DB43D58 for ; Sun, 5 Dec 2004 11:24:35 +0000 (GMT) (envelope-from chris@zumbrunn.com) Received: from adsl-212-90-218-5.cybernet.ch [212.90.218.5] by engine140.deployzone.net; Sun, 5 Dec 2004 12:23:08 +0100 Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3A6CF600-46B0-11D9-B9E6-000A95C969C6@zumbrunn.com> Content-Transfer-Encoding: 7bit From: Chris Zumbrunn Date: Sun, 5 Dec 2004 12:24:29 +0100 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.619) Subject: Machine doesn't boot after switching from Linux to FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2004 11:24:37 -0000 I'm trying to switch a Linux system to FreeBSD. I have two existing FreeBSD boxes running on the same kind of hardware and my approach was to rsynch the disk contents from one of those existing configs and just change the IP configuration in /etc/rc.conf. After fdisk, disklabel, and newfs for the disks and the rsync for the data I am left with a system that won't boot. When attempting to boot from the local disks I can't ping the system anymore, when net-booting back into rescue mode I see that nothing was written to /var/messages/log. So, I guess this looks like a bootstrapping problem. The FreeBSD config that I'm rsynching to the new box is FreeBSD 4.9-RELEASE. Both the existing machine and the new machine have the same kind of disks in them: ar0: 117246MB [14946/255/63] status: READY subdisks: 0 READY ad0: 117246MB [238216/16/63] at ata0-master PIO4 1 READY ad2: 117246MB [238216/16/63] at ata1-master The full dmesg output that I get after net-booting from the rescue disk I included on the very bottom of this message. Here is what I did before expecting a bootable machine: #> dd if=/dev/zero of=/dev/ar0 bs=512 count=32 #> fdisk -BI ar0 #> dd if=/dev/zero of=/dev/ar0s1 bs=512 count=32 #> disklabel -w -B ar0s1 auto #> disklabel -e ar0s1 #> newfs ar0s1a #> mount /dev/ar0s1a /mnt ...followed by a rsync to /mnt/ from / of the existing machine ...followed by editing the IP configuration in /mnt/etc/rc.conf ...followed by attempting to boot from the local disks But before I got that far I had some problems for which I found the following work-arounds: Initial problem: #> fdisk -BI ar0 fdisk: can't get disk parameters on /dev/ar0; supplying dummy ones ******* Working on device /dev/ar0 ******* fdisk: invalid fdisk partition table found fdisk: /boot/mbr: length must be a multiple of sector size #> disklabel -w -B ar0s1 auto cylinders/unit 0 #> disklabel -e ar0s1 disklabel: ioctl DIOCGDINFO: Invalid argument I created a fdisk.conf file as follows: g c14946 h255 s63 p 1 165 0 240107490 p 2 0 0 0 p 3 0 0 0 p 4 0 0 0 a 1 ...and tried: #> fdisk -f ./fdisk.conf ar0 fdisk: can't get disk parameters on /dev/ar0; supplying dummy ones ******* Working on device /dev/ar0 ******* fdisk: invalid fdisk partition table found fdisk: /boot/mbr: length must be a multiple of sector size I net-booted into the alternative Linux-based rescue disk and did the following with both fdisk /dev/hda and fdisk /dev/hdc in order to get rid of the existing Linux partitioning and setup: Created a new empty DOS partition table: Disk /dev/hda: 255 heads, 63 sectors, 14946 cylinders Units = cylinders of 16065 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 1 14946 120053713+ a5 FreeBSD And created a bsd disklabel: Reading disklabel of /dev/hda1 at sector 64. /dev/hda1 contains no disklabel. Do you want to create a disklabel? (y/n) y # /dev/hda1 : type: ST506 disk: label: flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 255 sectors/cylinder: 16065 cylinders: 14946 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 4 partitions: # start end size fstype [fsize bsize cpg] c: 1* 14946 14945* unused 0 0 d: 1 14946 14946 unused 0 0 Then I net-booted back into the FreeBSD-based rescue mode and still got stuck first on "fdisk -BI ar0" but this time was able to do "fdisk -f ./fdisk.conf ar0": #> dd if=/dev/zero of=/dev/ar0 bs=512 count=32 dd: /dev/ar0: Read-only file system 2+0 records in 1+0 records out 512 bytes transferred in 0.001042 secs (491415 bytes/sec) #> fdisk -BI ar0 ******* Working on device /dev/ar0 ******* fdisk: invalid fdisk partition table found #> fdisk -f ./fdisk.conf ar0 ******* Working on device /dev/ar0 ******* #> fdisk -BI ar0 ******* Working on device /dev/ar0 ******* #> dd if=/dev/zero of=/dev/ar0s1 bs=512 count=32 dd: /dev/ar0s1: Read-only file system 2+0 records in 1+0 records out 512 bytes transferred in 0.001049 secs (488064 bytes/sec) #> disklabel -w -B ar0s1 auto #> disklabel -e ar0s1 I edited the disklabel and changed it from: # /dev/ar0s1c: type: unknown disk: amnesiac label: flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 255 sectors/cylinder: 16065 cylinders: 14945 sectors/unit: 240107427 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 8 partitions: # size offset fstype [fsize bsize bps/cpg] c: 240107427 0 unused 0 0 # (Cyl. 0 - 14945*) ...to the config I'm successfully using on other boxes: # /dev/ar0s1: type: ESDI disk: ar0s1 label: flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 255 sectors/cylinder: 16065 cylinders: 14945 sectors/unit: 240107427 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 240107427 0 4.2BSD 2048 16384 89 # (Cyl. 0 - 14945*) c: 240107427 0 unused 0 0 # (Cyl. 0 - 14945*) After that I was able to construct a new file system: #> newfs ar0s1a Warning: Block size and bytes per inode restrict cylinders per group to 89. Warning: 96 sector(s) in last cylinder unallocated /dev/ar0s1a: 240107424 sectors in 58620 cylinders of 1 tracks, 4096 sectors 117240.0MB in 659 cyl groups (89 c/g, 178.00MB/g, 22528 i/g) super-block backups (for fsck -b #) at: 32, 364576, 729120, 1093664, 1458208, 1822752, 2187296, 2551840, 2916384, 3280928, 3645472, 4010016, 4374560, 4739104, 5103648, 5468192, 5832736, 6197280, 6561824, 6926368, 7290912, 7655456, ..... 238047264, 238411808, 238776352, 239140896, 239505440, 239869984 And I was able to mount it and rsynch the disk contents from a matching existing freebsd machine (FreeBSD 4.9-RELEASE). #> mount /dev/ar0s1a /mnt ..... #> ll /mnt total 8472 -rw-r--r-- 1 root wheel 802 Oct 27 2003 .cshrc -rw-r--r-- 1 root wheel 251 Oct 27 2003 .profile -r--r--r-- 1 root wheel 4735 Oct 27 2003 COPYRIGHT drwxr-xr-x 2 root wheel 1024 May 29 2004 bin drwxr-xr-x 3 root wheel 512 May 29 2004 boot drwxr-xr-x 2 root wheel 512 May 29 2004 cdrom lrwxrwxrwx 1 root wheel 10 Dec 4 18:52 compat -> usr/compat drwxr-xr-x 3 root wheel 18432 Sep 12 14:19 dev drwxr-xr-x 2 root wheel 512 May 29 2004 dist drwxr-xr-x 16 root wheel 2048 Nov 30 09:10 etc lrwxrwxrwx 1 root wheel 9 Dec 4 19:53 home -> /usr/home -r-xr-xr-x 1 root wheel 4264923 Jun 9 09:55 kernel -r-xr-xr-x 1 root wheel 4264923 Jun 9 09:55 kernel.GENERIC drwxrwxrwt 2 root wheel 512 Jul 2 17:28 lost+found drwxr-xr-x 2 root wheel 512 Oct 27 2003 mnt drwxr-xr-x 2 root wheel 4096 Jul 2 15:55 modules dr-xr-xr-x 60 root wheel 1024 Dec 4 19:51 proc drwxr-xr-x 3 root wheel 512 Aug 19 18:40 root drwxr-xr-x 2 root wheel 2048 May 29 2004 sbin drwxr-xr-x 4 root wheel 1024 May 29 2004 stand lrwxrwxrwx 1 root wheel 11 Dec 4 19:54 sys -> usr/src/sys drwxrwxrwt 5 root wheel 2048 Dec 4 17:30 tmp drwxr-xr-x 21 root wheel 512 Oct 30 18:46 usr drwxr-xr-x 21 root wheel 512 Nov 29 08:54 var I edited /mnt/etc/rc.conf to change the ifconfig to the different IP address. But attempting to boot from the local disks fails. I can't ping the machine anymore and don't know where it is hanging since I only have remote access. After net-booting back into the rescue mode it doesn't look like anything was written to /mnt/var/log/messages during the local boot attempt. How do I verify that the bootstrapping is configured right? Or where else am I going wrong? Thanks for any tips! Chris dmesg output after net-booting from the rescue disk: Copyright (c) 1992-2003 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 4.9-STABLE #0: Sat May 29 16:12:36 CEST 2004 mw@mailstore02.vianetworks.ch:/data/src/sys/compile/NFSROOT Timecounter "i8254" frequency 1193182 Hz CPU: Intel(R) Pentium(R) 4 CPU 2.80GHz (2790.72-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0xf29 Stepping = 9 Features=0xbfebfbff real memory = 1073479680 (1048320K bytes) avail memory = 1039429632 (1015068K bytes) Preloaded elf kernel "kernel" at 0xc054c000. Warning: Pentium 4 CPU: PSE disabled Pentium Pro MTRR support enabled md0: Malloc disk Using $PIR table, 11 entries at 0xc00f28c0 npx0: on motherboard npx0: INT 16 interface pcib0: on motherboard pci0: on pcib0 agp0: mem 0xf8000000-0xfbffffff at device 0.0 on pci0 pcib1: at device 1.0 on pci0 pci1: on pcib1 pcib2: at device 30.0 on pci0 pci2: on pcib2 fxp0: port 0xdf00-0xdf3f mem 0xfeaa0000-0xfeabffff,0xfeafe000-0xfeafefff irq 11 at device 12.0 on pci2 fxp0: Ethernet address 00:11:11:15:a7:ce inphy0: on miibus0 inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto fxp1: port 0xde80-0xdebf mem 0xfea80000-0xfea9ffff,0xfeafd000-0xfeafdfff irq 10 at device 13.0 on pci2 fxp1: Ethernet address 00:11:11:15:a7:d2 inphy1: on miibus1 inphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto pci2: at 15.0 irq 11 isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0xffa0-0xffaf at device 31.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 uhci0: port 0xef40-0xef5f irq 10 at device 31.2 on pci0 usb0: on uhci0 usb0: USB revision 1.0 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered pci0: (vendor=0x8086, dev=0x2443) at 31.3 irq 9 uhci1: port 0xef80-0xef9f irq 6 at device 31.4 on pci0 usb1: on uhci1 usb1: USB revision 1.0 uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered orm0: