Showing posts with label FreeBSD. Show all posts
Showing posts with label FreeBSD. Show all posts

Tuesday, May 26, 2015

5.7 amd64 X200: Creating / Using Easy2Boot installer for OpenBSD

Hi,

OpenBSD 5.7 is out and what am I gonna wait for? Ok now I'm running 5.7-CURRENT using snapshot, newly upgraded from 5.7-RELEASE but more on that later. Right now I want to share another good way to install OpenBSD using USB Drive.

If you read my Creating USB Flashdrive post, you may notice that the previous way will create a flashdrive installer solely for OpenBSD. It's a good option for a small capacity flashdrive, or for a big capacity flashdrives, if you want to store your favourite packages in it. But what if you wanted to make a multi OS installer flashdrive?

Why I wanted to have a multiboot flashdrive? Well, OpenBSD is not perfect. There's something that OpenBSD lack that other OS have. It is wider packages availability. There's a time that I wanted to install something and it's not yet available in OpenBSD. Be it lack of porter's interest and/or lack of resources to port it, there's that time that I need to use the specific application. Heck the only minus point for OpenBSD to me is less packages than GNU/Linux. And then I sometime have that sort of need to test other *BSD OS or GNU/Linux distro. That's why.

After a brief comparison of tools that I need to use, I choose Easy2Boot. I'm not going to write in details about setting up Easy2Boot. You can check their website for instructions. It's fairly easy to setup Easy2Boot as the installer will take care of almost everything IIRC.

What OSes I wanna put in there?
1) OpenBSD (of course!)
2) FreeBSD
3) Ubuntu Linux
4) Maybe UBCD or other tools

Again, I won't write in details about other things than OpenBSD. As Easy2Boot is Linux-friendly, there will be no problem preparing Linux distro for Easy2Boot. As for FreeBSD, you can check out Easy2Boot for FreeBSD section.

For OpenBSD, I tried using install57.iso and the result is:
Booting - booting is ok. Can go through (U)pgrade option but then Easy2Boot cannot mount the ISO file correctly so I cannot install the packages contained in it.

What's the option? I need to use the minimum installation ISO = cd57.iso. Easy2Boot can take care of booting up the minimal ISO and I can run the installation/upgrade process. Take note that I'm using Windows to prepare this.

1)  Download cd57.iso from OpenBSD FTP site.
2) Rename the cd57.iso into some filename that easy to figure out. eg: OpenBSD57-AMD64.iso. Easy2Boot is very picky about "." (dot). Make sure to only have 1 dot only.
3) Move the ISO into the prepared Easy2Boot flashdrive:
/_ISO/MAINMENU/
4) Run the /MAKE_THIS_DRIVE_CONTIGUOUS.cmd inside the root folder of the flashdrive.

Ok the booting part is done. As the ISO is just a minimal boot, I need to get the base packages ready.

1) Go to the root flashdrive. eg: /
2) Create 5.7/amd64/ folder.
3) FTP into OpenBSD FTP site to download the base packages. For -RELEASE, it's ftp.openbsd.org/pub/OpenBSD/5.7/amd64/ .
4) Download all the bsd* , *tgz and optionally-but-recommended SHA256* files into the /5.7/amd64/ inside the flashdrive.

Done. Now, this method is more like the usual installation method, right? And who said that OpenBSD is hard?

For installation:
1) After Easy2Boot is booted, choose your OpenBSD ISO to boot OpenBSD image and do (U)pgrade.
2) When the installer ask for the packages, choose disk, then choose not mounted, and then choose sd1i (depending on your system).
3) Point your installer to the directory 5.7/amd64 inside the mounted sd1i.
4) If you created the folder correctly and put the files in there, the installer should list all the files needed to do the installation/upgrade.
5) Install/Upgrade!

Let the installation continues and reboot. After reboot, do sysmerge, the usual stuff. Starting from 5.7, the etcXX.tgz and xetcXX.tgz is now in base. So the sysmerge command is much simpler now.

# sysmerge

That's it. I've tried installing both OpenBSD and Ubuntu Linux using Easy2Boot and so far it's great. I haven't tried FreeBSD though. I hope you will find this useful. Later then.

Thursday, December 01, 2011

5.0 amd64 K43U: Davmail crash with java dumping core, FreeBSD's package might be the saviour.

Hey,

As some of you know, I'm using OpenBSD primarily for work and I use my company's email address which uses MS OWA. So I use davmail so Thunderbird can retrieve my emails properly. You can search my blog for davmail settings.

I downloaded davmail-3.9.6 and I noticed that less than an 1, davmail will crash and there's java.core dumping. I have a hint that this might be due to 64 version of davmail is not available for OpenBSD and there's only linux's version which has 64-bit.

As this issue is critical, I need to make sure I resolve this as soon as possible. Downloading linux's 64-bit version is out of the question because I don't want any more mess. So I thought of doing an experiment.

I noticed that FreeBSD have amd64 version of davmail in their package system. FreeBSD, which used to be i386 system only have broaden their supported architecture by releasing amd64 version of their OS a few years back. Good news indeed.

I found davmail-3.8.4 package (*.tgz) for FreeBSD 8.2 which is ok as long as it will work. I do some comparison and found that this is what's needed for davmail to work. No installation needed.

lib/
davmail.sh
davmail.jar


There's some files inside the lib folder and only 1-2 files has changed since 3.8.4 to 3.9.6. So I extracted the *.tgz and copied that files into ~/davmail/. Using my previous davmail configuration, I'm now using the amd64 version of davmail meant for FreeBSD.

I'm just using it today, starting in just 1 hour and so far it seems to be working fine. It davmail can survive working hours today then it's great. For the package, you can download from FreeBSD or I can provide mine if needed.

Update!: Just as I published this post, the davmail crashed again. Here's the header of the error message:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 4361696 bytes for Chunk::new. Out of swap space?
#
# Internal Error (allocation.cpp:272), pid=11064, tid=8626964480
# Error: Chunk::new
#
# JRE version: 7.0
# Java VM: OpenJDK 64-Bit Server VM (20.0-b03 mixed mode bsd-amd64 compressed oops)
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#


Maybe it's java's issue. Hmm. I'll need to search for answers. Maybe install another version of jre or jdk. Anyone else have this issue?

Update 02/12/11 09:40:
I found that there's already a few 5.0 users which posted question regarding this java.lang.OutOfMemoryError issue and it affected different java based program like eclipse and netbeans.

Rewinding a bit, DavMail is run using davmail.sh script which resides in DavMail folder. Normally by default, the script contains:

# davmail.sh Ahmad Zulkarnain 2011
BASE=`dirname $0`
for i in $BASE/lib/*; do export CLASSPATH=$CLASSPATH:$i; done
java -cp $BASE/davmail.jar:$CLASSPATH davmail.DavGateway $1


The last line tells the script to run DavMail. I tried to change the command to:

java -Xms512m -Xmx512m -cp $BASE/davmail.jar:$CLASSPATH davmail.DavGateway $1

Note the bold text are the changes I made. But then I have this error:

/home/karl/davmail/davmail.sh /home/karl/davmail/davmail.conf
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


I even tried using only -Xms512m or -Xmx512m with the same error. So then after reading the java man page, I experiment with adding -d64 to force DavMail to run in 64-bit environment. So now the last line of davmail.sh looks like this:

java -d64 -cp $BASE/davmail.jar:$CLASSPATH davmail.DavGateway $1

Now I tested that one invoking sh ~/davmail/davmail.sh ~/davmail/davmail.conf without making it a background process so I can see the output in xterm. I tested that since my last post on the java.lang.OutOfMemoryError until the end of my working hour and there's no crash. *Maybe* DavMail is not stressed enough by then because mails are less in the evening. So today I'm testing the altered davmail.sh to see if it can survive until the end of my working hours. I will keep you guys posted on that.

Thanks to Daniel M for your comment, sorry I have to answer your question in here instead of the comment box but I'm still interested to know any java tips from you.

Update 02/12/11 11:49:
Ok it crashed again. Still have the java.lang.OutOfMemoryError and java.core dump. But at least it's not as fast as yesterday. I managed to get more than an hour of emailing done. So I need to search for more answers. Later.

Monday, July 28, 2008

FreeBSD: Finally! I made a working FreeBSD 7 amd64 DVD! Here's how!

HAHAHA! Finally I got it! I made it woohoo! Ok I've successfully made a working FreeBSD 7.0 AMD64 DVD! But (there's a but..) not just using Nero, I used mkisofs to make an iso image, then burn it with Nero. Here's the important steps.

Step #1: Get the FreeBSD iso.
Fer this I downloaded all 4 isos. I downloaded all AMD64 version. You can get the isos here. Remember to get it from FreeBSD's mirror sites to ease off the load on FreeBSD's main ftp site. I downloaded:
7.0-RELEASE-amd64-disc1.iso
7.0-RELEASE-amd64-disc2.iso
7.0-RELEASE-amd64-disc3.iso
7.0-RELEASE-amd64-docs.iso


After I'm done downloading, I created a folder named FreeBSD in "c:\" so it'll look like c:\FreeBSD. Then I use 7-zip to extract all the isos into c:\FreeBSD starting from bottom up (x-docs.iso -> x-disc3.iso -> x-disc2.iso -> x-disc1.iso). Sure you can extract whichever combination you want but I just want to be sure. Then browse c:\FreeBSD\boot\ to see if there's a file call cdboot. We'll need that later. NOTE: If you found a folder named [BOOT] (not boot, you can safely delete that.

Now inside c:\FreeBSD, edit the file cdrom.inf. I use GVim Portable. You'll find something like:

CD_VERSION = 7.0-RELEASE
CD_VOLUME = 1


You can safely delete all the other line and JUST LEAVE the CD_VERSION = 7.0-RELEASE. Then save the file.

Now browse to c:\FreeBSD\packages\. I use GVim Portable and edit the file INDEX. This part is a bit tricky is you don't read carefully. Using your text editor "replace" function, delete all occurance of the words:

|1
|2
|3


To be sure, using your text editor's "search" function, find the word |1, |2 and |3 to see if there's any left. If there's none, good. We can continue.

Step #2: Get the cdrtool (we need mkisofs):
I downloaded all this tools stated below:

cdrtools-2.01-win32-bin.zip
dlls.zip
cygwin1.dll (version 1.5.25)


Then, using 7-zip, I extracted mkisofs.exe from cdrtools-2.01-win32-bin.zip into c:\WINDOWS folder. Then I extracted the file cygiconv2.dll and cygintl-8.dll from dlls.zip into c:\WINDOWS\system32. Finally I extracted cygwin1.dll into c:\WINDOWS\system32 folder.

Why can't I just extract the files to anywhere I wanted? Well, because I can use command prompt and run mkisofs from any folder I wanted. More on this below.

Step #3: Now the hard part begins. Well not so hard.
Now go open up the command prompt. You can use either "Start > All Programs > Accessories > Command Prompt" or "Start > Run" and type "cmd" then press Enter. Then type in:

cd c:\FreeBSD

to get into the FreeBSD folder. If you're using another folder name, go to that folder instead. Now we need to test out mkisofs. In the same command prompt, just type:

mkisofs

And you'll see something like:

mkisofs: Missing pathspec.
Usage: mkisofs [options] file...


If there's anything about missing cygwin1.dll, that means you didn't read the step #1. Ok now we know mkisofs is working. Let's roll. In the same command prompt, type this command:

mkisofs -o ../FreeBSD7.iso -R -J -V "FreeBSD7" -b boot/cdboot -no-emul-boot .

Remember to type it IN 1 (ONE) LINE. And yes the command ends with a "." (dot). See the -o ../FreeBSD7.iso? It means to create a file name FreeBSD7.iso in top folder, in this case c:\ root folder. Why? because I tried just -o FreeBSD7.iso and in the final iso, I see a file name, well guess what, FreeBSD7.iso in it. Drats. Now you can take a break while mkisofs is doing it's job. It'll take a while. Be sure to have enough hard disk space fer this sort of things but I tried this with only 3Gb empty space left. So fer most of us, it's nothing to worry about.

After a while, the job is done and the command prompt will display:

c:\FreeBSD>

again. So, congratulate yourself. Your iso is ready to be burn with any dvd burner program you have. In my case, Nero. Put in a blank DVD-R in your DVD-RW drive, and burn away the FreeBSD7.iso. Next. Boot and install FreeBSD. Enjoy it. You earn it friends.

Q: Why didn't you use growisofs? Well you're using mkisofs aren't you?
A: Because I don't know how. And heck I'm doing all this in XP x64.

Q: Why didn't you only use Nero to create the bootable dvd? Nero can do that.
A: Done it and the dvd can't boot the kernel. Read my previous post.

Q: Your mkisofs command is different from what I've read on the internet.
A: If you're talking about Dru's tutorial, I used her tutorial as a base, but I just can get her mkisofs command right on my pc. I guess her tutorial is just fer people using *BSD / linux. In my case, it's fer people using windows. Most importantly, this is fer me to remind meself on how I did it.

Q: Have you tested the FreeBSD dvd you've created?
A: Yes I have. I even tested using sysinstall to install some packages. Tested installing links and all the dependencies have no issue whatsoever. And installing from a dvd is great! The speed is awesome. Anyway, that's the only test I've done so far today, didn't do any full installation though but I'm sure it's fine. Just to add a note, I sacrifice 2 dvd-r before I made the final working FreeBSD 7.0 dvd. Quite a loss, in my current state but well worth the effort and knowledge.

Q: I need to know..
A: Go away!

Haha. Later then. Good luck!

p/s: I'm not done with OpenBSD though. I'll be back fer more testing. I MUST have a working OpenBSD installation up a running no matter what.

RDX200: FreeBSD 7.0 AMD64 installation is ok and running.

Latest news. FreeBSD 7.0 AMD64 installation went smoothly. It's been quite some time since I installed FreeBSD so it's like re-living the memories. I found out that I can't use my previous partition scheme because root folder "/" is not big enough. So I learnt something new here. Fer FreeBSD my partition scheme is:

/ = 500M
swap = 512M (Although automatically installation defaulted to more than 800M)
/tmp = 512M
/var = 1Gb
/usr = rest

Fer OpenBSD, I made root "/" with only 128M with no problem. I've adjusted the space so that fer next OpenBSD installation, the "/" will have 256M space. Just in case.

Installation was ok. I installed only the base system, just to test it out. I downloaded 4 iso (you got me right. 4!) and tried to make a bootable dvd using nero but failed miserably. I know there's tutorial out there on how to make FreeBSD dvds, but I can't find one using Nero. Only mkisofs. I can boot the dvd but it can't find the kernel to boot the installation. So it's a failure.

Back to the topic. After the installation, FreeBSD booted flawlessly. No problem whatsoever. So I guess there must be a hardware somewhere making trouble on my OpenBSD installation. My vote is on the faulty NIC. I'll try another OpenBSD shot later.

6.5 amd64: Modify existing certbot certificates.

Hi, It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to ...