OpenBSD User Tips

1. Change MAC address

# ifconfig bge3 lladdr 02:01:02:03:04:05

2. Wireless card with Edimax EW-7811Un (Rtl8188CU chips)

if you meet the problem: “fail to loadfirmware”, just type “#man urtwn” and following the instructions in section FILES to grade your firmware use pkg_add

Note: this chip does not work for 802.11n in OBSD so far, so do not try to connect a 802.11n-only wireless access point- you will be disappointed.

3. Dual boot with Ubuntu using GRUB2

Install OpenBSD first, make sure its root partition is within the first 8G. And then install Ubuntu. Once finished, it can only boot Ubuntu. Go into Ubuntu, change files as follows:

a. Edit /etc/default/grub, uncomment the resolution line (to enable console by disabling graphic terminal), and remove the values of GRUB_DEFAULT and GRUB_HIDDEN_TIMEOUT.  # It will bring you GRUB screen when you boot your machine.

b. edit /etc/grub.conf/40_custom (or /etc/grub.d/40_custom) add the following lines: (Grub 2.0

“OpenBSD” {

set root=(hdX, Y)   # here X means disk number, Y is the partition number of OBSD

chainload +1

}

(To know which partition of your OBSD, you can run # fdisk -l /dev/sda in Ubuntu. For example, if it shows /dev/sda4  for OpenBSD, then Y is 4. And X is 0, if you have only one disk which is the current one containing OpenBSD)

c. Then, run the comment # update-grub

Troubleshoot:
1). /usr/lib/os-probes/mounted/90bsd-distro: gawk: not found
# sudo apt-get install gawk

2). unknown linux distribution on /dev/sda14
[Unsolved]

3). The screen shows ‘Video mode not support’ and after seconds, then it entered into the ubuntu login screen. The reason is the resolution line should be uncommented.

GRUB_TERMINAL=console
GRUB_GFXMODE=640x480

4). Run grub-install –recheck /dev/sda to check the grub install correctly or not

5). If somehow you mess up, and you could not reboot the ubuntu anymore. Follow the instruction to recover your grub using a live CD:
a) boot the system using live CD entering ‘try Ubuntu’ (not install mode)
b) sudo fdisk -l # get the partition of ubuntu
c) sudo mount /dev/sdXX /mnt # mount the ubuntu partition
c.1) sudo mount /dev/sdXX /mnt/boot # mount the boot partition if you have a separated one
d) mount the virtual file systems from live CD
sudo mount –bind /dev /mnt/dev
sudo mount –bind /proc /mnt/proc
sudo mount –bind /sys /mnt/sys
sudo mount –bind /usr /mnt/usr # so that you have system utilities when you entering into the mounted system
e) enter into the mounted system
sudo chroot /mnt
f) Now you are in the new mounted system
‘sudo update-grub’ or ‘sudo update-grub2’
g) sudo grub-install /dev/sdX # Note: no partition number
h) sudo grub-install –recheck /dev/sdX # check error
h) unmount all /mnt/dev, /mnt/proc, /mnt/sys, /mnt/usr, /mnt (/mnt/boot) and reboot

(This guide is from http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd-pendrive.html)

4. Install packages

a. donwload ports.tar.gz and extract to /usr/, then find the package you want to install, enter the directory, and run ‘make install’

b. Use pkg_add/pkg_del  (Highly recommended)

Put PKG_PATH into your .profile under your home directory

PKG_PATH=http://ftp.openbsd.org/pub/OpenBSD/5.2/packages/i386/

export PATH PKG_PATH

then, you can run pkg_add -i [package name]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s