DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 31st July 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default I. Treating 'iso-itis' in an OpenBSD environment with USBmediazine®

I. Treating 'iso-itis' in an OpenBSD environment with USBmediazine®

Note: This article/guide has been written in the summer of 2007, a couple of weeks before the first complete installation ISO (installer and filesets) files turned up in the 4.1 snapshots. This was a major change of policy, because previously the ISO only was about 5 MB and only contained the installation program. So Please read the following with this in mind
  • The 'iso-itis' delusion
  • Overview of existing traditional 'iso-itis' remedies
  • Treatment with USBmediazine®
  • Physical requirements for the USBmediazine® therapy
  • The USBmediazine® therapy
  • Side-effects
  • USBmediazine® session transcripts
The 'iso-itis' delusion

'iso-itis' is a delusion or fixed false belief that the only way to install an operating system on a computer, is to burn a downloaded ISO image to CD and use this CD to install. Alternative installation methods are just plainly ignored.

Cases are known where patients seriously suffering from this disease, have stolen money from the savings box of their little brother or sister, to buy recordable CDs. And this just to satisfy their irresistible. urge of an ISO install of their favorite OS.

Iso-itis patients who downloaded an official OpenBSD ISO, however wait a terrible disappointment. The downloaded ISO only contains the OpenBSD installation program and not the actual files needed for installation. These files or install sets, are not included in the ISO image and should be retrieved from other media.

Although this fact and the reasoning for it, is clearly stated in http://www.openbsd.org/faq/faq3.html#ISO, the impossibility to install with this ISO, shatters their beliefs and causes bewilderment and serious dis-orientation.

Overview of existing traditional 'iso-itis' remedies

Quite some other iso-itis treatments, have been mentioned in literature, but most of them lack a detailed description or only seem applicable to upgrades of existing systems.
  • 'ftp-remote-ozene' and its 'ftp-local-ozene' derivate.

    Here the file sets are retrieve from a remote or local ftp server. Contra-indicated for environments lacking existing Internet connectivity or proper local hardware and ftp server software.

  • 'disk-local-dihydrate'

    For this treatment the necessary file sets need to be transferred from an existing local disk. The decreasing popularity of the FAT32 file system as well as the increasing number of incompatible mutations of the UFS and FFS file systems have seriously endangered the viability of this approach.

  • 'PXE-oxane'

    Contra-indicated for 'PXE-oxane' are older network cards without PXE support, cards with older PXE versions, and the absence of local network DHCP and tftpd servers.

  • 'NFS-bisulfate'

    Unfortunately having been contra-indicated for iso-itis patients with 'i386' hardware, 'NFS-bisulfate' will probably stay one of the most obscure and unknown treatments.

  • 'tape-trichloride'

    The very rare availability of tape drives in the ecosystem of 'iso-itis' patients rules out this method in practical all cases.
Treatment with USBmediazine®

Like many scientific discoveries, the basis of this remedy was found by accident.

The USBmediazine® approach has been discovered, when the author of this article noticed, that the OpenBSD installer successfully detected an USB flashdrive, which he forgot to remove the night before. To his surprise the device was even proposed as possible source to copy the installation files from.

Considering the availability of affordable supported USB hardware with sufficient storage capacity, author expresses the belief that the USBmediazine® approach is an attractive alternative for the existing traditional therapies.

To treat iso-itis we will show how to use an USB device as information carrier for the install sets. While booting, the OpenBSD installation program will probe for USB devices. The detected USB storage devices will be offered as source to copy the install sets from.

IMPORTANT: Due to the limited resources, the capability to dynamically detect USB devices is not present in the stripped down installation kernel. The USB device, containing the install sets, must be inserted before the installation program is started. Insertion halfway during the install will not be noticed and thus lead to failure.

Although we will use an OBSD snapshot instead of an OBSD release, this method has been successfully tested with releases in a clinical environment.

Physical requirements for the USBmediazine® therapy
  1. Bootable OpenBSD installation CD created from an official 'cd41.iso' image

  2. USB storage device containing the installation file sets

    Possibilities: external USB hard drive, USB flash drive, USB card-reader with a memory card (e.g. Secure Digital or CompactFlash)
The following is a listing of the files in an installation directory as found on the OpenBSD ftp servers. Only the emphasized ones are needed for an OpenBSD installation.
Code:
       100,767 Jun 20 18:06 INSTALL.i386
        22,354 Jun 20 18:06 INSTALL.linux
         1,019 Jun 20 18:06 MD5
    42,550,189 Jun 20 18:06 base41.tgz
     6,145,660 Jun 20 18:06 bsd
     6,194,002 Jun 20 18:06 bsd.mp
     5,027,399 Jun 20 18:06 bsd.rd
     5,144,576 Jun 20 18:06 cd41.iso
        44,368 Jun 20 18:06 cdboot
         2,048 Jun 20 18:06 cdbr
     3,012,608 Jun 20 18:06 cdemu41.iso
     2,949,120 Jun 20 18:06 cdrom41.fs
    78,804,008 Jun 20 18:06 comp41.tgz
     1,240,440 Jun 20 18:06 etc41.tgz
     1,474,560 Jun 20 18:06 floppy41.fs
     1,474,560 Jun 20 18:06 floppyB41.fs
     1,474,560 Jun 20 18:06 floppyC41.fs
     2,608,788 Jun 20 18:06 game41.tgz
           263 May 05 10:04 index.txt
     7,658,376 Jun 20 18:06 man41.tgz
     2,292,841 Jun 20 18:06 misc41.tgz
        52,864 Jun 20 18:06 pxeboot
    11,956,269 Jun 10 12:11 xbase41.tgz
        75,554 Jun 10 12:11 xetc41.tgz
    35,579,466 Jun 10 12:11 xfont41.tgz
    10,348,663 Jun 10 12:11 xserv41.tgz
     2,547,511 Jun 10 12:11 xshare41.tgz
The patient only has to download these files and copy them to an USB storage device. The directory listing on a Secure Digital card in an Apacher USB card reader shows that the total storage space needed is only 201 MB.
Code:
$ env BLOCKSIZE=$((1024*1024)) ls -l /mnt/obsd
total 201
-rwxr-xr-x  1 root  wheel  42550189 Jun 22 04:57 base41.tgz
-rwxr-xr-x  1 root  wheel   6145660 Jun 22 04:56 bsd
-rwxr-xr-x  1 root  wheel   6194002 Jun 22 04:56 bsd.mp
-rwxr-xr-x  1 root  wheel   5027399 Jun 22 04:55 bsd.rd
-rwxr-xr-x  1 root  wheel  78804008 Jun 22 04:55 comp41.tgz
-rwxr-xr-x  1 root  wheel   1240440 Jun 22 04:53 etc41.tgz
-rwxr-xr-x  1 root  wheel   7658376 Jun 22 04:53 man41.tgz
-rwxr-xr-x  1 root  wheel   2292841 Jun 22 04:57 misc41.tgz
-rwxr-xr-x  1 root  wheel  11956269 Jun 22 05:03 xbase41.tgz
-rwxr-xr-x  1 root  wheel     75554 Jun 22 05:03 xetc41.tgz
-rwxr-xr-x  1 root  wheel  35579466 Jun 22 05:02 xfont41.tgz
-rwxr-xr-x  1 root  wheel  10348663 Jun 22 05:01 xserv41.tgz
-rwxr-xr-x  1 root  wheel   2547511 Jun 22 05:01 xshare41.tgz
The USBmediazine® therapy
  • Calm down the patient and assure him that the OpenBSD installation CD he created from the 5 MB cd41.iso image is not wasted. Coach the patient to download the needed installation files and copy them to an USB storage device.

  • Have the patient insert the USB storage device in an USB slot of his PC.

    As explained previously, attaching the USB device before the installation is an absolutely crucial requirement. Neglection of this step will lead to complete failure of the therapy. If the therapist resides in the USA, he may also risk a lawsuit for malpractice.

  • After starting the PC insert the CD. Interrupt the boot process to adjust the BIOS booting sequence. Enable the CD or DVD drive as first boot device. Save the BIOS change and continue booting.

  • The CD will start the OpenBSD installation program after having probed the available hardware. When the disk preparation and TCP/IP configurations have been concluded, select the USB storage device as source. Select the installation file sets needed and continue the install.
Optionally the therapy can be augmented by assisting the patient in doing an complete ISO-less install using the traditional 'bsd.rd' reinstall method as described in http://openbsd.org/faq/faq4.html#bsd.rd . Although this step is optional, it will eradicate the last traces of iso-itis from the patient's mind. In clinical tests many have reported an incredible feeling of freedom after re-installing OpenBSD completely ISO-less.

Side-effects

Wide proliferation of USBmediazine® could possibly harm the sales of OpenBSD release CDs. The proceeds of these CD's is a major form of funding the OpenBSD project

To minimize this side-effect and thus not endanger the financial future of the OpenBSD project, the therapist is required to use http://openbsd.org/donations.html to donate a percentage of his USBmediazine® generated income. He also should encourage the cured patients to do likewise.

USBmediazine® session transcripts

Part II is a transcript of a main therapy session where OpenBSD is installed using a 'cd41.iso>' CD. The installation file sets will be retrieved from a SD (Secure Digital) card in an USB card-reader.

The transcript in part III demonstrates the optional ISO-less therapy with the 'bsd.rd' installation kernel. This type of install can only be done on top of an existing OpenBSD system and is a favorite way to reinstall or upgrade. An USB flash memory disk is used as storage medium for the file sets.

Both these transcripts are solely meant to demonstrate the USBmediazine® method and should not be regarded in any way as a substitute for the excellent official OpenBSD installation guide at http://openbsd.org/faq/faq4.html.

$Id: new-iso-itis.xml,v 1.11 2007/06/27 04:41:19 j65nko Exp $
$Id: vbul-html.xsl,v 1.6 2007/06/27 04:49:57 j65nko Exp $
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #2   (View Single Post)  
Old 31st July 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default II. USBmediazine® OpenBSD install using 'cd41.iso' and SD card in USB card reader

II. USBmediazine® OpenBSD install using 'cd41.iso' and SD card in USB card reader
  • Introduction
  • Boot messages from the installation CD
  • Confirm start of install
  • Terminal type and keyboard mapping
  • Partitioning the disk at Master Boot Record level
  • Sub-partition OpenBSD MBR partition with 'disklabel'
  • TCP/IP network configuration
  • Password for root
  • Select SD card in USB card reader
  • Choose file sets
  • Copying install sets from SD card
  • Miscellaneous configuration
  • Setting timezone
  • Device nodes, boot block, 'halt' and reboot
Introduction

This transcript, captured with a serial console, demonstrates how USBmediazine® complements the CD created from a 'cd41.iso' image. Although not an obvious choice for an USB device, a Secure Digital card in an USB card reader shows the flexibility and physical media independence of the USBmediazine® approach.

To copy the installation files in the current working directory to a SD card under OpenBSD, use the following steps:
  1. Insert the SD card, or whatever memory card you wish to use, into the card reader and connect the reader to an USB port. For an Apacher USB card reader 'dmesg' shows:
    Code:
    umass0 at uhub0 port 2 configuration 1 interface 0
    umass0: Genesys Logic USB Storage, rev 2.00/93.21, addr 3
    umass0: using SCSI over Bulk-Only
    scsibus0 at umass0: 2 targets
    sd0 at scsibus0 targ 1 lun 0: <Generic, STORAGE DEVICE, 9321> SCSI0 0/direct removable
    sd0: drive offline
    sd1 at scsibus0 targ 1 lun 1: <Generic, STORAGE DEVICE, 9321> SCSI0 0/direct removable
    sd1: drive offline
    sd2 at scsibus0 targ 1 lun 2: <Generic, STORAGE DEVICE, 9321> SCSI0 0/direct removable
    sd2: 485MB, 485 cyl, 64 head, 32 sec, 512 bytes/sec, 994304 sec total
    sd3 at scsibus0 targ 1 lun 3: <Generic, STORAGE DEVICE, 9321> SCSI0 0/direct removable
    sd3: drive offline
    The four slots of the USB card reader have been designated the device names 'sd0', 'sd1', 'sd2' and 'sd4'. The 500 MB SD card has been detected as 'sd2'.

  2. Look at the partition table with 'fdisk'
    Code:
    snap@zeno[/data/snap/snap152]su root
    Password: .........
    
    # fdisk sd2
    fdisk: sysctl(machdep.bios.diskinfo): Device not configured
    Disk: sd2       geometry: 485/64/32 [994304 Sectors]
    Offset: 0       Signature: 0xAA55
             Starting       Ending       LBA Info:
     #: id    C   H  S -    C   H  S [       start:      size   ]
    ------------------------------------------------------------------------
    *0: 06    0   7 12 -  485  31 32 [         235:      994069 ] DOS > 32MB
     1: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
     2: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
     3: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
    The memory card has been formatted as a DOS partition.

  3. Check with 'disklabel'
    Code:
    # disklabel sd2
    disklabel: warning, DOS partition table with no valid OpenBSD partition
    # /dev/rsd2c:
    type: SCSI
    disk: SCSI disk
    label: STORAGE DEVICE
    flags:
    bytes/sector: 512
    sectors/track: 32
    tracks/cylinder: 64
    sectors/cylinder: 2048
    cylinders: 485
    total sectors: 994304
    rpm: 3600
    interleave: 1
    trackskew: 0
    cylinderskew: 0
    headswitch: 0           # microseconds
    track-to-track seek: 0  # microseconds
    drivedata: 0
    
    16 partitions:
    #             size        offset  fstype [fsize bsize  cpg]
      c:        994304             0  unused      0     0      # Cyl     0 -   485*
      i:        994069           235   MSDOS                   # Cyl     0*-   485*
    OpenBSD assigned the virtual label 'i'.

  4. Mount the card
    Code:
    # mount -t msdos /dev/sd2i /mnt
    # mount
    /dev/wd0a on / type ffs (local)
    /dev/wd0k on /home type ffs (local, nodev, nosuid)
    /dev/wd0d on /tmp type ffs (local, nodev, nosuid)
    /dev/wd0e on /usr type ffs (local, noatime, nodev, softdep)
    /dev/wd0h on /var type ffs (local, nodev, nosuid)
    /dev/wd0g on /var/qmail type ffs (local, nodev)
    /dev/wd0j on /data type ffs (local, nodev, nosuid)
    /dev/sd2i on /mnt type msdos (local)
  5. Create a directory 'obsd' for the installation file sets and copy them from the current directory. You will have to remember the directory name, because when the installation script will prompt you for this name, there is no easy way to look it up.
    Code:
    # mkdir /mnt/obsd
    
    # cp * /mnt/obsd
    
    # ls -l /mnt/obsd
    total 423968
    -rwxr-xr-x  1 root  wheel      1019 Jun 26 17:31 MD5
    -rwxr-xr-x  1 root  wheel  42550189 Jun 22 04:57 base41.tgz
    -rwxr-xr-x  1 root  wheel   6145660 Jun 22 04:56 bsd
    -rwxr-xr-x  1 root  wheel   6194002 Jun 22 04:56 bsd.mp
    -rwxr-xr-x  1 root  wheel   5027399 Jun 22 04:55 bsd.rd
    -rwxr-xr-x  1 root  wheel   5144576 Jun 26 17:31 cd41.iso
    -rwxr-xr-x  1 root  wheel  78804008 Jun 22 04:55 comp41.tgz
    -rwxr-xr-x  1 root  wheel   1240440 Jun 22 04:53 etc41.tgz
    -rwxr-xr-x  1 root  wheel   1474560 Jun 26 17:31 floppy41.fs
    -rwxr-xr-x  1 root  wheel   7658376 Jun 22 04:53 man41.tgz
    -rwxr-xr-x  1 root  wheel   2292841 Jun 22 04:57 misc41.tgz
    -rwxr-xr-x  1 root  wheel  11956269 Jun 22 05:03 xbase41.tgz
    -rwxr-xr-x  1 root  wheel     75554 Jun 22 05:03 xetc41.tgz
    -rwxr-xr-x  1 root  wheel  35579466 Jun 22 05:02 xfont41.tgz
    -rwxr-xr-x  1 root  wheel  10348663 Jun 22 05:01 xserv41.tgz
    -rwxr-xr-x  1 root  wheel   2547511 Jun 22 05:01 xshare41.tgz
  6. Unmount the card
    Code:
    # umount /dev/sd2i
    # mount
    /dev/wd0a on / type ffs (local)
    /dev/wd0k on /home type ffs (local, nodev, nosuid)
    /dev/wd0d on /tmp type ffs (local, nodev, nosuid)
    /dev/wd0e on /usr type ffs (local, noatime, nodev, softdep)
    /dev/wd0h on /var type ffs (local, nodev, nosuid)
    /dev/wd0g on /var/qmail type ffs (local, nodev)
    /dev/wd0j on /data type ffs (local, nodev, nosuid)
Boot messages from the installation CD
Code:
Boot from ATAPI CD-ROM :
 1. No Emulation System Type-(00)
CD-ROM: 9F
Loading /4.1/i386/CDBOOT
probing: pc0 com0 com1 apm mem[640K 127M a20=on]
disk: fd0 hd0+* cd0
>> OpenBSD/i386 CDBOOT 2.01
boot>
booting cd0a:/4.1/i386/bsd.rd: 4695092+743480/[52+173024+158611]=0x580d88
entry point at 0x200120
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2007 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 4.1-current (RAMDISK_CD) #400: Wed Jun 20 09:50:50 MDT 2007
    deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/RAMDISK_CD
cpu0: Intel Pentium II ("GenuineIntel" 686-class, 512KB L2 cache) 268 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,MMX
real mem  = 133791744 (127MB)
avail mem = 123408384 (117MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 10/26/99, BIOS32 rev. 0 @ 0xf04d0
apm0 at bios0: Power Management spec V1.2
apm0: flags 30102 dobusy 0 doidle 1
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xd52
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf0cc0/144 (7 entries)
pcibios0: PCI Interrupt Router at 000:04:0 ("Intel 82371FB ISA" rev 0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0x8000 0xc8000/0x800
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82443LX AGP" rev 0x03
ppb0 at pci0 dev 1 function 0 "Intel 82443LX AGP" rev 0x03
pci1 at ppb0 bus 1
pcib0 at pci0 dev 4 function 0 "Intel 82371AB PIIX4 ISA" rev 0x01
pciide0 at pci0 dev 4 function 1 "Intel 82371AB IDE" rev 0x01: DMA, channel 0 wired to
 compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <WDC AC28400R>
wd0: 16-sector PIO, LBA, 8063MB, 16514064 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <E-IDE, CD-ROM 32X/AKU, U10I> SCSI0 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
uhci0 at pci0 dev 4 function 2 "Intel 82371AB USB" rev 0x01: irq 10
"Intel 82371AB Power" rev 0x01 at pci0 dev 4 function 3 not configured
vga1 at pci0 dev 10 function 0 "S3 ViRGE DX/GX" rev 0x01
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
fxp0 at pci0 dev 13 function 0 "Intel 8255x" rev 0x05, i82558: irq 10, address
  00:08:c7:25:dc:22
inphy0 at fxp0 phy 1: i82555 10/100 PHY, rev. 0
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom0: console
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
usb0 at uhci0: USB revision 1.0
uhub0 at usb0: Intel UHCI root hub, rev 1.00/1.00, addr 1
biomask ffe5 netmask ffe5 ttymask ffe7
rd0: fixed, 3800 blocks
umass0 at uhub0 port 1 configuration 1 interface 0
umass0: vendor 0x05e3 USB Storage, rev 2.00/93.21, addr 2
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets
sd0 at scsibus1 targ 1 lun 0: <Generic, STORAGE DEVICE, 9321> SCSI0 0/direct removable
sd0: drive offline
sd1 at scsibus1 targ 1 lun 1: <Generic, STORAGE DEVICE, 9321> SCSI0 0/direct removable
sd1: drive offline
sd2 at scsibus1 targ 1 lun 2: <Generic, STORAGE DEVICE, 9321> SCSI0 0/direct removable
sd2: 485MB, 61 cyl, 255 head, 63 sec, 512 bytes/sec, 994304 sec total
sd3 at scsibus1 targ 1 lun 3: <Generic, STORAGE DEVICE, 9321> SCSI0 0/direct removable
sd3: drive offline
dkcsum: wd0 matches BIOS drive 0x80
root on rd0a swap on rd0b dump on rd0b
The USB card reader with 4 slots has been recognized. The 500 MB Secure Digital card containing the installation files has been detected as drive 'sd2'.

Confirm start of install
Code:
erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell? i
We want an install so we press an i.
Code:
Welcome to the OpenBSD/i386 4.1 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 and keyboard mapping
Code:
Terminal type? [vt220] Enter
kbd(8) mapping? ('L' for list) [none] Enter
Partitioning the disk at Master Boot Record level
Code:
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] yes
In case you change your mind, you still can stop here.
Code:
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 sd0 sd1 sd2 sd3.
'wd0' is the hard disk we want to install on, 'sd0', 'sd1', 'sd2' and 'sd3' are the four slots in the USB card reader. Be aware that both SCSI disks and USB devices use the same 'sd' naming convention.
Code:
Which one is the root disk? (or 'done') [done] wd0
Do you want to use *all* of wd0 for OpenBSD? [no] Enter

You will now create a single MBR partition to contain your OpenBSD data. This
partition must have an id of 'A6'; must *NOT* overlap other partitions; and
must be marked as the only active partition.

The 'manual' command describes all the fdisk commands in detail.

Disk: wd0	geometry: 1027/255/63 [16514064 Sectors]
Offset: 0	Signature: 0xAA55
	  Starting	   Ending	 LBA Info:
 #: id	    C	H  S -	    C	H  S [	     start:	   size ]
------------------------------------------------------------------------
*0: 0C	    0	1  1 -	 1026 254 63 [		63:    16498692 ] Win95 FAT32L
 1: 00	    0	0  0 -	    0	0  0 [		 0:	      0 ] unused
 2: 00	    0	0  0 -	    0	0  0 [		 0:	      0 ] unused
 3: 00	    0	0  0 -	    0	0  0 [		 0:	      0 ] unused
Enter 'help' for information
fdisk: 1> help
	help		Command help list
	manual		Show entire OpenBSD man page for fdisk
	reinit		Re-initialize loaded MBR (to defaults)
	setpid		Set the identifier of a given table entry
	disk		Edit current drive stats
	edit		Edit given table entry
	flag		Flag given table entry as bootable
	update		Update machine code in loaded MBR
	select		Select extended partition table entry MBR
	swap		Swap two partition entries
	print		Print loaded MBR partition table
	write		Write loaded MBR to disk
	exit		Exit edit of current MBR, without saving changes
	quit		Quit edit of current MBR, saving current changes
	abort		Abort program without saving current changes
We see the a Windows FAT32 partition. Because we want the use the complete disk we simply use the reinit and write commands.
Code:
fdisk: 1> reinit
In memory copy is initialized to:
Offset: 0	Signature: 0xAA55
	  Starting	   Ending	 LBA Info:
 #: id	    C	H  S -	    C	H  S [	     start:	   size ]
------------------------------------------------------------------------
 0: 00	    0	0  0 -	    0	0  0 [		 0:	      0 ] unused
 1: 00	    0	0  0 -	    0	0  0 [		 0:	      0 ] unused
 2: 00	    0	0  0 -	    0	0  0 [		 0:	      0 ] unused
*3: A6	    0	1  1 -	 1026 254 63 [		63:    16498692 ] OpenBSD
Use 'write' to update disk.
fdisk:*1> write
Writing MBR at offset 0.
The OpenBSD MBR partition information has been written to the last slot of the MBR partition table. Most operating systems would have used the first slot. For some reason OpenBSD (as well as DR-DOS for example) has preference for the last MBR slot.
Code:
fdisk: 1> quit
Here is the partition information you chose:

Disk: wd0	geometry: 1027/255/63 [16514064 Sectors]
Offset: 0	Signature: 0xAA55
	  Starting	   Ending	 LBA Info:
 #: id	    C	H  S -	    C	H  S [	     start:	   size ]
------------------------------------------------------------------------
 0: 00	    0	0  0 -	    0	0  0 [		 0:	      0 ] unused
 1: 00	    0	0  0 -	    0	0  0 [		 0:	      0 ] unused
 2: 00	    0	0  0 -	    0	0  0 [		 0:	      0 ] unused
*3: A6	    0	1  1 -	 1026 254 63 [		63:    16498692 ] OpenBSD
We use the quit command to finish the partitioning of the MBR.

Sub-partition OpenBSD MBR partition with 'disklabel'
Code:
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 16498692

Treating sectors 63-16498755 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)
> ?
Available commands:
        ? [cmnd]  - this message or command specific help.
        a [part]  - add new partition.
        b         - set OpenBSD disk boundaries.
        c [part]  - change partition size.
        D         - set label to default.
        d [part]  - delete partition.
        e         - edit drive parameters.
        g [d|u]   - use [d]isk or [u]ser geometry.
        M         - show entire OpenBSD man page for disklabel.
        m [part]  - modify existing partition.
        n [part]  - set the mount point for a partition.
        p [unit]  - print label.
        q         - quit and save changes.
        r         - recalculate free space.
        s [path]  - save label to file.
        u         - undo last change.
        w         - write label to disk.
        X         - toggle expert mode.
        x         - exit without saving changes.
        z         - zero out partition table.
Numeric parameters may use suffixes to indicate units:
        'b' for bytes, 'c' for cylinders, 'k' for kilobytes, 'm' for megabytes,
        'g' for gigabytes or no suffix for sectors (usually 512 bytes).
        '%' for percent of total disk size, '&' for percent of free space.
        Non-sector units will be rounded to the nearest cylinder.
Entering '?' at most prompts will give you (simple) context sensitive help.
A listing of the available commands.
Code:
> p
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: WDC AC28400R
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 1027
total sectors: 16514064
free sectors: 16498692
rpm: 3600

16 partitions:
#	      size	  offset  fstype [fsize bsize  cpg]
  c:	  16514064	       0  unused      0	    0
The MBR partition can be divided in several filesystems, For easy reference each of these divisions will be assigned a character from the alphabet as a label. OpenBSD allows 'a' - 'p', but with the following restrictions:
  • 'a' has been reserved for the root partition '/',
  • 'b' is reserved for swap.
  • 'c' is a symbolic partition describing the complete OpenBSD MBR partition, which we are not allowed to touch.
Code:
> a b
offset: [63] Enter
size: [16498692] 32m
Rounding to cylinder: 80262
FS type: [swap] Enter
We use the a command to add a swap partition 'b' of 32 megabyte, which is rounded by 'disklabel' to a cylinder boundary.
Code:
Assigned  :      80262 x 512 = 41,094,144 bytes
We wanted : 32 x 1024 x 1024 = 33,554,432 bytes
-----------------------------------------------
                  Difference :  7,539,712 bytes
This calculation (not part of the install) shows that the rounding to a cylinder gives us 7 MB more than we asked for.
Code:
> p
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: WDC AC28400R
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 1027
total sectors: 16514064
free sectors: 16418430
rpm: 3600

16 partitions:
#	      size	  offset  fstype [fsize bsize  cpg]
  b:	     80262	      63    swap
  c:	  16514064	       0  unused      0	    0
To check we use the p command and we see that 'disklabel' has deducted the 80,262 sectors from the total available amount of 16,514,064.
Code:
> a a
offset: [80325] Enter
size: [16418430] Enter
FS type: [4.2BSD] Enter
mount point: [none] /
With the a command we assign the remaining sectors to partition 'a'. Because we will create one single partition for the programs and data, we just confirm the suggestions of 'disklabel' by pressing Enter. To the mount point question we answer with '/'.
Code:
> p
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: WDC AC28400R
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 1027
total sectors: 16514064
free sectors: 0
rpm: 3600

16 partitions:
#	      size	  offset  fstype [fsize bsize  cpg]
  a:	  16418430	   80325  4.2BSD   2048 16384	16 # /
  b:	     80262	      63    swap
  c:	  16514064	       0  unused      0	    0
Normally at this point we would be ready.

But for didactic reasons and because some prefer to have the swap partition at the end of the disk, we will delete the two partitions. and rearrange them. The 16,418,430 size of the 'a' label, as calculated by 'disklabel' will be reused.
Code:
> d a
> d b
> p
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: WDC AC28400R
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 1027
total sectors: 16514064
free sectors: 16498692
rpm: 3600

16 partitions:
#	      size	  offset  fstype [fsize bsize  cpg]
  c:	  16514064	       0  unused      0	    0
The command to delete is d.
Code:
> a a
offset: [63] Enter
size: [16498692] 16418430
FS type: [4.2BSD] Enter
mount point: [none] /
Using the 16,418,430 sectors 'disklabel' has calculated, we add 'a' as first partition.
Code:
> a b
offset: [16418493] Enter
size: [80262] Enter
FS type: [swap] Enter
> p
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: WDC AC28400R
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 1027
total sectors: 16514064
free sectors: 0
rpm: 3600

16 partitions:
#	      size	  offset  fstype [fsize bsize  cpg]
  a:	  16418430	      63  4.2BSD   2048 16384	16 # /
  b:	     80262	16418493    swap
  c:	  16514064	       0  unused      0	    0
> quit
Write new label?: [y] Enter
Available disks are: sd0 sd1 sd2 sd3.
Which one do you wish to initialize? (or 'done') [done] Enter
Add the swap partition. With quit and Enter to confirm the write. we finalize the 'disklabel' layout of the OpenBSD Master Boot Record partition.
Code:
OpenBSD filesystems:
wd0a /

The next step *DESTROYS* all existing data on these partitions!
Are you really sure that you're ready to proceed? [no] yes
/dev/rwd0a: 8016.8MB in 16418428 sectors of 512 bytes
40 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
/dev/wd0a on /mnt type ffs (rw, asynchronous, local, ctime=Fri Jun 22 03:14:33 2007)
After confirming again, the disk has been initialized with a freshly created filesystem for the '/' partition.

TCP/IP network configuration
Code:
System hostname? (short form, e.g. 'foo') protogoras
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? [protogoras] Enter
The media options for fxp0 are currently
	media: Ethernet autoselect (100baseTX full-duplex)
Do you want to change the media options? [no] Enter
IPv4 address for fxp0? (or 'none' or 'dhcp') 192.168.222.18
Netmask? [255.255.255.0]
IPv6 address for fxp0? (or 'rtsol' or 'none') [none] Enter
No more interfaces to initialize.
DNS domain name? (e.g. 'bar.com') [my.domain] utp.xnet
DNS nameserver? (IP address or 'none') [none] 192.168.222.10
Use the nameserver now? [yes] no
Default IPv4 route? (IPv4 address, 'dhcp' or 'none') 192.168.222.10
add net default: gateway 192.168.222.10
Edit hosts with ed? [no] Enter
Do you want to do any manual network configuration? [no] Enter
Settings only valid for my home network.

Password for root
Code:
Password for root account? (will not echo)
Password for root account? (again)
The installer does not provide opportunity to create an user account. You are only asked for the password for the root account.

Select SD card in USB card reader
Code:
Let's install the sets!
Location of sets? (cd disk ftp http or 'done') [cd] disk
Is the disk partition already mounted? [no] Enter
Available disks are: wd0 sd0 sd1 sd2 sd3.
Which one contains the install media? (or 'done') [wd0] sd2
Pathname to the sets? (or 'done') [4.1/i386] obsd
INSTALL.i386 not found. Use sets found here anyway? [no] yes
We select 'sd2', the SD card in the USB card reader and the directory 'obsd' containing the installation file sets.

Choose file sets
Code:
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] base41.tgz
	[X] etc41.tgz
	[X] misc41.tgz
	[X] comp41.tgz
	[X] man41.tgz
	[ ] xbase41.tgz
	[ ] xetc41.tgz
	[ ] xshare41.tgz
	[ ] xfont41.tgz
	[ ] xserv41.tgz
Set name? (or 'done') [bsd.mp] x*

	[X] bsd
	[X] bsd.rd
	[ ] bsd.mp
	[X] base41.tgz
	[X] etc41.tgz
	[X] misc41.tgz
	[X] comp41.tgz
	[X] man41.tgz
	[X] xbase41.tgz
	[X] xetc41.tgz
	[X] xshare41.tgz
	[X] xfont41.tgz
	[X] xserv41.tgz
Set name? (or 'done') [bsd.mp] done
The installer has found the sets on the SD card. We add the file sets for the X Window system.

Copying install sets from SD card
Code:
Ready to install sets? [yes] Enter
Getting bsd ...
100% |**************************************************|  6001 KB    00:12 ETA
Getting bsd.rd ...
100% |**************************************************|  4909 KB    00:09 ETA
Getting base41.tgz ...
100% |**************************************************| 41552 KB    01:30 ETA
Getting etc41.tgz ...
100% |**************************************************|  1211 KB    00:02 ETA
Getting misc41.tgz ...
100% |**************************************************|  2239 KB    00:04 ETA
Getting comp41.tgz ...
100% |**************************************************| 76957 KB    02:39 ETA
Getting man41.tgz ...
100% |**************************************************|  7478 KB    00:15 ETA
Getting xbase41.tgz ...
100% |**************************************************| 11676 KB    00:24 ETA
Getting xetc41.tgz ...
100% |**************************************************| 75554	      00:00 ETA
Getting xshare41.tgz ...
100% |**************************************************|  2487 KB    00:07 ETA
Getting xfont41.tgz ...
100% |**************************************************| 34745 KB    01:16 ETA
Getting xserv41.tgz ...
100% |**************************************************| 10106 KB    00:22 ETA
Location of sets? (cd disk ftp http or 'done') [cd] done
Additional opportunity to retrieve additional sets from another source. For example 'games41.tgz' or 'site41.tgz'. But we are done.

Miscellaneous configuration
Code:
Start sshd(8) by default? [yes] Enter
NTP server? (or 'none' or 'default') [none] 192.168.222.10
Do you expect to run the X Window System? [no] yes
Change the default console to com0? [no] Enter
Saving configuration files...done.
Generating initial host.random file...done.
Setting timezone
Code:
What timezone are you in? ('?' for list) [Canada/Mountain] ?
Africa/	     Chile/	  GB-Eire      Israel	    NZ-CHAT	 UCT
America/     Cuba	  GMT	       Jamaica	    Navajo	 US/
Antarctica/  EET	  GMT+0	       Japan	    PRC		 UTC
Arctic/	     EST	  GMT-0	       Kwajalein    PST8PDT	 Universal
Asia/	     EST5EDT	  GMT0	       Libya	    Pacific/	 W-SU
Atlantic/    Egypt	  Greenwich    MET	    Poland	 WET
Australia/   Eire	  HST	       MST	    Portugal	 Zulu
Brazil/	     Etc/	  Hongkong     MST7MDT	    ROC		 posix/
CET	     Europe/	  Iceland      Mexico/	    ROK		 posixrules
CST6CDT	     Factory	  Indian/      Mideast/	    Singapore	 right/
Canada/	     GB		  Iran	       NZ	    Turkey	 zone.tab
What timezone are you in? ('?' for list) [Canada/Mountain] Europe
What sub-timezone of 'Europe' are you in? ('?' for list) ?
Amsterdam    Chisinau	  Kiev	       Moscow	    Sarajevo	 Vatican
Andorra	     Copenhagen	  Lisbon       Nicosia	    Simferopol	 Vienna
Athens	     Dublin	  Ljubljana    Oslo	    Skopje	 Vilnius
Belfast	     Gibraltar	  London       Paris	    Sofia	 Volgograd
Belgrade     Guernsey	  Luxembourg   Podgorica    Stockholm	 Warsaw
Berlin	     Helsinki	  Madrid       Prague	    Tallinn	 Zagreb
Bratislava   Isle_of_Man  Malta	       Riga	    Tirane	 Zaporozhye
Brussels     Istanbul	  Mariehamn    Rome	    Tiraspol	 Zurich
Bucharest    Jersey	  Minsk	       Samara	    Uzhgorod
Budapest     Kaliningrad  Monaco       San_Marino   Vaduz
What sub-timezone of 'Europe' are you in? ('?' for list) Amsterdam
Setting local timezone to 'Europe/Amsterdam'...done.
We also could have entered 'Europe/Amsterdam' at the first prompt.

Device nodes, boot block, 'halt' and reboot
Code:
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 144, offset 808
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.
# halt
syncing disks... done

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

rebooting
Remove the CD from the drive, type halt and press a key to reboot

$Id: cardreader.xml,v 1.5 2007/06/27 01:41:25 j65nko Exp $
$Id: vbul-html.xsl,v 1.6 2007/06/27 04:49:57 j65nko Exp $
Reply With Quote
  #3   (View Single Post)  
Old 31st July 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default III. USB-mediazine® OpenBSD reinstall using 'bsd.rd' and USB memory stick

III. USB-mediazine® OpenBSD reinstall using 'bsd.rd' and USB memory stick
  • Introduction
  • Select 'bsd.rd' for booting
  • Boot messages of the bsd ramdisk kernel
  • Confirm the start of the install
  • Select terminal type and keyboard mapping
  • Partition the disk at MBR level
  • Sub-partition OpenBSD MBR partition with 'disklabel'
  • Network Configuration
  • root password
  • Select USB flash drive device and directory
  • Choose file sets
  • Copying install sets from USB flash drive
  • Miscellaneous configuration
  • Setting timezone
  • Boot block, halt and reboot
Introduction

The following is a transcript of an install of a recent OpenBSD snapshot on a PC running OpenBSD 3.6. This reinstall is done using a 'bsd.rd' install kernel as described in http://www.openbsd.org/faq/faq4.html#bsd.rd and with the installation file sets on an USB flash memory drive.

We will use the following procedure to copy the 'bsd.rd' install kernel from the USB stick containing the file sets, to the '/' directory of the OpenBSD 3.6 PC.

After insertion of the USB flash drive, we check 'dmesg' output.
Code:
umass0 at uhub0 port 2 configuration 1 interface 0
umass0: Sony Storage Media, rev 2.00/1.00, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets
sd0 at scsibus0 targ 1 lun 0: <Sony, Storage Media, 0100> SCSI0 0/direct removable
sd0: 1920MB, 1920 cyl, 64 head, 32 sec, 512 bytes/sec, 3932160 sec total
The USB stick has been detected as 'sd0'. Read the partition table with fdisk
Code:
$ su - root
Password:
Terminal type? [xterm]

# fdisk sd0
fdisk: sysctl(machdep.bios.diskinfo): Device not configured
Disk: sd0       geometry: 1920/64/32 [3932160 Sectors]
Offset: 0       Signature: 0xAA55
         Starting       Ending       LBA Info:
 #: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
*0: 06    0   1  1 - 1919  63 32 [          32:     3932128 ] DOS > 32MB
 1: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
 2: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
 3: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
Check the disklabel output
Code:
# disklabel sd0
disklabel: warning, DOS partition table with no valid OpenBSD partition
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: Storage Media
flags:
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 1920
total sectors: 3932160
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#             size        offset  fstype [fsize bsize  cpg]
  c:       3932160             0  unused      0     0      # Cyl     0 -  1919
  i:       3932128            32   MSDOS                   # Cyl     0*-  1919
OpenBSD has created a virtual label 'i:' for the MSDOS FAT partition on the USB stick. We know now we will have to mount as 'sd0i'.

Mount the USB stick read-only.
Code:
# mount -o ro  /dev/sd0i /mnt
#  mount
/dev/wd0a on / type ffs (local)
/dev/sd0i on /mnt type msdos (local, read-only)
Copy the installation kernel 'bsd.rd' from USB stick to the root directory.
Code:
# ls -l /mnt/snap
total 414272
-rwxr-xr-x  1 snap  snap      1019 May 31 06:37 MD5
-rwxr-xr-x  1 snap  snap  42640349 May 31 06:40 base41.tgz
-rwxr-xr-x  1 snap  snap   6113799 May 31 06:39 bsd
-rwxr-xr-x  1 snap  snap   6163453 May 31 06:39 bsd.mp
-rwxr-xr-x  1 snap  snap   5017801 May 31 06:39 bsd.rd
-rwxr-xr-x  1 snap  snap  78795861 May 31 06:39 comp41.tgz
-rwxr-xr-x  1 snap  snap   1240407 May 31 06:38 etc41.tgz
-rwxr-xr-x  1 snap  snap   1474560 May 31 06:38 floppy41.fs
-rwxr-xr-x  1 snap  snap   7665620 May 31 06:38 man41.tgz
-rwxr-xr-x  1 snap  snap   2292830 May 31 06:38 misc41.tgz
-rwxr-xr-x  1 snap  snap  11956881 May 31 06:37 xbase41.tgz
-rwxr-xr-x  1 snap  snap     75570 May 31 06:37 xetc41.tgz
-rwxr-xr-x  1 snap  snap  35582512 May 31 06:37 xfont41.tgz
-rwxr-xr-x  1 snap  snap  10347873 May 31 06:37 xserv41.tgz
-rwxr-xr-x  1 snap  snap   2547392 May 31 06:40 xshare41.tgz

# cp /mnt/snap/bsd.rd /

# ls -l /
total 20620
-rw-r--r--   2 root  wheel      770 Sep 17  2004 .cshrc
-rw-r--r--   2 root  wheel      314 Feb  1  2005 .profile
drwxr-xr-x   2 root  wheel      512 Sep 17  2004 altroot
drwxr-xr-x   2 root  wheel     1024 Sep 17  2004 bin
-rw-r--r--   1 root  wheel    42644 Nov  9  2004 boot
-rw-r--r--   1 root  wheel  5358583 Oct 19  2004 bsd
-rw-r--r--   1 root  wheel  5017801 May 31 07:02 bsd.rd
drwxr-xr-x   3 root  wheel    20480 May 31 07:17 dev
drwxr-xr-x  17 root  wheel     2048 May 31 07:52 etc
drwxr-xr-x   3 root  wheel      512 Jan 10  2005 home
drwxr-xr-x   1 root  wheel    16384 Jan  1  1980 mnt
drwx------   3 root  wheel      512 May 31 07:52 root
drwxr-xr-x   2 root  wheel     2048 Sep 17  2004 sbin
drwxr-xr-x   2 root  wheel      512 Sep 17  2004 stand
lrwxr-xr-x   1 root  wheel       11 Nov  9  2004 sys -> usr/src/sys
drwxrwxrwt   2 root  wheel      512 May 31 08:16 tmp
drwxr-xr-x  15 root  wheel      512 Sep 17  2004 usr
drwxr-xr-x  22 root  wheel      512 Sep 17  2004 var
We now can reboot the system to start the install.
Code:
# shutdown -r now
Shutdown NOW!
shutdown: [pid 9216]
#
*** FINAL System shutdown message from j65nko@heraclitus.utp.xnet ***
System going down IMMEDIATELY

System shutdown time has arrived
Select 'bsd.rd' for booting
Code:
>> OpenBSD/i386 BOOT 2.06
boot>   /bsd.rd
booting hd0a:/bsd.rd: 4687092+742840 [52+172256+157781]=0x57e58c
entry point at 0x200120
We intervene at the boot> prompt and type '/bsd.rd'. This causes the installation kernel '/bsd.rd' to be started and not the standard '/bsd' kernel. You have 5 seconds to do this.

The safest option is to press the space bar a few times while the system boots. The BIOS will buffer these spaces and those are enough to tell the Second Stage Boot Loader to wait for user input and not to automatically load the default '/bsd' kernel as it is accustomed to. See boot (8) for the details.

Boot messages of the bsd ramdisk kernel
Code:
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2007 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 4.1-current (RAMDISK_CD) #353: Wed May 30 03:23:45 MDT 2007
    deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/RAMDISK_CD
cpu0: Intel Pentium II ("GenuineIntel" 686-class, 512KB L2 cache) 351 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR
real mem  = 133787648 (127MB)
avail mem = 122945536 (117MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 07/21/98, BIOS32 rev. 0 @ 0xfb280
apm0 at bios0: Power Management spec V1.2
apm0: flags 70102 dobusy 1 doidle 1
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xb6f8
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdd10/144 (7 entries)
pcibios0: PCI Exclusive IRQs: 10 11
pcibios0: PCI Interrupt Router at 000:07:0 ("Intel 82371SB ISA" rev 0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0x8000
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82443BX AGP" rev 0x02
ppb0 at pci0 dev 1 function 0 "Intel 82443BX AGP" rev 0x02
pci1 at ppb0 bus 1
pcib0 at pci0 dev 7 function 0 "Intel 82371AB PIIX4 ISA" rev 0x02
pciide0 at pci0 dev 7 function 1 "Intel 82371AB IDE" rev 0x01: DMA, channel 0 wired to
 compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <ST32122A>
wd0: 16-sector PIO, LBA, 2014MB, 4124736 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 disabled (no drives)
uhci0 at pci0 dev 7 function 2 "Intel 82371AB USB" rev 0x01: irq 11
"Intel 82371AB Power" rev 0x02 at pci0 dev 7 function 3 not configured
vga1 at pci0 dev 10 function 0 "S3 ViRGE DX/GX" rev 0x01
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
xl0 at pci0 dev 12 function 0 "3Com 3c905B 100Base-TX" rev 0x64: irq 11, address 00:50:04:50:5b:d1
bmtphy0 at xl0 phy 24: Broadcom 3C905B internal PHY, rev. 0
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom0: console
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
biomask ffe5 netmask ffe5 ttymask ffe7
rd0: fixed, 3800 blocks
umass0 at uhub0 port 2 configuration 1 interface 0
umass0: Sony Storage Media, rev 2.00/1.00, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets
sd0 at scsibus0 targ 1 lun 0: <Sony, Storage Media, 0100> SCSI0 0/direct removable
sd0: 1920MB, 244 cyl, 255 head, 63 sec, 512 bytes/sec, 3932160 sec total
dkcsum: wd0 matches BIOS drive 0x80
Note that the Sony USB flash drive has been detected.

Confirm the start of the install
Code:
root on rd0a swap on rd0b dump on rd0b
erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell? i
We want an install so we press 'i'.
Code:
Welcome to the OpenBSD/i386 4.1 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.
Select terminal type and keyboard mapping
Code:
Terminal type? [vt220] Enter
kbd(8) mapping? ('L' for list) [none] Enter
Partition the disk at MBR level
Code:
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] yes
We get a change to back out here. Of course we continue.
Code:
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 sd0.
'wd0' is the hard disk we want to install on, 'sd0' is our USB flash drive with the installation file sets. Be aware that USB and SCSI disks use the same 'sd?' naming convention.
Code:
Which one is the root disk? (or 'done') [done] wd0
Do you want to use *all* of wd0 for OpenBSD? [no] yes
Putting all of wd0 into an active OpenBSD MBR partition (type 'A6')...done.
Because in our case, OpenBSD will be the only OS we just leave everything to the installation program.

Sub-partition OpenBSD MBR partition with 'disklabel'
Code:
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 4124673

Treating sectors 63-4124736 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: ST32122A
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 4092
total sectors: 4124736
free sectors: 0
rpm: 3600

16 partitions:
#	      size	  offset  fstype [fsize bsize  cpg]
  a:	   3999681	      63  4.2BSD   2048 16384  328
  b:	    124992	 3999744    swap
  c:	   4124736	       0  unused      0	    0
> help
Available commands:
	? [cmnd]  - this message or command specific help.
	a [part]  - add new partition.
	b	  - set OpenBSD disk boundaries.
	c [part]  - change partition size.
	D	  - set label to default.
	d [part]  - delete partition.
	e	  - edit drive parameters.
	g [d|u]	  - use [d]isk or [u]ser geometry.
	M	  - show entire OpenBSD man page for disklabel.
	m [part]  - modify existing partition.
	n [part]  - set the mount point for a partition.
	p [unit]  - print label.
	q	  - quit and save changes.
	r	  - recalculate free space.
	s [path]  - save label to file.
	u	  - undo last change.
	w	  - write label to disk.
	X	  - toggle expert mode.
	x	  - exit without saving changes.
	z	  - zero out partition table.
Numeric parameters may use suffixes to indicate units:
	'b' for bytes, 'c' for cylinders, 'k' for kilobytes, 'm' for megabytes,
	'g' for gigabytes or no suffix for sectors (usually 512 bytes).
	'%' for percent of total disk size, '&' for percent of free space.
	Non-sector units will be rounded to the nearest cylinder.
Entering '?' at most prompts will give you (simple) context sensitive help.
> q
No label changes.
Because we want to keep the existing labelled partitions we just type 'q' to preserve them.
Code:
Available disks are: sd0.
Which one do you wish to initialize? (or 'done') [done] done
We get a chance to work with another disk. 'sd0' is our USB flash drive with our installation files. We don't want that to be touched, so we indicate that we are done.
Code:
OpenBSD filesystems:
wd0a /

The next step *DESTROYS* all existing data on these partitions!
Are you really sure that you're ready to proceed? [no] yes
/dev/rwd0a: 1953.0MB in 3999680 sectors of 512 bytes
10 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
/dev/wd0a on /mnt type ffs (rw, asynchronous, local, ctime=Thu May 31 06:11:57 2007)
Our disk has been initialized with a new filesystem. We now will do the TCP/IP configuration.

Network Configuration
Code:
System hostname? (short form, e.g. 'foo') diogenes
Configure the network? [yes] Enter
Available interfaces are: xl0.
Which one do you wish to initialize? (or 'done') [xl0] Enter
Symbolic (host) name for xl0? [diogenes] Enter
The media options for xl0 are currently
	media: Ethernet autoselect (100baseTX full-duplex)
Do you want to change the media options? [no] Enter
IPv4 address for xl0? (or 'none' or 'dhcp') 192.168.222.16
Netmask? [255.255.255.0] Enter
IPv6 address for xl0? (or 'rtsol' or 'none') [none] Enter
No more interfaces to initialize.
DNS domain name? (e.g. 'bar.com') [my.domain] utp.xnet
DNS nameserver? (IP address or 'none') [none] 192.168.222.10
Use the nameserver now? [yes] Enter
Default IPv4 route? (IPv4 address, 'dhcp' or 'none') 192.168.222.10
add net default: gateway 192.168.222.10
Edit hosts with ed? [no] Enter
Do you want to do any manual network configuration? [no] Enter
root password
Code:
Password for root account? (will not echo)
Password for root account? (again)
The installer does not provide opportunity to create an user account. You are only asked for the password for the root account.

Select USB flash drive device and directory
Code:
Let's install the sets!
Location of sets? (disk ftp http or 'done') [disk] Enter
Is the disk partition already mounted? [no] Enter
Available disks are: wd0 sd0.
Which one contains the install media? (or 'done') [wd0] sd0
Pathname to the sets? (or 'done') [4.1/i386] snap
INSTALL.i386 not found. Use sets found here anyway? [no] yes
We select the USB flash drive, detected as sd0 and the directory 'snap' containing the file sets.

Choose file sets
Code:
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] base41.tgz
	[X] etc41.tgz
	[X] misc41.tgz
	[X] comp41.tgz
	[X] man41.tgz
	[ ] xbase41.tgz
	[ ] xetc41.tgz
	[ ] xshare41.tgz
	[ ] xfont41.tgz
	[ ] xserv41.tgz
Set name? (or 'done') [bsd.mp] x*

	[X] bsd
	[X] bsd.rd
	[ ] bsd.mp
	[X] base41.tgz
	[X] etc41.tgz
	[X] misc41.tgz
	[X] comp41.tgz
	[X] man41.tgz
	[X] xbase41.tgz
	[X] xetc41.tgz
	[X] xshare41.tgz
	[X] xfont41.tgz
	[X] xserv41.tgz
Set name? (or 'done') [bsd.mp] done
The installer has found the sets on the USB drive. We add the file sets for the X Window system.

Copying install sets from USB flash drive
Code:
Ready to install sets? [yes] Enter
Getting bsd ...
100% |**************************************************|  5970 KB    00:06 ETA
Getting bsd.rd ...
100% |**************************************************|  4900 KB    00:05 ETA
Getting base41.tgz ...
100% |**************************************************| 41640 KB    00:56 ETA
Getting etc41.tgz ...
100% |**************************************************|  1211 KB    00:02 ETA
Getting misc41.tgz ...
100% |**************************************************|  2239 KB    00:02 ETA
Getting comp41.tgz ...
100% |**************************************************| 76949 KB    01:30 ETA
Getting man41.tgz ...
100% |**************************************************|  7485 KB    00:11 ETA
Getting xbase41.tgz ...
100% |**************************************************| 11676 KB    00:14 ETA
Getting xetc41.tgz ...
100% |**************************************************| 75570	      00:00 ETA
Getting xshare41.tgz ...
100% |**************************************************|  2487 KB    00:07 ETA
Getting xfont41.tgz ...
100% |**************************************************| 34748 KB    00:52 ETA
Getting xserv41.tgz ...
100% |**************************************************| 10105 KB    00:14 ETA
Location of sets? (disk ftp http or 'done') [disk] done
Additional opportunity to retrieve sets from another source. 'games41.tgz' or 'site41.tgz' for example. But we are done.

Miscellaneous configuration
Code:
Start sshd(8) by default? [yes] Enter
NTP server? (or 'none' or 'default') [none] 192.168.222.10
Do you expect to run the X Window System? [no] yes
Change the default console to com0? [no] yes
Available speeds are: 9600 19200 38400 57600 115200.
Which one should com0 use? (or 'done') [9600] Enter
Saving configuration files...done.
Generating initial host.random file...done.
Setting timezone
Code:
What timezone are you in? ('?' for list) [Canada/Mountain] ?
Africa/	     Chile/	  GB-Eire      Israel	    NZ-CHAT	 UCT
America/     Cuba	  GMT	       Jamaica	    Navajo	 US/
Antarctica/  EET	  GMT+0	       Japan	    PRC		 UTC
Arctic/	     EST	  GMT-0	       Kwajalein    PST8PDT	 Universal
Asia/	     EST5EDT	  GMT0	       Libya	    Pacific/	 W-SU
Atlantic/    Egypt	  Greenwich    MET	    Poland	 WET
Australia/   Eire	  HST	       MST	    Portugal	 Zulu
Brazil/	     Etc/	  Hongkong     MST7MDT	    ROC		 posix/
CET	     Europe/	  Iceland      Mexico/	    ROK		 posixrules
CST6CDT	     Factory	  Indian/      Mideast/	    Singapore	 right/
Canada/	     GB		  Iran	       NZ	    Turkey	 zone.tab
What timezone are you in? ('?' for list) [Canada/Mountain] Europe

What sub-timezone of 'Europe' are you in? ('?' for list) > ?
Amsterdam    Chisinau	  Kiev	       Moscow	    Sarajevo	 Vatican
Andorra	     Copenhagen	  Lisbon       Nicosia	    Simferopol	 Vienna
Athens	     Dublin	  Ljubljana    Oslo	    Skopje	 Vilnius
Belfast	     Gibraltar	  London       Paris	    Sofia	 Volgograd
Belgrade     Guernsey	  Luxembourg   Podgorica    Stockholm	 Warsaw
Berlin	     Helsinki	  Madrid       Prague	    Tallinn	 Zagreb
Bratislava   Isle_of_Man  Malta	       Riga	    Tirane	 Zaporozhye
Brussels     Istanbul	  Mariehamn    Rome	    Tiraspol	 Zurich
Bucharest    Jersey	  Minsk	       Samara	    Uzhgorod
Budapest     Kaliningrad  Monaco       San_Marino   Vaduz

What sub-timezone of 'Europe' are you in? ('?' for list) Ansterdan
'Europe/Ansterdan' is not a valid timezone on this system.
What timezone are you in? ('?' for list) [Canada/Mountain] Europe/Amsterdam
Setting local timezone to 'Europe/Amsterdam'...done.
I made a typo, so my choice was rejected. You see it is also possible to set the timezone and sub-timezone in one go.

Boot block, halt and reboot
Code:
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 1576
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.
# halt
syncing disks... done

The operating system has halted.
Please press any key to reboot.
Type halt and press a key to reboot

$Id: usb-install.xml,v 1.8 2007/06/26 23:15:09 j65nko Exp $
$Id: vbul-html.xsl,v 1.6 2007/06/27 04:49:57 j65nko Exp $
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #4   (View Single Post)  
Old 31st July 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default Download

Download the 3 parts of the USBmediazine article (in HTML format) as a single .tgz file.

The command to unpack
Code:
$ tar xvzf USBmediazine.tgz
Attached Files
File Type: tgz USBmediazine.tgz (20.4 KB, 78 views)
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced programming in the UNIX environment 2nd edition? graudeejs Book reviews 11 1st December 2008 10:15 AM
How to duplicate an installed Operating Environment dk_netsvil General software and network 0 22nd July 2008 03:01 PM
Can't use bash on chroot'd openssh environment jploh FreeBSD General 2 18th June 2008 02:12 AM


All times are GMT. The time now is 03:34 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick