Changing The Default OS to Boot in Grub (Ubuntu, etc.)

Dual booting Ubuntu with some version of Windows is highly desirable for many of us. It allows you have the ability to revert to the legacy Windows operating system when you want to run a video game or some other application that hasn’t been implemented on Linux yet. Some of us with domestic partners, or pets/children, have the need to make the default O/S that boots Windows. For example, my pet gerbil designs websites for a living, but has has trouble with Ubuntu.

With the release of Natty (Ubuntu 11.4) startupmanager no longer works to select the O/S to boot. While there are alternative applications, it would be nice to have a simple way to configure this. After spending some time researching the matter, I have found the answer (for those using Natty Ubuntu, or an installation of Linux with Grub2 1.99 or possibly later):

sudo grub-set-default 4

The number 4 is the position in the list of actions Grub displays during boot. The first entry, usually the most recent Linux kernel you’ve installed, is entry0. On my machine, Windoze XP was the 4th (again, starting from 0).

Note that if a new kernel is installed, or if for any reason other entries are added to the Grub list, then your change will be broken, and you’ll need to enter the new position of the desired entry. But now you know a one-liner that will fix it.

If grub-set-default doesn’t work on your machine, then it probably won’t work on your machine: know what I’m sayin’ ?

Netscreen 25 Search Domain Configuration

We set up an old Junper Netscreen 25 firewall/router to partition off a part of the local LAN and free up some IPs. We put about 30-40 clients devices on it and the router worked fine other than being limited to 100BaseT.

The problem was, DHCP clients were getting “netscreen-25” as the search domain. The PC’s were only slowed down a tad, but some CentOS machines got severe indigestion, name resolution-wise. Manually removing the “netscreen-25” SPAM from /etc/resolv.conf solved that problem. The web interface had no knobs or switches to control this behavior.

The solution was to issue the following command for each interface on which DHCP info was being handed out:

set interface ethernet2 dhcp server option domainname ourthing.local

Obviously, above you’ll replace “ourthing.local” with the domain you want searched first (for unqualified names). Replace the ethernet interface number as appropriate. I didn’t get a chance to figure out how to have nothing handed out there; if you have please let us know in a comment!

The hurt about using this rig is that it doesn’t support IGRP (although it supports BGP and OSPF!) and it doesn’t provide much in the way of reporting. In our case, it didn’t cost anything and helped make more room in the discard pile. The Netscreen 25 has an MTBF of 8.1 years, according to Juniper. Older models may not have the Juniper name on the face.

For the best synopsis of this old rig I could find as of this writing, look here.

Setting up NTP on CentOS

Every network with more than one *nix box on it needs time synchronization. You can use the /usr/sbin/ntpdate command every now and then, or run it from cron. That’s good enough for casual work. But if your machine count is larger, or if you need more accurate synchronisation, having a local time source on your LAN may be desirable.

Login as the root user

Type the following command to install ntp

# yum install ntp

Turn on service

# chkconfig ntpd on

Synchronize the system clock with server:

# ntpdate

Start the NTP:

# /etc/init.d/ntpd start