Showing posts with label freebsd. Show all posts
Showing posts with label freebsd. Show all posts

Thursday, August 05, 2010

I hate Linux part 2

OK, I was able to run SystemRescueCd's USB creator by running it in Ubuntu Lucid. The USB stick booted, but when I ran GParted, it wasn't able to detect the RAID array.

Linux = FAIL.

The point of this exercise was to run GParted in order to resize our FreeBSD's /usr partition to make way for ZFS. I allocated around ~400GB of space to that partition, but I realized that it's better to use that space for ZFS since I'll be using it for jails.

FreeBSD jails + ZFS = WIN.

I'll just copy /usr to /var, resize it, and move back /usr to the new partition. I hope this works.


(this is probably GParted's fault, but I love to troll hahaha)

Monday, July 26, 2010

FreeBSD: Unable to find device node for dev /dev/ar0s1b in /dev

Problem:
Sysinstall can't continue and stops with the error, "unable to find device node for dev /dev/ar0s1b in /dev".

Solution:
Remove the existing partition table by writing zeros at the start of the disk:
dd if=/dev/zero of=/dev/ar0 bs=64k count=1
(replace as necessary, e.g., ad0)

Monday, February 08, 2010

FreeBSD on Eee

I've managed to install FreeBSD 8.0 on my Eee. I was planning to install NetBSD 5.0, but I found out that I had to convert the ISO to a memory stick image before I can dd it. For some reasons, unetbootin doesn't work with NetBSD's ISOs. There's a script that converts NetBSD ISOs to memstick images, but it seems that it only works on an existing *BSD system. I could have just SSH'd into a remote NetBSD system so that I can run the script there, but I realized that the output would be too big. SSH access is a privilege and not a right; abusing it with large file transfers is a big no-no.

I tried to manually create an image using Mac OS X, but I couldn't initialize my USB stick's MBR (i.e., I couldn't boot from the USB). It says that it couldn't find "/usr/standalone/i386/boot0". I searched for it at the Mac OS X' original install discs, but I couldn't find it there either.

It is possible to install NetBSD using Mac OS X, but I was like, FreeBSD is already available as a memstick image from its FTP site. Why not use it? Thus, I downloaded it, dd'd it to my USB stick, and installed it on my Eee. Everything was straightforward.

Straightforward is boring. I'll try to recompile the kernel to see if I can further reduce its boot time (it boots less than 20sec from GRUB to login). I strongly suspect that I'll just reduce its space but not its boot time, but I'll never know until I try. I'll also try to install NetBSD via PXE, once I'm done playing with FreeBSD. I haven't tried doing it yet.

Wednesday, January 27, 2010

HOWTO Let lighttpd listen to both IPv4 and IPv6 on *BSD.

Okay, I've managed to let lighttpd listen to both IPv4 and IPv6 requests without using IPv4-mapped addresses. According to an Internet draft, IPv4 mapped addresses are considered harmful (R.I.P., itojun :). This has already been turned off in *BSDs by default but not in Linux.

Anyway, I've found out that if sysctl net.inet6.ip6.v6only is set to 1, enabling IPv6 in lighttpd would cause it to listen to IPv6 only. To solve this, you need to use these settings:
server.use-ipv6 = "enable"
$SERVER["socket"] == "0.0.0.0:80" {
}
If you need to use SSL, simply use:
server.use-ipv6 = "enable"
ssl.engine = "enable"
ssl.pemfile = "/var/etc/cert.pem"

$SERVER["socket"] == "0.0.0.0:443" {
ssl.engine = "enable"
ssl.pemfile = "/var/etc/cert.pem"
}
Tada! It works:
root@soulfury:/# sockstat | grep lighttpd
root lighttpd 23974 4 tcp6 *:443 *:*
root lighttpd 23974 5 tcp4 *:443 *:*
root@soulfury:/# sysctl -a | grep v6only
net.inet6.ip6.v6only: 1

Thursday, November 13, 2008

FreeBSD Problem: Can't see files/dirty state at each boot.

Weird problem. The filesystem is in an unclean state at each boot, even though I have ran fsck before booting the system. Initially, our problem is that our app can't "see" certain files at first read, although subsequent attempts on reading them are OK. Later, we discovered that the filesystem is dirty at each boot. The problem is similar to this issue in FreeBSD-CURRENT. We're using FreeBSD 7.0-RELEASE though, so I'm not sure if we have the same problem. I need to track this down.

Monday, October 27, 2008

Slow lighttpd using IPv6

I've been wondering why lighttpd seems to be so slow when IPv6 is enabled. I discovered that I had to bump the minimum and maximum number of FastCGI process (min-procs/max-procs) by twice as much because it appears that lighttpd divides the available PHP processes between IPv4 and IPv6. I dunno why it does that.

Thursday, October 16, 2008

How to destroy all gif interfaces in FreeBSD

To destroy all gif interfaces in FreeBSD (vanilla Bourne shell):
for i in `ifconfig -a | grep gif | grep -v '%' | sed -n -e 's/\(.*\):.*/\1/p'`; do
ifconfig $i destroy
done

Wednesday, October 01, 2008

Library dependency woes

One of my Unix workstation is now fucked up due to forced installation of incompatible libraries. I guess I'll have to reformat it in order to start from a clean slate. I'm planning to temporarily transfer my files to my external harddisk, but FreeBSD can't seem to read it although it has been formatted as UFS. I formatted that harddisk on my Mac OS X laptop, thinking that it can be read in FreeBSD, but Mac OS X seems to have a different interpretation of what UFS is. Blah. I guess I need to reformat my external harddisk to FAT32 too. Oh wait. If I format it as FAT32, what would happen with my file permissions? Maybe I'll just use tar or something. Blah, blah, blah.

Saturday, April 26, 2008

FreeBSD Tip: How to delete all IPv6 address in an interface

You can delete all IPv6 addresses in an interface using the following command (vanilla Bourne shell):

while i="`ifconfig le0 | grep inet6 | grep -m 1 -v '%'`"; do
ifconfig le0 $i delete
done
Note: replace le0 with your interface name.

Friday, April 25, 2008

Bridge problem with FreeBSD 7.0-RELEASE

Problem
The FreeBSD Handbook states that "if the bridge host needs an IP address, then the correct place to set this is on the bridge interface itself rather than one of the member interfaces."

With FreeBSD 6.x and FreeBSD 8.0-CURRENT, setting the IP address on the bridge works without any problem. With FreeBSD 7.0-RELEASE, however, this does not work. The OS doesn't even properly boot when the IP address is set via /etc/rc.conf.

Solution
This is probably a temporary solution, but try setting the IP address to one of the member interface. This is in direct opposition to the advice given in the Handbook, but it works for me.

If this is a bug (which I suspect it is), a patch probably exists somewhere. Please feel free to leave a comment.

Friday, March 07, 2008

cvsmode in csup

Nice, there are now patches for CVSMode support in csup: http://people.freebsd.org/~lulf/patches/csup/cvsmode/. This means that csup can now fetch complete CVS repositories. Thank you Ulf, whoever you are!

Tuesday, January 22, 2008

Xen on FreeBSD-8.0

Oooh, there are updates on www.fsmware.com! Finally! :) Check out the FreeBSD/Xen wiki as well.

BSD on a box with ICH9 chipset

I've been trying to install FreeBSD on a box with an ICH9 chipset to no avail. FreeBSD-CURRENT (the soon to be 8.0) doesn't seem to work either. There has been discussions in the mailing list that it works with FreeBSD-CURRENT, but it really doesn't work on my box.

NetBSD seems to support ICH9 on 4.0, but I prefer FreeBSD over NetBSD. Oh well, I'll just download the ISO and see how it goes. If it works, then I'll try to replace the kernel with a Xen hypervisor. Our box has a whooping 250GB of hard disk space, and it's more than enough to run a few domU Linux systems. Hmmm... It'll also be an opportunity to run Plan 9 domU as well. I haven't tried that yet. I'm wetting my pants with nerdish delight now.

Monday, October 08, 2007

pfSense HTTPS fixed

OK, I found the problem. The fix is very simple:
$SERVER["socket"] == "0.0.0.0:443" {
ssl.engine = "enable"
ssl.pemfile = "/var/etc/cert.pem"
}

I'll commit this change soon.

fixing pfSense' HTTPS support

lighttpd seems to have an issue when enabling both IPv4 and IPv6. With plain HTTP, enabling them both is a simple matter of adding the following lines:
server.use-ipv6            = "enable"
$SERVER["socket"] == "0.0.0.0:80" { }

With HTTPS, however, $SERVER["socket"] == "0.0.0.0:443" doesn't seem to work. Although sockstat reports that lighttpd is indeed listening to port 443, https://<ip_address> doesn't work. http://<ip_address>:443 work, but this is just plain HTTP served on port 443. Weird. the following is sockstat's output:
root     lighttpd   53320 4  tcp6   *:443           *:*
root lighttpd 53320 5 tcp4 *:443 *:*

Tuesday, October 02, 2007

buffer overflow

Aaaaargh! I'm getting too many interrupt-level buffer overflows with FreeBSD 7.0-CURRENT. I can't connect to the network. Yeah, yeah. I know that using the bleeding-edge development branch is tantamount to suicide. But what the heck.

Monday, October 01, 2007

Should I experiment on using DragonFlyBSD?

My Soekris net4801 box, which acts as my Ethernet switch by bridging all of its ports, is experiencing intermittent slowdown, especially under heavy load. This has occurred after replacing its OS from FreeBSD 6.2 to FreeBSD 7.0-CURRENT, March snapshot. I think it's because it had some critical bugs last March (I was too lazy to download a September snapshot) and because WITNESS, INVARIANTS, and other debugging options have been enabled in the kernel. Instead of rebuilding the kernel, I'm thinking of using DragonFlyBSD instead. I want to experiment. I'll do this on Saturday so as not to interfere with my work.