&
Advertise Here with Today.com
 

Archive for January, 2009

Jan 17 2009

AutoFsck - a better way to treat the filesystem check after 30 boot up

Published by linuxubuntu under Uncategorized Edit This

Any one who have used Ubuntu Linux for longer than a month must have realized that every 30 times you boot up you are forced to run a file system check. This file system check is done, in order to keep your filesystem healthy. Turning the check off completely is generally not recommended. A solution is to increase the number of maximum mounts from 30 to some larger number like 100. But this solution is also not recommended.

AutoFsck is a set of scripts that replaces the file system check script(that comes shipped with Ubuntu). The difference is that AutoFsck doesn’t ruin your day if you are so unfortunate to encounter the 30th mount. The most important difference is that AutoFsck does its check during the shutdown process, not during boot(when you need your computer the most!).

The 30th time you mount your filesystem, AutoFsck will wait until you shut down your computer. It will then ask you if it is convenient for you to check your filesystem. If it is convenient for you, then AutoFsck will restart your computer, automatically execute the filesystem check, and then immediately power down your system. If it is not convenient for you to check your filesystem at that moment, then AutoFsck will wait until the next time you shut down your computer to ask you again. Being prompted for a file system check during shutdown is infinitely more convenient than being forced to sit through a 15 minute check during boot up.

Here is how you can change to AutoFsck.

1. Download the package. It is available on the project page ,(Direct link) .
2. Extract the contents of the archive to anywhere that is convenient for you.
3. Inside that folder, run the script called ‘install’.
4. Follow the on-screen instructions.
5. AutoFsck will start working immediately.

I haven’t done much reading about whether or not this script will be included in the next release of Ubuntu, but I definitely think it should be. AutoFsck finally makes Ubuntu the ultimate distribution of Linux.

Advertise Here with Today.com

No responses yet

Jan 16 2009

Get paid for blogging

Published by linuxubuntu under Uncategorized Edit This

You will be paid( $1 ) for one blog(of 100 words) a day. And get $0.002 for each visitors to your blog….

Click Here to start.

No responses yet

Jan 14 2009

Change the order in the boot list of your grub

Published by linuxubuntu under Uncategorized Edit This

1. Open the file menu.lst

$ sudo gedit /boot/grub/menu.lst

my menu.lst :

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify ’saved’ instead of a number. In this case, the default entry
# is the entry saved with the command ’savedefault’.
# WARNING: If you are using dmraid do not use ’savedefault’ or your
# array will desync and will not let you boot your system.
default        0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout        10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
color cyan/blue white/blue

## password [’–md5′] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command ‘lock’
# e.g. password topsecret
## password –md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title        Windows 95/98/NT/2000
# root        (hd0,0)
# makeactive
# chainloader    +1
#
# title        Linux
# root        (hd0,1)
# kernel    /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=4eb97a53-7aa5-4080-80a2-76314d37f5c9

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title        Ubuntu 8.10, kernel 2.6.27-9-generic
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-9-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-9-generic (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-9-generic

title        Ubuntu 8.10, kernel 2.6.27-7-generic
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-7-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-7-generic

title        Ubuntu 8.10, kernel 2.6.27-3-rt
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-3-rt root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-3-rt
quiet

title        Ubuntu 8.10, kernel 2.6.27-3-rt (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-3-rt root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-3-rt

title        Ubuntu 8.10, memtest86+
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Windows Vista/Longhorn (loader)
root        (hd0,0)
savedefault
makeactive
chainloader    +1

2. Now if you see the bottom portion you can see the order of your boot list…

mine is :

title        Ubuntu 8.10, kernel 2.6.27-9-generic
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-9-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-9-generic (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-9-generic

title        Ubuntu 8.10, kernel 2.6.27-7-generic
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-7-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-7-generic

title        Ubuntu 8.10, kernel 2.6.27-3-rt
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-3-rt root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro quiet splash
initrd        /boot/initrd.img-2.6.27-3-rt
quiet

title        Ubuntu 8.10, kernel 2.6.27-3-rt (recovery mode)
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/vmlinuz-2.6.27-3-rt root=UUID=4eb97a53-7aa5-4080-80a2-76314d37f5c9 ro  single
initrd        /boot/initrd.img-2.6.27-3-rt

title        Ubuntu 8.10, memtest86+
uuid        4eb97a53-7aa5-4080-80a2-76314d37f5c9
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Windows Vista/Longhorn (loader)
root        (hd0,0)
savedefault
makeactive
chainloader    +1

3. Now just cut and paste the block of code for each os, according to your

No responses yet

Jan 05 2009

Dual boot the easy way

Published by linuxubuntu under Uncategorized Edit This

Windows can stay on your computer, when you install Ubuntu! It’s handy to turn your computer into a dual boot machine. That way you can choose each time you turn on your computer, what operating system you want to boot: Ubuntu or Windows.

It’s easy to do this:

1. Backup all your documents, pictures, music et cetera, on an external storage medium.

2. Make Windows defragment itself, with it’s own defrag tool.

3. Unplug all peripherals from your computer, except for mouse, keyboard and printer.

4. Wire your computer: temporarily establish internet connection with an ethernet cable, wired internet therefore. If you have a laptop, connect the power cord as well: you definitely don’t want to run the risk of an empty battery during the installation of an operating system.

5. Boot your computer from the Ubuntu Desktop CD and choose “Check CD for defects”, thus performing an integrity check on the CD. The CD has to be completely error free. If it’s not, burn a new CD with very low speed (8 x).

6. Then choose “Install Ubuntu” in the boot menu of the Ubuntu Desktop CD. The installer will start by asking you a couple of questions. Only after you have answered all of those, installation will begin.

7. One of the last questions will be a disk partitioning proposal. The installer will namely propose to free some space on the hard disk. Thus leaving somewhat less space for Windows and allowing Ubuntu to be put on the cleared space.

In principle, you can simply agree with this proposal of the installer. However, the installer tends to underestimate the disk space (the surplus empty “breathing space”) needed by Windows. So you may want to increase the disk space for Windows, by moving the slider. Note: give Ubuntu preferably no less than 10 GB.

In other words: the installer assumes automatically (by default) that you don’t want to wipe Windows and that you want a dual boot computer. Ubuntu is user friendly!

8. Now the installation of Ubuntu takes place and in the end you have a dual boot computer.

9. The first time you start Windows in the dual boot configuration, Windows will discover that it’s disk space has shrunk. Windows has to adjust itself to that.

During the first Windows boot you’ll see therefore a blue screen with white letters, informing you that Windows is checking the hard disk and “repairing” it. Simply let it do it’s job. Afterwards Windows will want to reboot. Go along with it. Then Windows is used to it’s new disk space and will function normally.

10. That’s it! You’re done.

No responses yet

Jan 04 2009

kernel-source for your distro?

Published by linuxubuntu under Uncategorized Edit This

These steps should save you some time, trouble and many headaches. In the even that you neglected to read the release notes for FC3…eh-hem…the FC project has decided not to supply the kernel-source in order to prevent redundancy. You see, the kernel-source tree can be extracted from the kernel-*.src.rpm if you absolutely need it. In my case, I needed to supply the –kernel-source-path when (re)installing the latest NVIDIA drivers (more on NVIDIA drivers below…) after rebooting with a new kernel. So, here are the steps that you should follow in order to extract the kernel-source tree from the kernel-*.src.rpm:
Step (1). Go find the kernel-*.src.rpm (#> locate kernel-*.src.rpm) or download it from the Internets. For instance, you could get it from here .
Step (2). Now you must install the rpm. As root, execute
#> rpm -Uvh kernel-*.src.rpm
Step (3). The previous step should have created a kernel-2.6.spec (or similarly kernel-2.4.spec if you’re still on that kernel) file in the /usr/src/redhat/SPECS/ directory. You must build the rpm against this .spec file to get the binaries and source.
As root, execute
#> rpmbuild -bp –target=noarch /usr/src/redhat/SPECS/kernel-2.6.spec
Step (4). Create the necessary symbolic links for your directory tree:
#> cd /usr/src
#> ln -s redhat/BUILD/kernel-2.6.10/linux-2.6.10/ linux
#> ln -s redhat/BUILD/kernel-2.6.10/linux-2.6.10/ linux-2.6.10
Step (5). Now we need to make the new .config files:
#> cd /usr/src/linux-2.6.10
#> make mrproper
#> cp /usr/src/linux-2.6.10/configs/kernel-2.6.10-i686.config /usr/src/linux-2.6.10/.config
#> make oldconfig
#> make menuconfig
#> make
Now, you have a kernel-source tree under /usr/src/linux-2.6.10 just like you would if you had been supplied the kernel-source in the first place. Note that the kernel numbers (i.e. 2.6, 2.6.10, etc.) and system architecture numbers (i.e. i686) may be different for your situation. Replace with correct numbers/information where necessary. I was able to install the new NVIDIA drivers by executing:

#> sh NVIDIA-Linux-x86-1.0-###-pkg1.run –kernel-source-path /usr/src/linux-2.6.10

No responses yet

Jan 03 2009

Remote syslog logging on Ubuntu

Published by linuxubuntu under Uncategorized Edit This

syslogd is the Linux system logging utility that take care of filling up your files in /var/log when it is asked to.

On a standard system, logging is only done on the local drive. But syslog can be configured to receive logging from a remote client, or to send logging to a remote syslog server.

Some of the use cases could be:

* A machine which filesystem goes read-only
* Log replication

this tutorial will explain how to set up both the server, to receive message from a remote client, and the client to emit messages to a syslogd server.

In this tutorial I will consider that you do not have any firewalls interfering with the traffic.
The syslogd server will be called etch32 and has IP 192.168.2.1.
The client is called hardy32-1. Its IP do not matter.

syslogd is using UDP on port 514
1. Setting up the syslogd server

The distribution used for the server is, as its hostname says, a Debian Etch. But, unless you are not using a debian based distro, the changes will be the same.

changes for syslogd are pretty minor. We basically simply have to tell syslogd to listen for remote messages.
It is either opened or closed, there is no filtering, so if you need to only accept a subset of machines, IPtables will be your friend.

To enable remote logging, go and edit /etc/default/syslogd and make sure SYSLOGD is set to:

SYSLOGD=”-r”

then, restart syslogd:

# /etc/init.d/syslogd restart

Now, let set a client to send messages to our remote syslogd server.
2. syslogd clients

The action is in /etc/syslog.conf. In this example, I am going to send to both the remote syslogd server and to the filesystem the messages written to /var/log/messages.

In Ubuntu, this is the bit of conf that handle that:

*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages

The default is to send the messages to /var/log/messages without “synching” after each log messages (”-” in front of the file name.).

to specify a remote host, the name or the ip of the remote host as to be given instead of a file, and, prepended with an “@”. So, to send the messages writtent to /var/log/messages, our syslog.conf file will look like:

*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none @etch32

to have etch32 receiving messages from hardy32-1.

now, we need to make syslog aware of the chances:

$ sudo /etc/init.d/sysklogd restart
3. What happens then

Well, lets take a look at each /var/log/messages after I restarted syslogd on hardy32-1 and I started tcpdump on eth0:

Jun 30 23:01:59 etch32 dhcpd: added reverse map from 198.2.168.192.in-addr.arpa. to hardy32-1.lan.debuntu.local
Jun 30 23:01:59 etch32 dhcpd: DHCPREQUEST for 192.168.2.198 (192.168.2.1) from 00:0c:29:d4:01:57 (hardy32-1) via eth1
Jun 30 23:01:59 etch32 dhcpd: DHCPACK on 192.168.2.198 to 00:0c:29:d4:01:57 (hardy32-1) via eth1
Jun 30 23:04:15 hardy32-1.lan.debuntu.local syslogd 1.5.0#1ubuntu1: restart.
Jun 30 23:05:01 hardy32-1.lan.debuntu.local kernel: [ 6268.923820] device eth0 entered promiscuous mode
Jun 30 23:05:01 hardy32-1.lan.debuntu.local kernel: [ 6268.923847] audit(1214863498.177:3): dev=eth0 prom=256 old_prom=0 auid=4294967295
Jun 30 23:05:11 hardy32-1.lan.debuntu.local kernel: [ 6278.677844] device eth0 left promiscuous mode
Jun 30 23:05:11 hardy32-1.lan.debuntu.local kernel: [ 6278.677869] audit(1214863510.404:4): dev=eth0 prom=0 old_prom=256 auid=4294967295

As you can see, messages from hardy32-1 contains the box FQDN: hardy32-1.lan.debuntu.local and we see that eth0 went temporarily in promiscuous mode.

No responses yet

Jan 01 2009

Choose the right ubuntu for your system

Published by linuxubuntu under Uncategorized Edit This

1. Choose Ubuntu 8.04 and not 8.10, if 8.04 runs well on your hardware.

If you don’t need the new drivers of 8.10 for your hardware, 8.04 is the better choice. Because it’s LTS (Long Term Supported) and of enterprise quality (extra reliable and extra stable).

See this graph of the lifecycle of Ubuntu versions .

8.10 is good, but 8.04 is simply better.

2. Pick 32-bit and not 64-bit

The generic 32-bit Ubuntu runs on everything and is usually a better choice than 64-bit Ubuntu. Because for 64-bit Ubuntu, there are still less applications available and less hardware drivers. Furthermore, 64-bit Ubuntu runs only marginally faster than 32-bit.

However, if you have more than 3 GB RAM in your computer, you may prefer 64-bit Ubuntu. Because only then you will be able to fully utilize your computer’s RAM. With 32-bit Ubuntu, 3 GB RAM is the maximum useable amount of memory.

Because of the 32-bit memory hole, with 4 GB RAM you can only partially use the last GB. And the GB’s above 4 GB are completely useless. This applies to all 32-bit operating systems, including 32-bit Windows and Mac OS.

Here you can get a free copy of Ubuntu 8.10 .

No responses yet

Advertise Here