Re: Machine doesn't boot after switching from Linux to FreeBSD (solved)

2004-12-18 Thread Chris Zumbrunn
On Dec 5, 2004, at 12:24 PM, Chris Zumbrunn wrote:
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 ATA RAID1 array [14946/255/63] status: READY subdisks:
 0 READY ad0: 117246MB Maxtor 6Y120L0 [238216/16/63] at ata0-master 
PIO4
  1 READY ad2: 117246MB Maxtor 6Y120L0 [238216/16/63] at 
ata1-master

Finally found time again to attempt to resolve this and was able to get 
the system to boot after re-editing the slice table, partition table 
and again installing the bootstrapping code.

# fdisk -i ar0
# disklabel -e ar0s1
# fdisk -B ar0
# disklabel -B ar0s1
Not sure what the problem really was, but I noticed that for some 
reason I had ended up with slices 1, 2 and 3 unused and slice 4 for 
FreeBSD. I changed that to slice 1 - maybe that somehow made a 
difference.

Chris
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Machine doesn't boot after switching from Linux to FreeBSD

2004-12-05 Thread Chris Zumbrunn
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 ATA RAID1 array [14946/255/63] status: READY subdisks:
 0 READY ad0: 117246MB Maxtor 6Y120L0 [238216/16/63] at ata0-master  
PIO4
  1 READY ad2: 117246MB Maxtor 6Y120L0 [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  h255s63
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 BootStart   EndBlocks   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*unused0 0
  d:1 14946 14946 unused0 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