# automated install incorrect partition type



## babel17 (Jun 29, 2010)

I'm doing an automated install, and it all works, except that the partition type is incorrect (so, of course it won't boot). If I pull the drive out and look at it on another machine, I get:


```
[brj1-sut]tmp# fdisk -p /dev/ad10
# /dev/ad10
g c969021 h16 s63
p 1 0x03 63 262142433
```

Instead of 


```
[brj1-sut]tmp# fdisk -p /dev/ad10
# /dev/ad10
g c969021 h16 s63
p 1 0xa5 63 262142433
A 1
```

The relevant code from my install.cfg is


```
disk=ad4
partition=262143441
bootManager=boot
diskPartitionEditor

ad4s1-1=ufs 41943040 /
ad4s1-2=ufs 41943040 /shared 1
ad4s1-3=ufs 41943040 /upload 1
ad4s1-4=ufs 135168000 /crash 1
ad4s1-5=swap 0 none

installCommit
```

This is all with a cleared disk:
I do [CMD=""]dd if=/dev/zero of=/dev/ad10 bs=512 count=64[/CMD]  before I insert the drive in the build machine.

Am I missing something?


----------



## Tom-i (Jun 29, 2010)

Hej i have this problem too ;-)

How do you start your install? Do you use a coustom mfsroot?


----------



## babel17 (Jun 29, 2010)

Yeah, I just put the following in install.cfg and then put install.cfg at the base of my mfsroot


```
debug=yes
hostname=netbuild
domainname=XXX.com
nfs=192.168.2.51:/sa/jumpstart/src
netDev=em3
tryDHCP=YES
mediaSetNFS
disk=ad4
partition=262143441
bootManager=booteasy
diskPartitionEditor
ad4s1-1=ufs 41943040 /
ad4s1-2=ufs 41943040 /shared 1
ad4s1-3=ufs 41943040 /upload 1
ad4s1-4=ufs 135168000 /crash 1
ad4s1-5=swap 0 none
diskLabelEditor
distSetEverything
installCommit
shutdown
```

If I pull the disk out and use fdisk to change the partition type to 0xa5 and throw the disk back in, it all works.  Right now I'm thinking the workaround is a custom package to that before rebooting.


I agree that the current automated install documentation is sparse and out of date.  When I get this all working, I plan on contributing detailed documentation on how I did it, but I aint there yet.


----------



## Tom-i (Jun 30, 2010)

Did you manage to include wget or fetch in your boot crunch?

Tried this way...


```
ports fetch
```

ends with 


```
llzma -lusb -ljail
fetch.lo(.text+0x5b8): In function `fetch':
: undefined reference to `fetchDebug'
fetch.lo(.text+0x5be): In function `fetch':
: undefined reference to `fetchDebug'
fetch.lo(.text+0x639): In function `fetch':
: undefined reference to `fetchFreeURL'
fetch.lo(.text+0x67c): In function `fetch':
: undefined reference to `fetchParseURL'
fetch.lo(.text+0x79c): In function `fetch':
: undefined reference to `fetchTimeout'
fetch.lo(.text+0x7eb): In function `fetch':
: undefined reference to `fetchXGet'
fetch.lo(.text+0x8c9): In function `fetch':
: undefined reference to `fetchStat'
fetch.lo(.text+0xdef): In function `fetch':
: undefined reference to `fetchStat'
fetch.lo(.text+0xe14): In function `fetch':
: undefined reference to `fetchXGet'
fetch.lo(.text+0x151d): In function `fetch':
: undefined reference to `fetchXGet'
fetch.lo(.text+0x1695): In function `fetch':
: undefined reference to `fetchLastErrString'
fetch.lo(.text+0x172b): In function `fetch':
: undefined reference to `fetchLastErrString'
fetch.lo(.text+0x177f): In function `fetch':
: undefined reference to `fetchLastErrCode'
fetch.lo(.text+0x1787): In function `fetch':
: undefined reference to `fetchLastErrString'
fetch.lo(.text+0x19bc): In function `fetch':
: undefined reference to `fetchLastErrString'
fetch.lo(.text+0x1fd2): In function `main':
: undefined reference to `fetchRestartCalls'
fetch.lo(.text+0x2068): In function `main':
: undefined reference to `fetchLastErrCode'
fetch.lo(.text+0x20ef): In function `main':
: undefined reference to `fetchLastErrCode'
fetch.lo(.text+0x225b): In function `main':
: undefined reference to `fetchAuthMethod'
fetch.lo(.text+0x2262): In function `main':
: undefined reference to `fetchAuthMethod'
*** Error code 1

Stop in /var/ftp/boot_crunch.
```

Wget i even dont know how to integrate...

Any ideas?

If i pass this step i can have a look at the partitions ;-)


----------



## babel17 (Jun 30, 2010)

I'm not doing any ports at the moment.  No point in installing ports if the thing won't boot.


----------



## babel17 (Jun 30, 2010)

So I've figured out that what I've got is a bug.  Furthermore, you can reproduce it from the command line as follows:


```
[brj1-sut]atkstat# sysinstall debug=YES nonInteractive=YES noWarn=Yes disk=ad8 partition=262143441 bootManager=booteasy diskPartitionEditor diskPartitionWrite

[brj1-sut]atkstat# fdisk /dev/ad8
******* Working on device /dev/ad8 *******
parameters extracted from in-core disklabel are:
cylinders=969021 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=969021 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 3 (0x03),(XENIX /usr file system)
    start 63, size 262142433 (127999 Meg), flag 0
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 1023/ head 15/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
```

I guess I'll figure out how to file a bug.


----------



## wblock@ (Jun 30, 2010)

babel17 said:
			
		

> I guess I'll figure out how to file a bug.



There's send-pr(1), but the web interface is easier (IMO).


----------



## babel17 (Jun 30, 2010)

Bug http://www.freebsd.org/cgi/query-pr.cgi?pr=148253 filed.

Don't know if that constitutes grounds to mark thread solved or not.  I choose not.


----------

