Installation av OpenBSD 4.3


2008-08-16  av ajla


Här följer en guide om hur ni installerar OpenBSD 4.3 på er dator.
Denna guide bygger på i386 plattformen, och om ni installerar på ex. en sparc64 så ser installationen lite annorlunda ut, men inte mycket.


Denna guide installerar hela eller en mindre variant av OpenBSD, det väljer ni under installationen. Vilket som passar er är beroende på vad ni skall använda er burk till. Är det en firewall så är en minimal installation att föredra, medan en fullversion är för om ni skall installera en arbetsdator med X.

Denna guide är en grundinstallation, dvs. ni får utefter denna flöjla någon annan guide här på sidan för att göra något av er installation. 

Denna guide förutsätter att du har skivorna. 


Under FDISK så kommer du ha helt andra värden än just denna installation då du inte har samma disk som jag. Även annat kan skilja.

erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell? i

Welcome to the OpenBSD/i386 4.3 install program.

This program will help you install OpenBSD. At any prompt except password
prompts you can escape to a shell by typing '!'. Default answers are shown
in []'s and are selected by pressing RETURN. At any time you can exit this
program by pressing Control-C, but exiting during an install can leave your
system in an inconsistent state.

Terminal type: [vt220] <enter>
kbd(8) mapping? ('L' for list) [none] sv

IS YOUR DATA BACKED UP? As with anything that modifies disk contents, this
program can cause SIGNIFICANT data loss.

It is often helpful to have the installation notes handy. For complex disk
configurations, relevant disk hardware manuals and a calculator are useful.

Proceed with install? [no] y
Cool! Let's get to it.

You will now initialize the disk(s) that OpenBSD will use. To enable all
available security features you should configure the disk(s) to allow the
creation of separate filesystems for /, /tmp, /var, /usr, and /home.

Available disks are: wd0.
Which one is the root disk? (or done) [wd0] <enter>
Do you want to use *all* of wd0 for OpenBSD? [no] y
Putting all of wd0 into an active OpenBSD MBR partion (type 'A6')...done.

You will now create an OpenBSD disklabel inside the OpenBSD MBR
partition. The disklabel defines how OpenBSD splits up the MBR partition
into OpenBSD partitions in which filesystems and swap space are created.

The offsets used in the disklabel are ABSOLUTE, i.e. relative to the
start of the disk, NOT the start of the OpenBSD MBR partition.

# Inside MBR partition 3: type A6 start 63 size 80292807

Treating sectors 63-80292870 as the OpenBSD portion of the disk.
You can use the 'b' command to change this.


Initial label editor (enter '?' for help at any prompt)
> p

device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: Maxtor
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 16383
total bytes: 38.3G
free bytes: 0.3G
rpm: 3600

16 partitions:
#             size        offset  fstype [fsize bsize  cpg]
  a:         38.3G          0.0G  MSDOS   2048 16384  328 
  c:         38.3G          0.0G  unused      0     0      
Här ovan är vi i FDISK, det är här vi skall partionera disken så att det blir en BSD struktur.
Och här finns det ett par kommandon som ni skall nu använda.
Och de enda ni behöver är p, a, q och ev. d.

p - visar den nuvarande partitionen
a - skapar en ny partition
q - quitar
d - tar bort en partition

som ni ser här ovan så har ni en c:, och nu är det inte som i Windows att detta är "bootdisken". C är hela disken, denna går inte att ta bort eller att "användas" om man säger så..  Bara glöm den! Vad du i ställer skall koncentrera dig på är a: som du ser ovan, och än en gång...   detta är min disk, och detta är en gammal Windows disk varför det står [MSDOS], din disk kanske inte innehåller någon a: eller har många partitioner.



Nu är denna disk på 40GB och under denna installation kommer vi skapa 5 partitioner, nämligen dessa:

/  -  1GB
/swap  -  512MB
/var  -  512MB
/var/log  -  512MB
/usr  -  2GB

Som ni ser ovan kommer vi endast utnyttja 4.5 GB av disken, men du får självklart välja storlekar själv eller lägga till fler/mindre partitioner. Om du gör en desktop så är en stor /home partition tex. bra.

Så.. nu skall vi ta bort a:
> d a
> p
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: Maxtor
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 16383
total bytes: 38.3G
free bytes: 38.3G
rpm: 3600

16 partitions:
#             size        offset  fstype [fsize bsize  cpg]
  c:         38.3G          0.0G  unused      0     0 
> a a
offset: [63] <enter>
size: [000000000] 1G
Rounding to nearest cylinder: 000000000
FS type: [4.3BSD] <enter>
mount point: [none] /
> a b
offset: [000000000] <enter>
size: [000000000] 512M
Rounding to nearest cylinder: 000000000
FS type: [swap] <enter>
> a d
offset: [000000000] <enter>
size: [000000000] 512M
Rounding to nearest cylinder: 000000000
FS type: [4.3BSD] <enter>
mount point: [none] /var
> a e
offset: [000000000] <enter>
size: [000000000] 512M
Rounding to nearest cylinder: 000000000
FS type: [4.3BSD] <enter>
mount point: [none] /var/log
> a g
offset: [000000000] <enter>
size: [000000000] 2g
Rounding to nearest cylinder: 000000000
FS type: [4.3BSD] <enter>
mount point: [none] /usr
> q
No label changes.
Mount point for wd0a (size=1GB)? (or 'none' or 'done') [/] <enter>
Mount point for wd0d (size=512MB)? (or 'none' or 'done') [/var] <enter>
Mount point for wd0e (size=512MB)? (or 'none' or 'done') [/var/log] <enter>
Mount point for wd0h (size=1GB)? (or 'none' or 'done') [/usr] done
No more disks to initialize.

OpenBSD filesystems:
wd0a /
wd0d /var
wd0e /var/log
wd0g /usr

The next step *DESTROYS* all existing data on these partitions!
Are you really sure that you're ready to proceed? [no] y
/dev/rwd0a:     000000000 sectors in 000000000 cylinders of 16 tracks, 63 sectors
        1024.0MB in 64 cyl groups 
/dev/rwd0d:     000000000 sectors in 4161 cylinders of 16 tracks, 63 sectors
        512.0MB in 13 cyl groups
/dev/rwd0e:     000000000 sectors in 12483 cylinders of 16 tracks, 63 sectors
        512.0MB in 39 cyl groups 
/dev/rwd0g:     000000000 sectors in 20805 cylinders of 16 tracks, 63 sectors
        1024.0MB in 64 cyl groups 
/dev/wd0a on /mnt type ffs
(rw, asynchronous, local, ctime=Fri Aug 15 04:32:41 2008) /dev/wd0d on /mnt/var type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Fri Aug 15 04:32:41 2008) /dev/wd0e on /mnt/var/log type ffs
(rw, asynchronous, local, nodev, ctime=Fri Aug 15 04:32:41 2008) /dev/wd0e on /mnt/usr type ffs
(rw, asynchronous, local, nodev, nosuid, ctime=Fri Aug 15 04:32:41 2008)

Nu när disken är partitionerad skall vi konfigurera nätverket. Här kan man antingen ange fast IP eller om man använder DHCP. Om man använder DHCP så skall man ange följande information:
 
Which one do you wish to initialize? (or 'done') [fxp0] <enter>
Symbolic (host) name for fxp0? [fxp0] ext_if
The media options for fxp0 are currently
      media: Ethernet autoselect (1000baseTX full-duplex)
Do you want to change the media options? [no] <enter>
IPv4 address for fxp0? (or 'none' or 'dhcp') dhcp
Netmask? [255.255.255.0] <enter>
IPv6 address for fxp0? (or 'rtsol' or 'none') [none] <enter>


Men om man nu använder fasta IP i sitt nätverk eller får från ISPn så skall man använda denna del:
System hostname (short form, e.g. 'foo'): burk
Configure the network? [yes] <enter>
Available interfaces are: fxp0.
Which one do you wish to initialize? (or 'done') [fxp0] <enter>
Symbolic (host) name for fxp0? [fxp0] ext_if
The media options for fxp0 are currently
      media: Ethernet autoselect (1000baseTX full-duplex)
Do you want to change the media options? [no] <enter>
IPv4 address for fxp0? (or 'none' or 'dhcp') Ett fast IP, alt. ett från din ISP
Netmask? [255.255.255.0] <enter>, alt. din ISP's netmask
IPv6 address for fxp0? (or 'rtsol' or 'none') [none] <enter>
No more interfaces to initilaize.
DNS domain name? (e.g. 'bar.com') [my.domain] Din.domain (om du har någon) annars <enter>
DNS nameserver? (IP address or 'none') [none] Din DNS från ISP, om du använder DHCP <enter>
Default IPv4 route? (IP address, 'dhcp' or 'none') Din ISP's Gateway eller din lokala. Om DHCP <enter>
add net default: gateway DIN ISP's GATEWAY's IP
Edit hosts with ed? [no] <enter>
Do you want to do any manual network configuration? [no] <enter>
Password for root account? (will not echo) PASSWORD
Password for root account? (again) PASSWORD

Nu när nätverket är installerat så skall vi påbörja själva installationen. Och här visar jag två olika valmöjligheter, självklart har du fler..  du får installera vad du känner för! Men först så skall vi välja en minimal lösning, och det är här som vi bestämmer det.

ALT 1
Let's install the sets! Location of sets? (cd disk ftp http or 'done') [cd] <enter>
Available CD-ROMs are: cd0.
Which one contains the install media? (or 'done') [cd0] <enter>

Pathname to the sets? (or 'done') [4.3/i386] <enter>
Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-' to the set name, file name pattern or 'all'. Selected
sets are labelled '[X]'.

        [X] bsd
        [X] bsd.rd
        [ ] bsd.mp
        [X] base43.tgz
        [X] etc43.tgz
        [X] misc43.tgz
        [X] comp43.tgz
        [X] man43.tgz
        [X] game43.tgz
        [ ] xbase43.tgz
        [ ] xetc43.tgz
        [ ] xshare43.tgz
        [ ] xfont43.tgz
        [ ] xserv43.tgz
Set name? (or 'done') [bsd.mp] -all

        [X] bsd
        [ ] bsd.rd
        [ ] bsd.mp
        [ ] base43.tgz
        [ ] etc43.tgz
        [ ] misc43.tgz
        [ ] comp43.tgz
        [ ] man43.tgz
        [ ] game43.tgz
        [ ] xbase43.tgz
        [ ] xetc43.tgz
        [ ] xshare43.tgz
        [ ] xfont43.tgz
        [ ] xserv43.tgz
Set name? (or 'done') [bsd.mp] bsd

        [X] bsd
        [ ] bsd.rd
        [ ] bsd.mp
        [X] base43.tgz
        [ ] etc43.tgz
        [ ] misc43.tgz
        [ ] comp43.tgz
        [ ] man43.tgz
        [ ] game43.tgz
        [ ] xbase43.tgz
        [ ] xetc43.tgz
        [ ] xshare43.tgz
        [ ] xfont43.tgz
        [ ] xserv43.tgz        
Set name? (or 'done') [bsd.mp] ba*

        [X] bsd
        [ ] bsd.rd
        [ ] bsd.mp
        [X] base43.tgz
        [X] etc43.tgz
        [ ] misc43.tgz
        [ ] comp43.tgz
        [ ] man43.tgz
        [ ] game43.tgz
        [ ] xbase43.tgz
        [ ] xetc43.tgz
        [ ] xshare43.tgz
        [ ] xfont43.tgz
        [ ] xserv43.tgz         
Set name? (or 'done') [bsd.mp] et*

        
Set name? (or 'done') [done] done
Ready to install sets? [yes] <enter>

Getting bsd ...
100% |**************************************************|  5972 KB    00:24    
Getting base43.tgz ...
100% |**************************************************| 41437 KB    02:01    
Getting etc43.tgz ...
100% |**************************************************| 1210  KB    00:06    

Location of sets? (cd disk ftp http or 'done') [done] done
Nu har vi en liten installation perfekt till en firewall.



ALT 2

Men om vi köra med X etc. så kan vi välja alla filer. Då gör vi så här:
Let's install the sets! Location of sets? (cd disk ftp http or 'done') [cd] <enter>
Available CD-ROMs are: cd0.
Which one contains the install media? (or 'done') [cd0] <enter>

Pathname to the sets? (or 'done') [4.3/i386] <enter>
Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-' to the set name, file name pattern or 'all'. Selected
sets are labelled '[X]'.

        [X] bsd
        [X] bsd.rd
        [ ] bsd.mp
        [X] base43.tgz
        [X] etc43.tgz
        [X] misc43.tgz
        [X] comp43.tgz
        [X] man43.tgz
        [X] game43.tgz
        [ ] xbase43.tgz
        [ ] xetc43.tgz
        [ ] xshare43.tgz
        [ ] xfont43.tgz
        [ ] xserv43.tgz
Set name? (or 'done') [bsd.mp] all

        [X] bsd
        [X] bsd.rd
        [X] bsd.mp
        [X] base43.tgz
        [X] etc43.tgz
        [X] misc43.tgz
        [X] comp43.tgz
        [X] man43.tgz
        [X] game43.tgz
        [X] xbase43.tgz
        [X] xetc43.tgz
        [X] xshare43.tgz
        [X] xfont43.tgz
        [X] xserv43.tgz

Set name? (or 'done') [done] <enter>
Ready to install sets? [yes] <enter>

Getting bsd ...
100% |**************************************************|  5972 KB    00:25    
Getting bsd.rd ...
100% |**************************************************|  4887 KB    00:26    
Getting bsd.mp ...
100% |**************************************************|  6020 KB    00:27    
Getting base43.tgz ...
100% |**************************************************| 41437 KB    02:23    
Getting etc43.tgz ...
100% |**************************************************|  1210 KB    00:09    
Getting misc43.tgz ...
100% |**************************************************|  2238 KB    00:15    
Getting comp43.tgz ...
100% |**************************************************| 76666 KB    01:21    
Getting man43.tgz ...
100% |**************************************************|  7473 KB    00:28   
Getting game43.tgz ...
100% |**************************************************|  2548 KB    00:14    
Getting xbase43.tgz ...
100% |**************************************************| 10344 KB    00:56    
Getting xetc43.tgz ...
100% |**************************************************| 90772       00:03    
Getting xshare43.tgz ...
100% |**************************************************|  2024 KB    00:09    
Getting xfont43.tgz ...
100% |**************************************************| 32456 KB    02:42    
Getting xserv43.tgz ...
100% |**************************************************| 19365 KB    01:18   
 
Location of sets? (cd disk ftp http or 'done') [done] done





Nu är vi snart färdiga, men sist skall vi ställa in ssh, tidszon etc.
Start sshd(8) by default? [yes] <enter>
Start ntpd(8) by default? [no] <enter>
Do you expect to run the X Window System? [no] <enter>
Change the default console to com0? [no] <enter>
Saving configuration files...done.
Generating initial host.random file...done.
What timezone are you in? ('?' for list) [Canada/Mountain] Europe/Stockholm
Setting local timezone to 'America/Los_Angeles'...done.
Making all device nodes...done.
Installing boot block...
boot: /mnt/boot
proto: /usr/mdec/biosboot
device: /dev/rwd0c
/usr/mdec/biosboot: entry point 0
proto bootblock size 512
/mnt/boot is 3 blocks x 16384 bytes
fs block shift 2; part offset 63; inode block 24, offset 1704
using MBR partition 3: type 166 (0xa6) offset 63 (0x3f)
done.

CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter halt at the command prompt. Once the
system has halted, reset the machine and boot from the disk.
# reboot

syncing disks... done

The operating system has halted.
Please press any key to reboot.

Nu har du installerat OpenBSD 4.3 på din burk. 

:: Tillbaka